We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 54c53f9 commit 1425588Copy full SHA for 1425588
1 file changed
flags_test.go
@@ -57,3 +57,18 @@ func TestFlagsSet(t *testing.T) {
57
}
58
59
60
+
61
+func TestFlagMin(t *testing.T) {
62
+ var f uintFlag
63
+ f.min = 1 // Set minimum to 1
64
+ err := f.Set("0") // and try and set to zero
65
+ if err == nil {
66
+ t.Fatal("Expected an error trying to set a min value to zero")
67
+ }
68
69
+ got := err.Error()
70
+ exp := "Less than minimum"
71
+ if !strings.Contains(got, exp) {
72
+ t.Error("Expected 'Less than minimum', but got", got)
73
74
+}
0 commit comments