From 2afda360d0f63a32c0c1726297e13e1c7c6428b5 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 8 Jan 2012 21:37:47 -0600 Subject: [PATCH] redex: adjust the test suites to clean up a few things; also make the hole and the-not-hole equal? to each other (like they used to be) --- collects/redex/private/matcher.rkt | 6 ++++-- collects/redex/tests/rg-test.rkt | 6 +++--- collects/redex/tests/tl-test.rkt | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/collects/redex/private/matcher.rkt b/collects/redex/private/matcher.rkt index 0023279327..5a0de5ccd7 100644 --- a/collects/redex/private/matcher.rkt +++ b/collects/redex/private/matcher.rkt @@ -973,7 +973,7 @@ See match-a-pattern.rkt for more details [(2) (memoize/2 f w/hole)] [else (error 'memoize "unknown arity for ~s" f)])) -(define cache-size 63) +(define cache-size 255 #;63) (define (set-cache-size! cs) (set! cache-size cs)) ;; original version, but without closure allocation in hash lookup @@ -1821,7 +1821,9 @@ See match-a-pattern.rkt for more details (define (context? x) #t) (define-values (the-hole the-not-hole hole?) (let () - (define-struct hole (id) #:inspector #f) + (define-struct hole (id) + #:property prop:equal+hash (list (λ (x y recur) #t) (λ (v recur) 255) (λ (v recur) 65535)) + #:inspector #f) (define the-hole (make-hole 'the-hole)) (define the-not-hole (make-hole 'the-not-hole)) (values the-hole the-not-hole hole?))) diff --git a/collects/redex/tests/rg-test.rkt b/collects/redex/tests/rg-test.rkt index 08f03dc908..58dc19182d 100644 --- a/collects/redex/tests/rg-test.rkt +++ b/collects/redex/tests/rg-test.rkt @@ -92,7 +92,7 @@ (variable-except y) (name x 1) (name y 1)) - (y y)) + (y 12)) (test (hash-ref (base-cases-non-cross (find-base-cases L)) 'x) '(0 0 0 0))) @@ -666,7 +666,7 @@ (let () (define-language lang (d 5) - (e e 4) + (e 17 4) (n number)) (test (let ([checked 0]) @@ -884,7 +884,7 @@ (define-language L (e (+ e ...) number) (E (+ number ... E* e ...)) - (E* hole E*) + (E* hole) (n 4)) (let ([R (reduction-relation diff --git a/collects/redex/tests/tl-test.rkt b/collects/redex/tests/tl-test.rkt index f4d8f04caf..36f8086ca5 100644 --- a/collects/redex/tests/tl-test.rkt +++ b/collects/redex/tests/tl-test.rkt @@ -1,7 +1,7 @@ #lang racket (require "../reduction-semantics.rkt" "test-util.rkt" - (only-in "../private/matcher.rkt" make-bindings make-bind the-not-hole) + (only-in "../private/matcher.rkt" make-bindings make-bind) racket/match racket/trace "../private/struct.rkt") @@ -313,7 +313,7 @@ L (in-hole (cross e) e) (term (cont (1 hole)))) - (((e (cont (1 ,the-not-hole)))) + (((e (cont (1 hole)))) ((e 1))))) (let () (define-language L @@ -338,10 +338,10 @@ (in-hole (cross e) e) (term ((cont ((λ (x) x) hole)) (λ (y) y)))) (((e x)) - ((e ((cont ((λ (x) x) ,the-not-hole)) (λ (y) y)))) + ((e ((cont ((λ (x) x) hole)) (λ (y) y)))) ((e y)) ((e (λ (y) y))) - ((e (cont ((λ (x) x) ,the-not-hole))))))) + ((e (cont ((λ (x) x) hole))))))) ;; test caching (let ()