Skip to content

Commit 96c99d5

Browse files
committed
Add tests for no- prefix options
License: MIT Signed-off-by: Jakub Sztandera <[email protected]>
1 parent c06dfc1 commit 96c99d5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

commands/cli/parse_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ func TestOptionParsing(t *testing.T) {
134134
test("-b test false", kvs{"b": true}, words{"false"})
135135
test("-b --string foo test bar", kvs{"b": true, "string": "foo"}, words{"bar"})
136136
test("-b=false --string bar", kvs{"b": false, "string": "bar"}, words{})
137+
test("--no-b", kvs{"b": false}, words{})
138+
test("--no-b=true", kvs{"b": false}, words{})
139+
test("--no-b=false", kvs{"b": true}, words{})
140+
testFail("--no-s test")
137141
testFail("foo test")
138142
}
139143

0 commit comments

Comments
 (0)