1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-10 14:56:08 +00:00

Added misc tests to increase test coverage

This commit is contained in:
Ico Doornekamp
2023-06-03 18:59:19 +02:00
parent 15177ac2e9
commit c0f5f97ddb
8 changed files with 143 additions and 2 deletions

View File

@@ -14,9 +14,12 @@
(++ num-tests-run)
(when x (++ num-tests-passed))
(def str (string e))
(def frame (last (debug/stack (fiber/current))))
(def line-info (string/format "%s:%d"
(frame :source) (frame :source-line)))
(if x
(when is-verbose (eprintf "\e[32m✔\e[0m %s: %v" (describe e) x))
(eprintf "\e[31m✘\e[0m %s: %v" (describe e) x))
(when is-verbose (eprintf "\e[32m✔\e[0m %s: %s: %v" line-info (describe e) x))
(eprintf "\e[31m✘\e[0m %s: %s: %v" line-info (describe e) x))
x)
(defmacro assert-error