| 343 | } |
| 344 | |
| 345 | func TestFormatFlagString(t *testing.T) { |
| 346 | tests := []struct { |
| 347 | give format |
| 348 | want string |
| 349 | }{ |
| 350 | {formatAuto, "auto"}, |
| 351 | {formatAlways, "always"}, |
| 352 | {formatNever, "never"}, |
| 353 | {format(999), "format(999)"}, |
| 354 | } |
| 355 | |
| 356 | for _, tt := range tests { |
| 357 | t.Run(fmt.Sprintf("%d", tt.give), func(t *testing.T) { |
| 358 | if want, got := tt.want, tt.give.String(); got != want { |
| 359 | t.Errorf("got %q, want %q", got, want) |
| 360 | } |
| 361 | }) |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | func TestShouldFormat(t *testing.T) { |
| 366 | tests := []struct { |