]> git.giacomolli.uk - onechat/blobdiff - daemon_test.go
Call the Telegram Bot API
[onechat] / daemon_test.go
index fe409293d85f50638eeb7cc017942e0e19488e01..00680e6fec697e028bdeeadf25688f698257b3fc 100644 (file)
@@ -154,10 +154,15 @@ func TestEventText(t *testing.T) {
                        text:  "Done.",
                },
                {
                        text:  "Done.",
                },
                {
-                       name:  "user message not shown",
-                       event: Event{Kind: "user", Text: "typed"},
+                       name:  "own user message not shown",
+                       event: Event{Kind: "user", Text: "typed", Source: terminalSource},
                        text:  "",
                },
                        text:  "",
                },
+               {
+                       name:  "user message of another source marked",
+                       event: Event{Kind: "user", Text: "from the phone", Source: "telegram"},
+                       text:  "[telegram] from the phone",
+               },
                {
                        name:  "long result cut",
                        event: Event{Kind: "echo", Text: strings.Repeat("line\n", 12)},
                {
                        name:  "long result cut",
                        event: Event{Kind: "echo", Text: strings.Repeat("line\n", 12)},