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

Function TestParseString

parser_test.go:2348–2358  ·  view source on GitHub ↗

Verifies: SYS-REQ-038 [example] MCDC SYS-REQ-038: raw_string_literal_is_well_formed=F, returns_parsestring_error=T => TRUE Verifies: SYS-REQ-014 [example] STK-REQ-007:AC-3:acceptance MCDC SYS-REQ-014: raw_string_literal_is_well_formed=F, returns_parsestring_value=F => TRUE MCDC SYS-REQ-014: raw_stri

(t *testing.T)

Source from the content-addressed store, hash-verified

2346// MCDC SYS-REQ-014: raw_string_literal_is_well_formed=T, returns_parsestring_value=F => FALSE
2347// MCDC SYS-REQ-014: raw_string_literal_is_well_formed=T, returns_parsestring_value=T => TRUE
2348func TestParseString(t *testing.T) {
2349 runParseTests(t, "ParseString()", parseStringTest,
2350 func(test ParseTest) (value interface{}, err error) {
2351 return ParseString([]byte(test.in))
2352 },
2353 func(test ParseTest, obtained interface{}) (bool, interface{}) {
2354 expected := test.out.(string)
2355 return obtained.(string) == expected, expected
2356 },
2357 )
2358}
2359
2360// Verifies: SYS-REQ-040 [example]
2361// MCDC SYS-REQ-040: raw_int_token_is_well_formed=F, raw_int_token_overflows_int64=F, returns_parseint_malformed_error=T => TRUE

Callers

nothing calls this directly

Calls 2

runParseTestsFunction · 0.85
ParseStringFunction · 0.85

Tested by

no test coverage detected