MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestLowerBound

Function TestLowerBound

search/binary_test.go:32–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestLowerBound(t *testing.T) {
33 for _, test := range lowerBoundTests {
34 actualValue, actualError := LowerBound(test.data, test.key)
35 if actualValue != test.expected {
36 t.Errorf("test '%s' failed: input array '%v' with key '%d', expected '%d', get '%d'", test.name, test.data, test.key, test.expected, actualValue)
37 }
38 if !errors.Is(test.expectedError, actualError) {
39 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)
40 }
41 }
42}
43
44func TestUpperBound(t *testing.T) {
45 for _, test := range upperBoundTests {

Callers

nothing calls this directly

Calls 1

LowerBoundFunction · 0.85

Tested by

no test coverage detected