TestFormatter executes all of the tests described by formatterTests.
(t *testing.T)
| 1463 | |
| 1464 | // TestFormatter executes all of the tests described by formatterTests. |
| 1465 | func 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 | |
| 1500 | type testStruct struct { |
| 1501 | x int |
nothing calls this directly
no test coverage detected
searching dependent graphs…