(t *testing.T)
| 1256 | } |
| 1257 | |
| 1258 | func TestHiddenFlagUsage(t *testing.T) { |
| 1259 | f := NewFlagSet("bob", ContinueOnError) |
| 1260 | f.Bool("secretFlag", true, "shhh") |
| 1261 | f.MarkHidden("secretFlag") |
| 1262 | |
| 1263 | args := []string{"--secretFlag"} |
| 1264 | out, err := parseReturnStderr(t, f, args) |
| 1265 | if err != nil { |
| 1266 | t.Fatal("expected no error; got ", err) |
| 1267 | } |
| 1268 | |
| 1269 | if strings.Contains(out, "shhh") { |
| 1270 | t.Errorf("usage message printed when using a hidden flag!") |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | const defaultOutput = ` --A for bootstrapping, allow 'any' type |
| 1275 | --Alongflagname disable bounds checking |
nothing calls this directly
no test coverage detected