(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestInterpolation(t *testing.T) { |
| 6 | for _, test := range searchTests { |
| 7 | actualValue, actualError := Interpolation(test.data, test.key) |
| 8 | if actualValue != test.expected { |
| 9 | t.Errorf("test '%s' failed: input array '%v' with key '%d', expected '%d', get '%d'", test.name, test.data, test.key, test.expected, actualValue) |
| 10 | } |
| 11 | if actualError != test.expectedError { |
| 12 | t.Errorf("test '%s' failed: input array '%v' with key '%d', expected error '%s', get error '%s'", test.name, test.data, test.key, test.expectedError, actualError) |
| 13 | } |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | func BenchmarkInterpolation(b *testing.B) { |
| 18 | testCase := generateBenchmarkTestCase() |
nothing calls this directly
no test coverage detected