This commit is contained in:
Erik Winter 2024-11-13 07:24:21 +01:00
parent b772ca5df4
commit 434dfed8af
1 changed files with 34 additions and 0 deletions

34
plan/command/flag_test.go Normal file
View File

@ -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)
}
}