MCPcopy
hub / github.com/buger/jsonparser / TestGetFloat

Function TestGetFloat

parser_test.go:1560–1571  ·  view source on GitHub ↗

Verifies: SYS-REQ-004 [example] 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 MCDC SYS-REQ-004: addressed_va

(t *testing.T)

Source from the content-addressed store, hash-verified

1558// MCDC SYS-REQ-004: addressed_value_is_number=T, raw_number_token_is_float_parseable=T, returns_getfloat_value=F => FALSE
1559// MCDC SYS-REQ-004: addressed_value_is_number=T, raw_number_token_is_float_parseable=T, returns_getfloat_value=T => TRUE
1560func TestGetFloat(t *testing.T) {
1561 runGetTests(t, "GetFloat()", getFloatTests,
1562 func(test GetTest) (value interface{}, dataType ValueType, err error) {
1563 value, err = GetFloat([]byte(test.json), test.path...)
1564 return value, Number, err
1565 },
1566 func(test GetTest, value interface{}) (bool, interface{}) {
1567 expected := test.data.(float64)
1568 return expected == value.(float64), expected
1569 },
1570 )
1571}
1572
1573// Verifies: SYS-REQ-005 [example]
1574// MCDC SYS-REQ-005: addressed_value_is_boolean=F, raw_boolean_token_is_well_formed=T, returns_getboolean_value=F => TRUE

Callers

nothing calls this directly

Calls 2

runGetTestsFunction · 0.85
GetFloatFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…