From 99f7ecf74427e75b6122aad697c863931ff4dae8 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Tue, 7 Jun 2005 19:16:43 +0000 Subject: [PATCH] ("set-source-property!"): Two new tests. --- test-suite/ChangeLog | 4 ++++ test-suite/tests/srcprop.test | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index bc5cd5c68..dee1b4f8b 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,7 @@ +2005-06-07 Neil Jerram + + * tests/srcprop.test ("set-source-property!"): Two new tests. + 2005-06-06 Kevin Ryde * tests/strings.test (string-split): Try splitting on an 8-bit char. diff --git a/test-suite/tests/srcprop.test b/test-suite/tests/srcprop.test index af30b1ac6..c7e10a684 100644 --- a/test-suite/tests/srcprop.test +++ b/test-suite/tests/srcprop.test @@ -78,3 +78,24 @@ (let ((t (cons 3 4))) (set-source-properties! t (source-properties s)) (not (null? (source-properties t)))))))) + +;;; +;;; set-source-property! +;;; + +(with-test-prefix "set-source-property!" + (read-enable 'positions) + (let ((s (read (open-input-string "(display \"\")")))) + + (pass-if "set-source-property! before eval" + (set-source-property! s 'test-sym 10) + (eval s the-scm-module) + #t) + + (pass-if "set-source-property! after eval" + (hash-fold (lambda (x props acc) + (if (eq? (source-property x 'test-sym) 10) + (set-source-property! x 'test-sym 11))) + 0 + source-whash) + #t)))