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

Function TestDelete

parser_test.go:1358–1369  ·  view source on GitHub ↗

Verifies: SYS-REQ-010 [example] STK-REQ-005:AC-2:acceptance MCDC SYS-REQ-010: delete_path_is_provided=F, delete_returns_empty_document_without_path=T => TRUE Verifies: SYS-REQ-033 [example] MCDC SYS-REQ-033: delete_path_is_provided=T, delete_target_exists=T, delete_returns_document_without_target=T

(t *testing.T)

Source from the content-addressed store, hash-verified

1356// Verifies: SYS-REQ-034 [example]
1357// MCDC SYS-REQ-034: delete_path_is_provided=T, delete_target_exists=F, delete_input_is_unusable_for_requested_path=F, delete_preserves_input_when_target_missing=T => TRUE
1358func TestDelete(t *testing.T) {
1359 runDeleteTests(t, "Delete()", deleteTests,
1360 func(test DeleteTest) (interface{}, []byte) {
1361 ba := []byte(test.json)
1362 return Delete(ba, test.path...), ba
1363 },
1364 func(test DeleteTest, value interface{}) (bool, interface{}) {
1365 expected := []byte(test.data.(string))
1366 return bytes.Equal(expected, value.([]byte)), expected
1367 },
1368 )
1369}
1370
1371// Verifies: SYS-REQ-001 [example]
1372// STK-REQ-001:AC-1:acceptance

Callers

nothing calls this directly

Calls 2

runDeleteTestsFunction · 0.85
DeleteFunction · 0.85

Tested by

no test coverage detected