Skip to content

Commit

Permalink
Merge pull request #833 from sryoya/add_test_for_escapte_message_func
Browse files Browse the repository at this point in the history
Add test for EscapeMessage function in slack
  • Loading branch information
kanata2 authored Oct 27, 2020
2 parents 2f3e31d + db56c12 commit 686c209
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions slackutilsx/slackutilsx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ func TestDetectChannelType(t *testing.T) {
test("", CTypeUnknown)
test("X11111111", CTypeUnknown)
}

func TestEscapeMessage(t *testing.T) {
test := func(message string, expected string) {
if computed := EscapeMessage(message); computed != expected {
t.Errorf("expected message %s to be converted to %s, got: %s", message, expected, computed)
}
}
test("A & B", "A & B")
test("A < B", "A &lt; B")
test("A > B", "A &gt; B")
}

0 comments on commit 686c209

Please sign in to comment.