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

Function TestGetInt

parser_test.go:1563–1574  ·  view source on GitHub ↗

Verifies: SYS-REQ-003 [example] STK-REQ-003:AC-1:acceptance MCDC SYS-REQ-003: addressed_value_is_number=F, raw_number_token_is_integer_parseable=T, returns_getint_value=F => TRUE MCDC SYS-REQ-003: addressed_value_is_number=T, raw_number_token_is_integer_parseable=F, returns_getint_value=F => TRUE MC

(t *testing.T)

Source from the content-addressed store, hash-verified

1561// MCDC SYS-REQ-003: addressed_value_is_number=T, raw_number_token_is_integer_parseable=T, returns_getint_value=F => FALSE
1562// MCDC SYS-REQ-003: addressed_value_is_number=T, raw_number_token_is_integer_parseable=T, returns_getint_value=T => TRUE
1563func TestGetInt(t *testing.T) {
1564 runGetTests(t, "GetInt()", getIntTests,
1565 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1566 value, err = GetInt([]byte(test.json), test.path...)
1567 return value, Number, err
1568 },
1569 func(test GetTest, value interface{}) (bool, interface{}) {
1570 expected := test.data.(int64)
1571 return expected == value.(int64), expected
1572 },
1573 )
1574}
1575
1576// Verifies: SYS-REQ-004 [example]
1577// STK-REQ-003:AC-2:acceptance

Callers

nothing calls this directly

Calls 2

runGetTestsFunction · 0.85
GetIntFunction · 0.85

Tested by

no test coverage detected