Verifies: SYS-REQ-010 [fuzz] MCDC SYS-REQ-010: delete_path_is_provided=T, delete_returns_empty_document_without_path=F => TRUE
(t *testing.T)
| 49 | // Verifies: SYS-REQ-010 [fuzz] |
| 50 | // MCDC SYS-REQ-010: delete_path_is_provided=T, delete_returns_empty_document_without_path=F => TRUE |
| 51 | func TestFuzzDeleteHarnessCoverage(t *testing.T) { |
| 52 | // FuzzDelete calls Delete(data, "test") and always returns 1. |
| 53 | // Exercise it with data that contains and does not contain the key. |
| 54 | |
| 55 | // Case 1: data contains the "test" key -- Delete removes it |
| 56 | data := []byte(`{"test":"value","other":"keep"}`) |
| 57 | if got := FuzzDelete(data); got != 1 { |
| 58 | t.Fatalf("FuzzDelete with existing key = %d, want 1", got) |
| 59 | } |
| 60 | |
| 61 | // Case 2: data does not contain the "test" key -- Delete returns data unchanged |
| 62 | if got := FuzzDelete([]byte(`{"other":"value"}`)); got != 1 { |
| 63 | t.Fatalf("FuzzDelete with missing key = %d, want 1", got) |
| 64 | } |
| 65 | |
| 66 | // Case 3: empty JSON object |
| 67 | if got := FuzzDelete([]byte(`{}`)); got != 1 { |
| 68 | t.Fatalf("FuzzDelete with empty object = %d, want 1", got) |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | // Verifies: SYS-REQ-007 [fuzz] |
| 73 | // MCDC SYS-REQ-007: N/A |
nothing calls this directly
no test coverage detected
searching dependent graphs…