MCPcopy
hub / github.com/expr-lang/expr / TestFormatter

Function TestFormatter

internal/spew/format_test.go:1465–1498  ·  view source on GitHub ↗

TestFormatter executes all of the tests described by formatterTests.

(t *testing.T)

Source from the content-addressed store, hash-verified

1463
1464// TestFormatter executes all of the tests described by formatterTests.
1465func TestFormatter(t *testing.T) {
1466 // Setup tests.
1467 addIntFormatterTests()
1468 addUintFormatterTests()
1469 addBoolFormatterTests()
1470 addFloatFormatterTests()
1471 addComplexFormatterTests()
1472 addArrayFormatterTests()
1473 addSliceFormatterTests()
1474 addStringFormatterTests()
1475 addInterfaceFormatterTests()
1476 addMapFormatterTests()
1477 addStructFormatterTests()
1478 addUintptrFormatterTests()
1479 addUnsafePointerFormatterTests()
1480 addChanFormatterTests()
1481 addFuncFormatterTests()
1482 addCircularFormatterTests()
1483 addPanicFormatterTests()
1484 addErrorFormatterTests()
1485 addPassthroughFormatterTests()
1486
1487 t.Logf("Running %d tests", len(formatterTests))
1488 for i, test := range formatterTests {
1489 buf := new(bytes.Buffer)
1490 spew.Fprintf(buf, test.format, test.in)
1491 s := buf.String()
1492 if testFailed(s, test.wants) {
1493 t.Errorf("Formatter #%d format: %s got: %s %s", i, test.format, s,
1494 stringizeWants(test.wants))
1495 continue
1496 }
1497 }
1498}
1499
1500type testStruct struct {
1501 x int

Callers

nothing calls this directly

Calls 15

FprintfFunction · 0.92
addIntFormatterTestsFunction · 0.85
addUintFormatterTestsFunction · 0.85
addBoolFormatterTestsFunction · 0.85
addFloatFormatterTestsFunction · 0.85
addComplexFormatterTestsFunction · 0.85
addArrayFormatterTestsFunction · 0.85
addSliceFormatterTestsFunction · 0.85
addStringFormatterTestsFunction · 0.85
addMapFormatterTestsFunction · 0.85
addStructFormatterTestsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…