diff options
author | Andy Wingo <wingo@pobox.com> | 2012-01-10 00:41:42 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2012-01-10 00:41:42 +0100 |
commit | 91ee7515da0bad91330ce5c87b250d6cf12a2789 (patch) | |
tree | ce023c92c0d9bf895c1265b107b270c35ba59b94 /test-suite/tests/regexp.test | |
parent | 0bdd43515eb3c62839512181cf33e5aea383e661 (diff) | |
parent | 0e947e1d14597651c5762a4209225c472bdaef45 (diff) | |
download | guile-91ee7515da0bad91330ce5c87b250d6cf12a2789.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
libguile/__scm.h
libguile/array-map.c
libguile/procprop.c
libguile/tags.h
module/ice-9/deprecated.scm
module/ice-9/psyntax-pp.scm
module/ice-9/psyntax.scm
test-suite/standalone/test-num2integral.c
test-suite/tests/regexp.test
Diffstat (limited to 'test-suite/tests/regexp.test')
-rw-r--r-- | test-suite/tests/regexp.test | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test-suite/tests/regexp.test b/test-suite/tests/regexp.test index 832542edc..c2b65a64c 100644 --- a/test-suite/tests/regexp.test +++ b/test-suite/tests/regexp.test @@ -147,6 +147,14 @@ (define char-code-limit 256) +;; Since `regexp-quote' uses string ports, and since it is used below +;; with non-ASCII characters, these ports must be Unicode-capable. +(define-syntax with-unicode + (syntax-rules () + ((_ exp) + (with-fluids ((%default-port-encoding "UTF-8")) + exp)))) + (with-test-prefix "regexp-quote" (pass-if-exception "no args" exception:wrong-num-args @@ -175,7 +183,7 @@ (s (string c))) (pass-if (list "char" i (format #f "~s ~s" c s)) (with-ascii-or-latin1-locale i - (let* ((q (regexp-quote s)) + (let* ((q (with-unicode (regexp-quote s))) (m (regexp-exec (make-regexp q flag) s))) (and (= 0 (match:start m)) (= 1 (match:end m)))))))) @@ -187,7 +195,7 @@ ((>= i char-code-limit)) (let* ((c (integer->char i)) (s (string #\a c)) - (q (regexp-quote s))) + (q (with-unicode (regexp-quote s)))) (pass-if (list "string \"aX\"" i (format #f "~s ~s ~s" c s q)) (with-ascii-or-latin1-locale i (let* ((m (regexp-exec (make-regexp q flag) s))) @@ -196,7 +204,8 @@ (pass-if "string of all chars" (with-latin1-locale - (let ((m (regexp-exec (make-regexp (regexp-quote allchars) + (let ((m (regexp-exec (make-regexp (with-unicode + (regexp-quote allchars)) flag) allchars))) (and (= 0 (match:start m)) (= (string-length allchars) (match:end m))))))))) |