From eb414bf2a15193cb6533fa8253bf1bd5308129b7 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 6 Dec 2019 14:33:04 -0800 Subject: [PATCH] Add a little test --- command/pr_test.go | 7 +++++++ 1 file changed, 7 insertions(+) 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") +}