diff --git a/command/pr_test.go b/command/pr_test.go index 9c6ef97d9..f886f86c5 100644 --- a/command/pr_test.go +++ b/command/pr_test.go @@ -362,3 +362,10 @@ func TestPRView_branchWithOwnerArg(t *testing.T) { url := seenCmd.Args[len(seenCmd.Args)-1] eq(t, url, "https://github.com/hubot/REPO/pull/23") } + +func TestReplaceExcessiveWhitespace(t *testing.T) { + eq(t, replaceExcessiveWhitespace("hello\ngoodbye"), "hello goodbye") + eq(t, replaceExcessiveWhitespace(" hello goodbye "), "hello goodbye") + eq(t, replaceExcessiveWhitespace("hello goodbye"), "hello goodbye") + eq(t, replaceExcessiveWhitespace(" hello \n goodbye "), "hello goodbye") +}