From 119c2fef1f06db3290b8e8eff0e332e166858a1c Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 23 Jul 2016 07:51:19 +0200 Subject: [PATCH] test.mes: enable vector tests for mes. --- test.mes | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test.mes b/test.mes index a4d0567a..f4431651 100644 --- a/test.mes +++ b/test.mes @@ -32,6 +32,10 @@ ((car t) (display ": pass") (newline) (set! pass (+ pass 1))) (#t (display ": fail") (newline) (set! fail (+ fail 1))))))) +(define (guile?) (defined? 'gc)) +(if (guile?) + (module-define! (current-module) 'builtin? (lambda (. x) #t))) + (define (seq? a b) (or (eq? a b) (begin @@ -124,8 +128,9 @@ (pass-if "list->vector" (sequal? (list->vector '(a b c)) #(a b c))) (pass-if "vector" (sequal? #(vector 0 1 2) #(vector 0 1 2))) (pass-if "vector-ref" (seq? (vector-ref #(0 1) 1) 1)) -;;(pass-if "vector-set" (sequal? (let ((v #(0 1))) (vector-set! v 1 'q) v) #(0 q))) -;;(pass-if "vector-set" (sequal? (let ((v #(0 1))) (vector-set! v 1 'q) v) #())) +(when (not guile?) ;; hmm guile segfaults + (pass-if "vector-set" (equal? (let ((v #(0 1))) (vector-set! v 1 'q) v) #(0 q))) + (pass-if "vector-set 2" (not (equal? (let ((v #(0 1))) (vector-set! v 1 'q) v) #())))) (pass-if "equal?" (sequal? #(1) #(1))) (pass-if "equal?" (not (equal? #() #(1)))) (pass-if "memq" (sequal? (memq 'a '(a b c)) '(a b c))) @@ -156,10 +161,6 @@ ;; (display ((lambda (x) x) (values 1 2 3))) ;; (newline))) -(define (guile?) (defined? 'gc)) -(if (guile?) - (module-define! (current-module) 'builtin? (lambda (. x) #t))) - (pass-if "builtin?" (builtin? eval)) ;;(pass-if "builtin?" (builtin? cond)) (pass-if "procedure?" (procedure? builtin?))