Skip to content

Commit

Permalink
Add some tests for assertf
Browse files Browse the repository at this point in the history
  • Loading branch information
sogaiu committed Oct 30, 2024
1 parent abad9d7 commit 10994cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/suite-boot.janet
Original file line number Diff line number Diff line change
Expand Up @@ -986,4 +986,14 @@
(assert (deep= (get (dyn 'a) :source-form) source))
(setdyn *debug* nil)

# issue #1516
(assert (assertf true) "assertf 1 argument")
(assert (assertf true "fun message") "assertf 2 arguments")
(assert (assertf true "%s message" "mystery") "assertf 3 arguments")
(assert (assertf (not nil) "%s message" "ordinary") "assertf not nil")
(assert-error "assertf error 1" (assertf false))
(assert-error "assertf error 2" (assertf false "fun message"))
(assert-error "assertf error 3" (assertf false "%s message" "mystery"))
(assert-error "assertf error 4" (assertf nil "%s %s" "alice" "bob"))

(end-suite)

0 comments on commit 10994cb

Please sign in to comment.