Skip to content

Commit

Permalink
good solid test for colour continuation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmck-code committed Dec 10, 2024
1 parent 15f0bdf commit a971b5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/pokesay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,22 @@ func TestFlipHorizontalWithoutColour(test *testing.T) {
Assert(expected, results, test)
}

func TestFlipHorizontalWithColourContinuation(test *testing.T) {
msg := "\x1b[38;5;160m▄ \x1b[38;5;46m▄\n" +
"▄ \x1b[38;5;190m▄\n"

result := pokesay.ReverseANSIString(msg)

expected := "\x1b[38;5;46m▄ \x1b[38;5;160m▄\n" +
"\x1b[38;5;190m▄ \x1b[38;5;46m▄\n"

fmt.Printf("msg:\n%s\x1b[0m\n", msg)
fmt.Printf("expected:\n%s\x1b[0m\n", expected)
fmt.Printf("result:\n%s\x1b[0m\n", result)

Assert(expected, result, test)
}

func TestFlipHorizontal(test *testing.T) {
msg := []string{
" \x1b[49m \x1b[38;5;16m▄\x1b[48;5;16m\x1b[38;5;232m▄ \x1b[49m \x1b[38;5;16m▄▄",
Expand Down

0 comments on commit a971b5e

Please sign in to comment.