MCPcopy Create free account
hub / github.com/docopt/docopt.go / TestMatchingParen

Function TestMatchingParen

docopt_test.go:1115–1124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1113}
1114
1115func TestMatchingParen(t *testing.T) {
1116 _, err := Parse("Usage: prog [a [b]", []string{}, true, "", false, false)
1117 if _, ok := err.(*LanguageError); !ok {
1118 t.Error(err)
1119 }
1120 _, err = Parse("Usage: prog [a [b] ] c )", []string{}, true, "", false, false)
1121 if _, ok := err.(*LanguageError); !ok {
1122 t.Error(err)
1123 }
1124}
1125
1126func TestAllowDoubleDash(t *testing.T) {
1127 if v, err := Parse("usage: prog [-o] [--] <arg>\noptions: -o", []string{"--", "-o"}, true, "", false, false); reflect.DeepEqual(v, map[string]interface{}{"-o": false, "<arg>": "-o", "--": true}) != true {

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected