From c4c2ef8979be243343d6de89bf94d3c8cfb24f0b Mon Sep 17 00:00:00 2001 From: Alessio Date: Mon, 2 Aug 2021 14:55:59 -0700 Subject: [PATCH] Fix a test --- cmd/tests.sh | 2 +- cmd/twitter/helpers.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/tests.sh b/cmd/tests.sh index 43863b1..14eb071 100755 --- a/cmd/tests.sh +++ b/cmd/tests.sh @@ -17,6 +17,6 @@ test $(sqlite3 data/twitter.db "select count(*) from users") = "1" # Fetch a tweet with images go run ./twitter fetch_tweet_only data https://twitter.com/Denlesks/status/1261483383483293700 test $(sqlite3 data/twitter.db "select count(*) from tweets") = "1" -test $(sqlite3 data/twitter.db "select text from tweets") = "These are public health officials who are making decisions about your lifestyle because they know more about health, fitness and well-being than you do" +test "$(sqlite3 data/twitter.db "select text from tweets")" = "These are public health officials who are making decisions about your lifestyle because they know more about health, fitness and well-being than you do" go run ./twitter fetch_tweet_only data https://twitter.com/Denlesks/status/1261483383483293700 test $(sqlite3 data/twitter.db "select count(*) from tweets") = "1" diff --git a/cmd/twitter/helpers.go b/cmd/twitter/helpers.go index ce91eb6..e2c339f 100644 --- a/cmd/twitter/helpers.go +++ b/cmd/twitter/helpers.go @@ -32,10 +32,10 @@ TARGET is optional depending on */ func die(text string, display_help bool, exit_code int) { if text != "" { - fmt.Print(terminal_utils.COLOR_RED + text + terminal_utils.COLOR_RESET + "\n") + fmt.Fprint(os.Stderr, terminal_utils.COLOR_RED + text + terminal_utils.COLOR_RESET + "\n") } if display_help { - fmt.Print(help_message) + fmt.Fprint(os.Stderr, help_message) } os.Exit(exit_code) }