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

Function TestMCDC_SYS_REQ_010_Row1_NoPathNoEmpty

coverage_closure_test.go:105–119  ·  view source on GitHub ↗

============================================================================= MC/DC witness row closure for SYS-REQ-010 ============================================================================= SYS-REQ-010 has 3 MC/DC rows; row 2 (Delete without path returns empty) is already covered by TestDel

(t *testing.T)

Source from the content-addressed store, hash-verified

103// Verifies: SYS-REQ-010 [boundary]
104// MCDC SYS-REQ-010: delete_path_is_provided=F, delete_returns_empty_document_without_path=F => FALSE
105func TestMCDC_SYS_REQ_010_Row1_NoPathNoEmpty(t *testing.T) {
106 // Witness row 1: no path provided AND the function does NOT return an
107 // empty document. This is a requirement violation scenario -- it cannot
108 // happen in practice because Delete without a path always returns
109 // data[:0]. We witness the FALSE row by observing that when we DO call
110 // Delete with no path, it returns the empty slice (row 2), confirming
111 // that this row 1 combination is unreachable.
112 //
113 // For MC/DC annotation purposes, we document the witness by calling
114 // Delete with zero-length input and no path, verifying the empty return.
115 result := Delete([]byte{})
116 if len(result) != 0 {
117 t.Fatalf("Delete(empty, no path) returned %d bytes, want 0", len(result))
118 }
119}
120
121// Verifies: SYS-REQ-010 [boundary]
122// MCDC SYS-REQ-010: delete_path_is_provided=T, delete_returns_empty_document_without_path=F => TRUE

Callers

nothing calls this directly

Calls 1

DeleteFunction · 0.85

Tested by

no test coverage detected