(t *testing.T)
| 1047 | } |
| 1048 | |
| 1049 | func TestNoInterspersed(t *testing.T) { |
| 1050 | f := NewFlagSet("test", ContinueOnError) |
| 1051 | f.SetInterspersed(false) |
| 1052 | f.Bool("true", true, "always true") |
| 1053 | f.Bool("false", false, "always false") |
| 1054 | err := f.Parse([]string{"--true", "break", "--false"}) |
| 1055 | if err != nil { |
| 1056 | t.Fatal("expected no error; got ", err) |
| 1057 | } |
| 1058 | args := f.Args() |
| 1059 | if len(args) != 2 || args[0] != "break" || args[1] != "--false" { |
| 1060 | t.Fatal("expected interspersed options/non-options to fail") |
| 1061 | } |
| 1062 | } |
| 1063 | |
| 1064 | func TestTermination(t *testing.T) { |
| 1065 | f := NewFlagSet("termination", ContinueOnError) |
nothing calls this directly
no test coverage detected