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

Function TestCodeMCDC_CreateInsertComponentEmptyKey

mcdc_code_supplement_test.go:129–137  ·  view source on GitHub ↗

----------------------------------------------------------------------------- createInsertComponent / calcAllocateSpace — direct call to drive the `len(keys[i]) > 0` short-circuit gap with an empty intermediate key. ----------------------------------------------------------------------------- Verifi

(t *testing.T)

Source from the content-addressed store, hash-verified

127
128// Verifies: SYS-REQ-009 [mcdc]
129func TestCodeMCDC_CreateInsertComponentEmptyKey(t *testing.T) {
130 // Direct invocation with an empty-string intermediate key drives the
131 // `len(keys[i]) > 0` operand to F.
132 keys := []string{"a", "", "b"}
133 got := createInsertComponent(keys, []byte(`42`), false, false)
134 if len(got) == 0 {
135 t.Fatal("expected non-empty result from createInsertComponent")
136 }
137}
138
139// Verifies: SYS-REQ-009 [mcdc]
140func TestCodeMCDC_CalcAllocateSpaceEmptyKey(t *testing.T) {

Callers

nothing calls this directly

Calls 1

createInsertComponentFunction · 0.85

Tested by

no test coverage detected