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

Function TestParseString

parser_test.go:2349–2359  ·  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

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