Verifies: SYS-REQ-035 [boundary] Code MC/DC gap: parser.go:778 Delete space-comma handling Drive the case where data[endOffset+tokEnd] == ' ' and len(data) > endOffset+tokEnd+1 but data[endOffset+tokEnd+1] != ',' (the third condition is FALSE).
(t *testing.T)
| 734 | // len(data) > endOffset+tokEnd+1 but data[endOffset+tokEnd+1] != ',' |
| 735 | // (the third condition is FALSE). |
| 736 | func TestCodeMCDC_DeleteSpaceBeforeComma(t *testing.T) { |
| 737 | // Delete "a" from {"a":1 ,"b":2} where there's a space before the comma. |
| 738 | got := string(Delete([]byte(`{"a":1 ,"b":2}`), "a")) |
| 739 | if got != `{"b":2}` { |
| 740 | t.Fatalf("Delete space-comma = %q, want %q", got, `{"b":2}`) |
| 741 | } |
| 742 | |
| 743 | // Delete "a" from {"a":1 } where space is followed by '}' not ',' |
| 744 | // This makes data[endOffset+tokEnd+1] == '}' != ',' |
| 745 | got2 := string(Delete([]byte(`{"a":1 }`), "a")) |
| 746 | // With only one key and space before closing brace, the space-comma |
| 747 | // branch is entered but the comma check is FALSE, so it falls through. |
| 748 | _ = got2 // Accept whatever the parser produces as long as no panic |
| 749 | } |
| 750 | |
| 751 | // Verifies: SYS-REQ-008 [boundary] |
| 752 | // Code MC/DC gap: parser.go:497 EachKey i < ln |
nothing calls this directly
no test coverage detected
searching dependent graphs…