11package message
22
3- import (
4- "fmt"
5- "testing"
6- )
3+ import "testing"
74
85func TestThemePalette (t * testing.T ) {
96 var expected , actual string
@@ -15,21 +12,21 @@ func TestThemePalette(t *testing.T) {
1512 }
1613
1714 actual = color .String ()
18- expected = "38;05;5 "
15+ expected = "38;05;6 "
1916 if actual != expected {
20- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
17+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
2118 }
2219
2320 actual = color .Format ("foo" )
24- expected = "\033 [38;05;5mfoo \033 [0m"
21+ expected = "\033 [38;05;6mfoo \033 [0m"
2522 if actual != expected {
26- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
23+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
2724 }
2825
2926 actual = palette .Get (palette .Len () + 1 ).String ()
30- expected = fmt . Sprintf ( "38;05;%d" , 2 )
27+ expected = "38;05;3"
3128 if actual != expected {
32- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
29+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
3330 }
3431
3532}
@@ -44,28 +41,28 @@ func TestTheme(t *testing.T) {
4441 }
4542
4643 actual = color .Format ("foo" )
47- expected = "\033 [38;05;8mfoo \033 [0m"
44+ expected = "\033 [38;05;245mfoo \033 [0m"
4845 if actual != expected {
49- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
46+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
5047 }
5148
5249 actual = colorTheme .ColorSys ("foo" )
5350 if actual != expected {
54- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
51+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
5552 }
5653
5754 u := NewUser (SimpleId ("foo" ))
5855 u .colorIdx = 4
5956 actual = colorTheme .ColorName (u )
60- expected = "\033 [38;05;4mfoo \033 [0m"
57+ expected = "\033 [38;05;5mfoo \033 [0m"
6158 if actual != expected {
62- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
59+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
6360 }
6461
6562 msg := NewPublicMsg ("hello" , u )
6663 actual = msg .Render (& colorTheme )
67- expected = "\033 [38;05;4mfoo \033 [0m: hello"
64+ expected = "\033 [38;05;5mfoo \033 [0m: hello"
6865 if actual != expected {
69- t .Errorf ("Got: `%s` ; Expected: `%s` " , actual , expected )
66+ t .Errorf ("Got: %q ; Expected: %q " , actual , expected )
7067 }
7168}
0 commit comments