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) }