Verifies: SYS-REQ-014 [boundary] Code MC/DC gap: escape.go:149 Unescape for len(in) > 0 Drive the loop body. A string with an escape sequence enters the loop.
(t *testing.T)
| 692 | // Code MC/DC gap: escape.go:149 Unescape for len(in) > 0 |
| 693 | // Drive the loop body. A string with an escape sequence enters the loop. |
| 694 | func TestCodeMCDC_UnescapeLoopEntry(t *testing.T) { |
| 695 | // A string with a backslash-n escape forces the Unescape loop |
| 696 | result, err := Unescape([]byte(`hello\nworld`), make([]byte, 32)) |
| 697 | if err != nil { |
| 698 | t.Fatalf("Unescape error: %v", err) |
| 699 | } |
| 700 | if string(result) != "hello\nworld" { |
| 701 | t.Fatalf("Unescape = %q, want %q", string(result), "hello\nworld") |
| 702 | } |
| 703 | |
| 704 | // Also test with multiple escapes to exercise loop re-entry |
| 705 | result2, err2 := Unescape([]byte(`a\tb\nc`), make([]byte, 32)) |
| 706 | if err2 != nil { |
| 707 | t.Fatalf("Unescape multiple escapes error: %v", err2) |
| 708 | } |
| 709 | if string(result2) != "a\tb\nc" { |
| 710 | t.Fatalf("Unescape multiple = %q, want %q", string(result2), "a\tb\nc") |
| 711 | } |
| 712 | } |
| 713 | |
| 714 | // Verifies: SYS-REQ-007 [boundary] |
| 715 | // Code MC/DC gap: parser.go:1138 ObjectEach offset < len(data) |
nothing calls this directly
no test coverage detected
searching dependent graphs…