From 434dfed8af9c21e9be6dc3ec1883f138d8c9e424 Mon Sep 17 00:00:00 2001 From: Erik Winter Date: Wed, 13 Nov 2024 07:24:21 +0100 Subject: [PATCH] wip --- plan/command/flag_test.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 plan/command/flag_test.go diff --git a/plan/command/flag_test.go b/plan/command/flag_test.go new file mode 100644 index 0000000..af03dd8 --- /dev/null +++ b/plan/command/flag_test.go @@ -0,0 +1,34 @@ +package command_test + +import ( + "testing" + + "go-mod.ewintr.nl/planner/plan/command" +) + +func TestFlagString(t *testing.T) { + t.Parallel() + + valid := "test" + f := command.FlagString{} + if f.IsSet() { + t.Errorf("exp false, gor true") + } + + if err := f.Set(valid); err != nil { + t.Errorf("exp nil, got %v", err) + } + + if !f.IsSet() { + t.Errorf("exp true, got false") + } + + act, ok := f.Get().(string) + if !ok { + t.Errorf("exp true, got false") + } + if act != valid { + t.Errorf("exp %v, got %v", valid, act) + } + +}