From d48bc1f1c1a200d2c8edad9e405341594c2de6b0 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 30 Oct 2009 16:11:34 +0000 Subject: [PATCH] undid my broken commit svn: r16478 --- collects/tests/mzscheme/shared-tests.ss | 51 +++++++++++-------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/collects/tests/mzscheme/shared-tests.ss b/collects/tests/mzscheme/shared-tests.ss index 1e3e7bfc8f..0b0f671ef2 100644 --- a/collects/tests/mzscheme/shared-tests.ss +++ b/collects/tests/mzscheme/shared-tests.ss @@ -1,7 +1,5 @@ -(load-relative "loadtest.ss") -(Section 'shared) -(require (prefix-in b: lang/htdp-advanced)) +;; This file has to work for both "shared.ss" and "advanced.ss" ;; this writes values to strings and compares the strings ;; to implements an equal? predicate that works for cyclic @@ -17,45 +15,42 @@ (define (stest expect expression) (test (gs expect) - (let ([shared-tester (lambda (x) (gs x))]) shared-tester) + (let ([shared-tester (lambda (x) (gs (eval x)))]) shared-tester) expression)) -(stest '(1 2) (shared ([x (list 1 2)]) x)) -(stest #(1 2) (shared ([x (vector 1 2)]) x)) -(stest (box 1) (shared ([x (box 1)]) x)) -(stest '(1) (shared ([x (cons 1 null)]) x)) -(stest (mcons 1 null) (shared ([x (mcons 1 null)]) x)) +(stest '(1 2) '(shared ([x (list 1 2)]) x)) +(stest #(1 2) '(shared ([x (vector 1 2)]) x)) +(stest (box 1) '(shared ([x (box 1)]) x)) +(stest '(1) '(shared ([x (cons 1 null)]) x)) +(stest (mcons 1 null) '(shared ([x (mcons 1 null)]) x)) -(stest (x "#1=(#1# 1)") (shared ([x (list x 1)]) x)) -(stest (x "#2=#(#2# 1)") (shared ([x (vector x 1)]) x)) -(stest (x "#2=#(#2# 1)") (shared ([x (vector-immutable x 1)]) x)) -(stest (x "#3=##") (shared ([x (box x)]) x)) -(stest (x "#3=##") (shared ([x (box-immutable x)]) x)) -(stest (x "#4=(#4#)") (shared ([x (cons x null)]) x)) -(stest (x "#5=(1 . #5#)") (shared ([x (cons 1 x)]) x)) +(stest (x "#1=(#1# 1)") '(shared ([x (list x 1)]) x)) +(stest (x "#2=#(#2# 1)") '(shared ([x (vector x 1)]) x)) +(stest (x "#2=#(#2# 1)") '(shared ([x (vector-immutable x 1)]) x)) +(stest (x "#3=##") '(shared ([x (box x)]) x)) +(stest (x "#3=##") '(shared ([x (box-immutable x)]) x)) +(stest (x "#4=(#4#)") '(shared ([x (cons x null)]) x)) +(stest (x "#5=(1 . #5#)") '(shared ([x (cons 1 x)]) x)) (stest (let ([x (mcons 1 #f)]) (begin (set-mcdr! x x) x)) - (shared ([x (mcons 1 x)]) x)) + '(shared ([x (mcons 1 x)]) x)) -(stest (x "#11=(#11#)") (shared ([x `(,x)]) x)) +(stest (x "#11=(#11#)") '(shared ([x `(,x)]) x)) -(stest 1 (shared ([x (list 1 x p)] - [p (lambda () x)]) - (car ((caddr x))))) +(stest 1 '(shared ([x (list 1 x p)] + [p (lambda () x)]) + (car ((caddr x))))) -(b:define-struct s (a b)) +(define-struct s (a b)) (shared ([x (make-s 17 x)]) (begin (test #t s? x) (test 17 s-a x) - (test 17 s-a (s-b x)) (test #t eq? x (s-b x)))) (define-struct shared-test-ds-no-fields ()) (stest (make-shared-test-ds-no-fields) - (shared ((-4- 11) - (-8- (make-shared-test-ds-no-fields))) - -8-)) - -(report-errs) \ No newline at end of file + '(shared ((-4- 11) + (-8- (make-shared-test-ds-no-fields))) + -8-))