mirror of
https://github.com/janet-lang/janet
synced 2025-02-02 02:09:10 +00:00
Update issue 53 regression test.
Some tests did not call assert so did not show up on report.
This commit is contained in:
parent
1147482e62
commit
f4908ebc41
@ -26,6 +26,11 @@
|
||||
(def errsym (keyword (gensym)))
|
||||
~(assert (= ,errsym (try (do ,;forms) ([_] ,errsym))) ,msg))
|
||||
|
||||
(defmacro assert-no-error
|
||||
[msg & forms]
|
||||
(def errsym (keyword (gensym)))
|
||||
~(assert (not= ,errsym (try (do ,;forms) ([_] ,errsym))) ,msg))
|
||||
|
||||
(defn start-suite [x]
|
||||
(set suite-num x)
|
||||
(print "\nRunning test suite " x " tests...\n "))
|
||||
|
@ -47,13 +47,19 @@
|
||||
|
||||
(defn check-image
|
||||
"Run a marshaling test using the make-image and load-image functions."
|
||||
[x]
|
||||
(def src (make-image x))
|
||||
(load-image src))
|
||||
[x msg]
|
||||
(assert-no-error msg (load-image (make-image x))))
|
||||
|
||||
(check-image (fn [] (fn [] 1)))
|
||||
(check-image (fiber/new (fn [] (fn [] 1))))
|
||||
(check-image (fiber/new (fn [] (fiber/new (fn [] 1)))))
|
||||
(check-image (fn [] (fn [] 1)) "marshal nested functions")
|
||||
(check-image (fiber/new (fn [] (fn [] 1))) "marshal nested functions in fiber")
|
||||
(check-image (fiber/new (fn [] (fiber/new (fn [] 1)))) "marshal nested fibers")
|
||||
|
||||
(def issue-53-x
|
||||
(fiber/new
|
||||
(fn []
|
||||
(var y (fiber/new (fn [] (print "1") (yield) (print "2")))))))
|
||||
|
||||
(check-image issue-53-x "issue 53 regression")
|
||||
|
||||
(end-suite)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user