Skip to content

Commit

Permalink
unit test: fxwrapquotient
Browse files Browse the repository at this point in the history
  • Loading branch information
James Baker committed Feb 5, 2016
1 parent 357836e commit a7219ab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/unit-tests/01-fixnum/fxwrapquotient.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
(include "#.scm")

(check-eqv? (fxwrapquotient 1 1) 1)
(check-eqv? (fxwrapquotient -3 2) -1)
(check-eqv? (fxwrapquotient -6 -4) 1)
(check-eqv? (fxwrapquotient -8 -4) 2)

(check-tail-exn divide-by-zero-exception? (lambda () (fxwrapquotient 1 0)))

(check-tail-exn wrong-number-of-arguments-exception? (lambda () (fxwrapquotient)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (fxwrapquotient 1)))
(check-tail-exn wrong-number-of-arguments-exception? (lambda () (fxwrapquotient 1 1 1)))

(check-tail-exn type-exception? (lambda () (fxwrapquotient 1 0.5)))
(check-tail-exn type-exception? (lambda () (fxwrapquotient 1 1/2)))

0 comments on commit a7219ab

Please sign in to comment.