From dbd3e04b827a5ff5241ccdba4540b25c53c4f761 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 20 Mar 2014 11:56:55 -0500 Subject: [PATCH] add tests to ensure counter examples in buggy versions of stlc-sub aren't counter examples in stlc-sub-base.rkt --- .../redex/examples/benchmark/stlc-sub/tests.rkt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/redex-pkgs/redex-examples/redex/examples/benchmark/stlc-sub/tests.rkt b/pkgs/redex-pkgs/redex-examples/redex/examples/benchmark/stlc-sub/tests.rkt index e11cc39582..2236e8d2b0 100644 --- a/pkgs/redex-pkgs/redex-examples/redex/examples/benchmark/stlc-sub/tests.rkt +++ b/pkgs/redex-pkgs/redex-examples/redex/examples/benchmark/stlc-sub/tests.rkt @@ -1,7 +1,8 @@ #lang racket/base (require "stlc-sub-base.rkt" "../stlc/tests-lib.rkt" - redex/reduction-semantics) + redex/reduction-semantics + racket/runtime-path) (stlc-tests uses-bound-var? typeof red @@ -19,4 +20,13 @@ (term (λ (y int) y))) (test-equal (check (term ((λ (x int) x) 1))) #t) (test-equal (check (term (hd ((cons 1) 2)))) #t) + +(define-runtime-path here ".") +(for ([f (in-list (directory-list here))]) + (when (regexp-match #rx"^stlc-sub-[0-9]+[.]rkt$" (path->string f)) + (define small-counter-example (dynamic-require (build-path here f) 'small-counter-example)) + (unless (check small-counter-example) + (error 'tests.rkt "the counterexample in ~a also fails check for stlc-sub-base.rkt" + f)))) + (test-results)