From 1e0625bd397607bf9b733c838bea0d53fb7165e9 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 7 May 2013 07:11:32 -0500 Subject: [PATCH] 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 --- collects/redex/tests/rg-test.rkt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/collects/redex/tests/rg-test.rkt b/collects/redex/tests/rg-test.rkt index e58bd70e23..2a57791e9a 100644 --- a/collects/redex/tests/rg-test.rkt +++ b/collects/redex/tests/rg-test.rkt @@ -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"))