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

Function TestGetInt

parser_test.go:1564–1575  ·  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

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