fix tests

The test cases in question never failed for what appears to be
an amazing fluke. I broke these test in Jan of 2012 (commit 2afda360)
and they don't seem to have failed since then, due to luck with
the random number generator
This commit is contained in:
Robby Findler 2013-05-07 07:11:32 -05:00
parent 2648542a6c
commit 1e0625bd39

View File

@ -706,12 +706,12 @@
[(_ e) (datum->syntax stx (syntax->datum #'e) #f)]))])
(test (output (λ () (noloc (redex-check lang d #t))))
"redex-check: no counterexamples in 1000 attempts\n"))
(test (output (λ () (redex-check lang (d e) (and (eq? (term d) 5) (eq? (term e) 4)) #:attempts 2)))
(test (output (λ () (redex-check lang (d e) (and (= (term d) 5) (or (= (term e) 4) (= (term e) 17))) #:attempts 200)))
#rx"no counterexamples")
(test (output (λ () (redex-check lang (d ...) (zero? (modulo (foldl + 0 (term (d ...))) 5)) #:attempts 2)))
#rx"no counterexamples")
(test (output (λ () (redex-check lang (d e) #f)))
#rx"counterexample found after 1 attempt:\n\\(5 4\\)\n")
#rx"counterexample found after 1 attempt:\n\\(5 (4|17)\\)\n")
(let* ([p (open-output-string)]
[m (parameterize ([current-output-port p])
(with-handlers ([exn:fail? exn-message])
@ -793,8 +793,9 @@
(λ ()
(redex-check lang (number_1 number_2)
(and (= (term number_1) 5)
(= (term number_2) 4))
#:attempts 1
(or (= (term number_2) 4)
(= (term number_2) 17)))
#:attempts 10
#:source mf)))
#rx"no counterexamples"))