MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / TestFormatDebugTermDecode

Function TestFormatDebugTermDecode

cmd/wsh/cmd/wshcmd-debugterm_test.go:18–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16}
17
18func 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
37func TestParseDebugTermStdinData(t *testing.T) {
38 data, err := parseDebugTermStdinData([]byte(`["abc","\u001b[31mred","\u001b[0m"]`))

Callers

nothing calls this directly

Calls 1

formatDebugTermDecodeFunction · 0.85

Tested by

no test coverage detected