summaryrefslogtreecommitdiff
path: root/test-suite/tests/strings.test
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-09-22 14:32:47 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-09-22 14:32:47 +0000
commitd7e4c2da23feae8c135384af3d4ace1130d7c517 (patch)
treebd16b277ea44e05873539e19a73116f5dcff5f88 /test-suite/tests/strings.test
parente4cbd1d8aacd37a427705d8b3e60192076efe962 (diff)
downloadguile-d7e4c2da23feae8c135384af3d4ace1130d7c517.tar.gz
* tests/ports.test ("string ports"): Copy string literal so that
it can be modified. * tests/srfi-13.test ("string-copy!"): Likewise. * tests/strings.test ("substring/shared"): Likewise.
Diffstat (limited to 'test-suite/tests/strings.test')
-rw-r--r--test-suite/tests/strings.test13
1 files changed, 5 insertions, 8 deletions
diff --git a/test-suite/tests/strings.test b/test-suite/tests/strings.test
index 544c8eb9c..86cf48774 100644
--- a/test-suite/tests/strings.test
+++ b/test-suite/tests/strings.test
@@ -20,11 +20,8 @@
(use-modules (test-suite lib))
-;; FIXME: As soon as guile supports immutable strings, this has to be
-;; replaced with the appropriate error type and message.
-(define exception:immutable-string
- (cons 'some-error-type "^trying to modify an immutable string"))
-
+(define exception:read-only-string
+ (cons 'misc-error "^string is read-only"))
(with-test-prefix "string=?"
@@ -78,8 +75,8 @@
(with-test-prefix "string-set!"
- (expect-fail-exception "string constant"
- exception:immutable-string
+ (pass-if-exception "string constant"
+ exception:read-only-string
(string-set! "abc" 1 #\space)))
(with-test-prefix "substring-move!"
@@ -103,7 +100,7 @@
(string=? str2 "fooFOOfoo"))))
(pass-if "modify double indirectly"
- (let* ((str1 "foofoofoo")
+ (let* ((str1 (string-copy "foofoofoo"))
(str2 (substring/shared str1 2 7)))
(string-upcase! (substring/shared str2 1 4))
(string=? str1 "fooFOOfoo")))