(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestUpperBound(t *testing.T) { |
| 45 | for _, test := range upperBoundTests { |
| 46 | actualValue, actualError := UpperBound(test.data, test.key) |
| 47 | if actualValue != test.expected { |
| 48 | t.Errorf("test '%s' failed: input array '%v' with key '%d', expected '%d', get '%d'", test.name, test.data, test.key, test.expected, actualValue) |
| 49 | } |
| 50 | if !errors.Is(test.expectedError, actualError) { |
| 51 | 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) |
| 52 | } |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | func BenchmarkBinary(b *testing.B) { |
| 57 | testCase := generateBenchmarkTestCase() |
nothing calls this directly
no test coverage detected