From ddba0010b035e1f232422f8624e8abf942510417 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Wed, 2 Jan 2019 23:06:23 -0500 Subject: [PATCH] Make test output less verbose. --- test/helper.janet | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/test/helper.janet b/test/helper.janet index 2f02847e..f6b95b16 100644 --- a/test/helper.janet +++ b/test/helper.janet @@ -3,20 +3,29 @@ (var num-tests-passed 0) (var num-tests-run 0) (var suite-num 0) +(var numchecks 0) (defn assert [x e] (++ num-tests-run) (when x (++ num-tests-passed)) - (print (if x - " \e[32m✔\e[0m " - " \e[31m✘\e[0m ") e) + (if x + (do + (when (= numchecks 25) + (set numchecks 0) + (print)) + (++ numchecks) + (file/write stdout "\e[32m✔\e[0m")) + (do + (file/write stdout "\n\e[31m✘\e[0m ") + (set numchecks 0) + (print e))) x) (defn start-suite [x] (set suite-num x) - (print "\nRunning test suite " x " tests...\n")) + (print "\nRunning test suite " x " tests...\n ")) (defn end-suite [] - (print "\nTest suite " suite-num " finished.") + (print "\n\nTest suite " suite-num " finished.") (print num-tests-passed " of " num-tests-run " tests passed.\n") (if (not= num-tests-passed num-tests-run) (os/exit 1)))