MCPcopy Index your code
hub / github.com/buger/jsonparser / TestSet

Function TestSet

set_spec_test.go:14–25  ·  view source on GitHub ↗

Verifies: SYS-REQ-009 [example] MCDC SYS-REQ-009: set_creates_missing_path=F, set_path_is_provided=F, set_returns_not_found_error=F, set_returns_updated_document=F, set_target_exists=F => TRUE MCDC SYS-REQ-009: set_creates_missing_path=F, set_path_is_provided=T, set_returns_not_found_error=F, set_re

(t *testing.T)

Source from the content-addressed store, hash-verified

12// MCDC SYS-REQ-009: set_creates_missing_path=F, set_path_is_provided=T, set_returns_not_found_error=F, set_returns_updated_document=T, set_target_exists=F => TRUE
13// MCDC SYS-REQ-009: set_creates_missing_path=F, set_path_is_provided=T, set_returns_not_found_error=T, set_returns_updated_document=F, set_target_exists=F => TRUE
14func TestSet(t *testing.T) {
15 runSetTests(t, "Set()", setTests,
16 func(test SetTest) (value interface{}, dataType ValueType, err error) {
17 value, err = Set([]byte(test.json), []byte(test.setData), test.path...)
18 return
19 },
20 func(test SetTest, value interface{}) (bool, interface{}) {
21 expected := []byte(test.data.(string))
22 return bytes.Equal(expected, value.([]byte)), expected
23 },
24 )
25}
26
27// Verifies: SYS-REQ-009 [boundary]
28// MCDC SYS-REQ-009: set_creates_missing_path=T, set_path_is_provided=T, set_returns_not_found_error=F, set_returns_updated_document=F, set_target_exists=F => TRUE

Callers

nothing calls this directly

Calls 2

runSetTestsFunction · 0.85
SetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…