============================================================================= Code-level MC/DC supplement tests. ============================================================================= These tests drive specific branch combinations reported as gaps by `proof mcdc report --view hotspots`. They
(t *testing.T)
| 22 | |
| 23 | // Verifies: SYS-REQ-001 [mcdc] |
| 24 | func TestCodeMCDC_TokenStartDirect(t *testing.T) { |
| 25 | // Each input ends with the targeted delimiter byte, so tokenStart's |
| 26 | // for-loop returns that index with the corresponding c != <delim> |
| 27 | // operand as the independent flipper. |
| 28 | cases := map[byte]int{ |
| 29 | '\n': tokenStart([]byte("abc\n")), // 10 |
| 30 | '\r': tokenStart([]byte("abc\r")), // 13 |
| 31 | '\t': tokenStart([]byte("abc\t")), // 9 |
| 32 | } |
| 33 | for delim, got := range cases { |
| 34 | if got != 3 { |
| 35 | t.Errorf("tokenStart with trailing %q returned %d, want 3", delim, got) |
| 36 | } |
| 37 | } |
| 38 | // Baseline row: no delimiter present, falls through to return 0. |
| 39 | if got := tokenStart([]byte("abc")); got != 0 { |
| 40 | t.Errorf("tokenStart(abc) = %d, want 0", got) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | // Verifies: SYS-REQ-001 [mcdc] |
| 45 | func TestCodeMCDC_TokenEndDirect(t *testing.T) { |
nothing calls this directly
no test coverage detected