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

Function TestParseBoolean

parser_test.go:2223–2233  ·  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

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