MCPcopy Create free account
hub / github.com/bracesdev/errtrace / TestFormatFlagString

Function TestFormatFlagString

cmd/errtrace/main_test.go:345–363  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

343}
344
345func 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
365func TestShouldFormat(t *testing.T) {
366 tests := []struct {

Callers

nothing calls this directly

Calls 3

formatTypeAlias · 0.85
RunMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected