-
-
Notifications
You must be signed in to change notification settings - Fork 419
/
Copy pathmessage_test.go
40 lines (32 loc) · 943 Bytes
/
message_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package message
import "testing"
func TestMessage(t *testing.T) {
var expected, actual string
expected = " * foo"
actual = NewAnnounceMsg("foo").String()
if actual != expected {
t.Errorf("Got: `%s`; Expected: `%s`", actual, expected)
}
u := NewUser("foo")
expected = "foo: hello"
actual = NewPublicMsg("hello", u).String()
if actual != expected {
t.Errorf("Got: `%s`; Expected: `%s`", actual, expected)
}
expected = "** foo sighs."
actual = NewEmoteMsg("sighs.", u).String()
if actual != expected {
t.Errorf("Got: `%s`; Expected: `%s`", actual, expected)
}
expected = "-> hello"
actual = NewSystemMsg("hello", u).String()
if actual != expected {
t.Errorf("Got: `%s`; Expected: `%s`", actual, expected)
}
expected = "[PM from foo] hello"
actual = NewPrivateMsg("hello", u, u).String()
if actual != expected {
t.Errorf("Got: `%s`; Expected: `%s`", actual, expected)
}
}
// TODO: Add theme rendering tests