MCPcopy Create free account
hub / github.com/buger/jsonparser / TestBytesParseInt

Function TestBytesParseInt

bytes_test.go:109–121  ·  view source on GitHub ↗

Verifies: SYS-REQ-015 [boundary] MCDC SYS-REQ-015: N/A

(t *testing.T)

Source from the content-addressed store, hash-verified

107// Verifies: SYS-REQ-015 [boundary]
108// MCDC SYS-REQ-015: N/A
109func TestBytesParseInt(t *testing.T) {
110 for _, test := range parseIntTests {
111 out, ok, overflow := parseInt([]byte(test.in))
112 if overflow != test.isOverflow {
113 t.Errorf("Test '%s' error return did not overflow expectation (obtained %t, expected %t)", test.in, overflow, test.isOverflow)
114 }
115 if ok != !test.isErr {
116 t.Errorf("Test '%s' error return did not match expectation (obtained %t, expected %t)", test.in, !ok, test.isErr)
117 } else if ok && out != test.out {
118 t.Errorf("Test '%s' did not return the expected value (obtained %d, expected %d)", test.in, out, test.out)
119 }
120 }
121}
122
123// Verifies: SYS-REQ-015 [example]
124// MCDC SYS-REQ-015: N/A

Callers

nothing calls this directly

Calls 1

parseIntFunction · 0.85

Tested by

no test coverage detected