Two more tests for double indirect substring modification.
authorMarius Vollmer <mvo@zagadka.de>
Tue, 24 Aug 2004 22:14:57 +0000 (22:14 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Tue, 24 Aug 2004 22:14:57 +0000 (22:14 +0000)
test-suite/tests/strings.test

index a215532..544c8eb 100644 (file)
           (str2 (string-copy str1)))
       (string-upcase! (substring/shared str2 3 6))
       (and (string=? str1 "foofoofoo")
-          (string=? str2 "fooFOOfoo")))))
\ No newline at end of file
+          (string=? str2 "fooFOOfoo"))))
+
+  (pass-if "modify double indirectly"
+    (let* ((str1 "foofoofoo")
+          (str2 (substring/shared str1 2 7)))
+      (string-upcase! (substring/shared str2 1 4))
+      (string=? str1 "fooFOOfoo")))
+
+  (pass-if "modify cow double indirectly"
+    (let* ((str1 "foofoofoo")
+          (str2 (substring str1 2 7)))
+      (string-upcase! (substring/shared str2 1 4))
+      (and (string=? str1 "foofoofoo")
+          (string=? str2 "oFOOf")))))