wip
This commit is contained in:
parent
b772ca5df4
commit
434dfed8af
|
@ -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)
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue