(t *testing.T)
| 18 | } |
| 19 | |
| 20 | func TestBinaryIterative(t *testing.T) { |
| 21 | for _, test := range searchTests { |
| 22 | actualValue, actualError := BinaryIterative(test.data, test.key) |
| 23 | if actualValue != test.expected { |
| 24 | t.Errorf("test '%s' failed: input array '%v' with key '%d', expected '%d', get '%d'", test.name, test.data, test.key, test.expected, actualValue) |
| 25 | } |
| 26 | if !errors.Is(test.expectedError, actualError) { |
| 27 | 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) |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | func TestLowerBound(t *testing.T) { |
| 33 | for _, test := range lowerBoundTests { |
nothing calls this directly
no test coverage detected