From 47a2d4a879f979cc54f4d5fbba573105db06f7f1 Mon Sep 17 00:00:00 2001 From: Leif Andersen Date: Sun, 16 Apr 2017 15:34:13 -0400 Subject: [PATCH] Fixed tests for `log` function. The test cases relied on arity and changing log to have an arity of both 1 and 2 activated new (incorrect) tests. I fixed the incorrect tests as they applied to the log function. --- pkgs/racket-test-core/tests/racket/number.rktl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/racket-test-core/tests/racket/number.rktl b/pkgs/racket-test-core/tests/racket/number.rktl index 0ac6727c20..f147ce7a1a 100644 --- a/pkgs/racket-test-core/tests/racket/number.rktl +++ b/pkgs/racket-test-core/tests/racket/number.rktl @@ -2209,7 +2209,9 @@ (map (lambda (f) (err/rt-test (f "a")) (arity-test f 1 1)) - (list log exp asin acos tan)) + (list exp asin acos tan)) +(arity-test log 1 2) +(err/rt-test (log "a")) (err/rt-test (atan "a" 1)) (err/rt-test (atan 2+i 1)) (err/rt-test (atan "a")) @@ -3178,7 +3180,8 @@ (define ((check-single-flonum #:real-only? [real-only? #f] #:integer-only? [integer-only? #f] - #:two-arg-real-only? [two-arg-real-only? real-only?]) + #:two-arg-real-only? [two-arg-real-only? real-only?] + #:arity-one-only? [arity-one-only? #f]) op) (define (single-flonum-ish? op . args) (define v (apply op args)) @@ -3191,7 +3194,7 @@ (unless real-only? (test #t single-flonum-ish? op 2.0f0+4.0f0i) (test #t single-flonum-ish? op 0+4.0f0i))) - (when (procedure-arity-includes? op 2) + (when (and (procedure-arity-includes? op 2) (not arity-one-only?)) (test #t single-flonum-ish? op 2.0f0 4.0f0) (test #f single-flonum-ish? op 2.0 4.0f0) (test #f single-flonum-ish? op 2.0f0 4.0) @@ -3219,13 +3222,15 @@ sqrt expt exp - log sin cos tan asin acos)) +(map (check-single-flonum #:arity-one-only? #t) + (list log)) + (map (check-single-flonum #:two-arg-real-only? #t) (list atan))