Skip to content

Commit

Permalink
feat(ansi): add last csi seq test
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed May 24, 2024
1 parent 68b3840 commit ff83003
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ansi/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,33 @@ func TestControlSequence(t *testing.T) {
EscSequence('P'),
},
},
{
name: "csi plus text",
input: "Hello, \x1b[31mWorld!\x1b[0m",
expected: []Sequence{
Rune('H'),
Rune('e'),
Rune('l'),
Rune('l'),
Rune('o'),
Rune(','),
Rune(' '),
CsiSequence{
Params: []int{31},
Cmd: 'm',
},
Rune('W'),
Rune('o'),
Rune('r'),
Rune('l'),
Rune('d'),
Rune('!'),
CsiSequence{
Params: []int{0},
Cmd: 'm',
},
},
},
}
for _, c := range cases {
t.Run(c.name, func(t *testing.T) {
Expand Down

0 comments on commit ff83003

Please sign in to comment.