(t *testing.T)
| 77 | } |
| 78 | |
| 79 | func TestPathCleanMallocs(t *testing.T) { |
| 80 | if testing.Short() { |
| 81 | t.Skip("skipping malloc count in short mode") |
| 82 | } |
| 83 | |
| 84 | if runtime.GOMAXPROCS(0) > 1 { |
| 85 | t.Skip("skipping malloc count; GOMAXPROCS>1") |
| 86 | } |
| 87 | |
| 88 | for _, test := range cleanTests { |
| 89 | allocs := testing.AllocsPerRun(100, func() { cleanPath(test.result) }) |
| 90 | assert.InDelta(t, 0, allocs, 0.01) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | func BenchmarkPathClean(b *testing.B) { |
| 95 | b.ReportAllocs() |
nothing calls this directly
no test coverage detected