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

Function TestGetFloat

parser_test.go:1583–1594  ·  view source on GitHub ↗

Verifies: SYS-REQ-004 [example] STK-REQ-003:AC-2:acceptance MCDC SYS-REQ-004: addressed_value_is_number=F, raw_number_token_is_float_parseable=T, returns_getfloat_value=F => TRUE MCDC SYS-REQ-004: addressed_value_is_number=T, raw_number_token_is_float_parseable=F, returns_getfloat_value=F => TRUE MC

(t *testing.T)

Source from the content-addressed store, hash-verified

1581// MCDC SYS-REQ-004: addressed_value_is_number=T, raw_number_token_is_float_parseable=T, returns_getfloat_value=F => FALSE
1582// MCDC SYS-REQ-004: addressed_value_is_number=T, raw_number_token_is_float_parseable=T, returns_getfloat_value=T => TRUE
1583func TestGetFloat(t *testing.T) {
1584 runGetTests(t, "GetFloat()", getFloatTests,
1585 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1586 value, err = GetFloat([]byte(test.json), test.path...)
1587 return value, Number, err
1588 },
1589 func(test GetTest, value interface{}) (bool, interface{}) {
1590 expected := test.data.(float64)
1591 return expected == value.(float64), expected
1592 },
1593 )
1594}
1595
1596// Verifies: SYS-REQ-005 [example]
1597// STK-REQ-003:AC-3:acceptance

Callers

nothing calls this directly

Calls 2

runGetTestsFunction · 0.85
GetFloatFunction · 0.85

Tested by

no test coverage detected