(t *testing.T)
| 16 | } |
| 17 | |
| 18 | func TestFormatDebugTermDecode(t *testing.T) { |
| 19 | data := []byte("abc\x1b[31mred\x1b[0m\x07\x1b]0;title\x07\x00") |
| 20 | output := formatDebugTermDecode(data) |
| 21 | expected := []string{ |
| 22 | `TXT "abc"`, |
| 23 | `CSI m 31`, |
| 24 | `TXT "red"`, |
| 25 | `CSI m 0`, |
| 26 | `BEL`, |
| 27 | `OSC 0 "title"`, |
| 28 | `CTL 0x00`, |
| 29 | } |
| 30 | for _, line := range expected { |
| 31 | if !strings.Contains(output, line) { |
| 32 | t.Fatalf("missing decode line %q in output %q", line, output) |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func TestParseDebugTermStdinData(t *testing.T) { |
| 38 | data, err := parseDebugTermStdinData([]byte(`["abc","\u001b[31mred","\u001b[0m"]`)) |
nothing calls this directly
no test coverage detected