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

Function TestParseBoolean

parser_test.go:2224–2234  ·  view source on GitHub ↗

Verifies: SYS-REQ-036 [example] MCDC SYS-REQ-036: raw_boolean_literal_is_valid=F, returns_parseboolean_error=T => TRUE Verifies: SYS-REQ-012 [example] STK-REQ-007:AC-1:acceptance MCDC SYS-REQ-012: raw_boolean_literal_is_valid=F, returns_parseboolean_value=F => TRUE MCDC SYS-REQ-012: raw_boolean_lite

(t *testing.T)

Source from the content-addressed store, hash-verified

2222// MCDC SYS-REQ-012: raw_boolean_literal_is_valid=T, returns_parseboolean_value=F => FALSE
2223// MCDC SYS-REQ-012: raw_boolean_literal_is_valid=T, returns_parseboolean_value=T => TRUE
2224func TestParseBoolean(t *testing.T) {
2225 runParseTests(t, "ParseBoolean()", parseBoolTests,
2226 func(test ParseTest) (value interface{}, err error) {
2227 return ParseBoolean([]byte(test.in))
2228 },
2229 func(test ParseTest, obtained interface{}) (bool, interface{}) {
2230 expected := test.out.(bool)
2231 return obtained.(bool) == expected, expected
2232 },
2233 )
2234}
2235
2236// Verifies: SYS-REQ-037 [example]
2237// MCDC SYS-REQ-037: raw_float_token_is_well_formed=F, returns_parsefloat_error=T => TRUE

Callers

nothing calls this directly

Calls 2

runParseTestsFunction · 0.85
ParseBooleanFunction · 0.85

Tested by

no test coverage detected