From 8a954f3df579eae483d1df718e7ec3e745962aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 8 Oct 2010 09:46:39 +0200 Subject: [PATCH] Always run at least the ASCII regexp tests. * test-suite/tests/regexp.test (with-ascii-or-latin1-locale): New macro. ("regexp-quote"): Use it instead of `with-latin1-locale'. --- test-suite/tests/regexp.test | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test-suite/tests/regexp.test b/test-suite/tests/regexp.test index a6844cac9..efa0e7e80 100644 --- a/test-suite/tests/regexp.test +++ b/test-suite/tests/regexp.test @@ -138,6 +138,13 @@ ;;; regexp-quote ;;; +(define-syntax with-ascii-or-latin1-locale + (syntax-rules () + ((_ chr body ...) + (if (> chr 127) + (with-latin1-locale body ...) + (begin body ...))))) + (with-test-prefix "regexp-quote" (pass-if-exception "no args" exception:wrong-num-args @@ -165,7 +172,7 @@ (let* ((c (integer->char i)) (s (string c))) (pass-if (list "char" i (format #f "~s ~s" c s)) - (with-latin1-locale + (with-ascii-or-latin1-locale i (let* ((q (regexp-quote s)) (m (regexp-exec (make-regexp q flag) s))) (and (= 0 (match:start m)) @@ -180,7 +187,7 @@ (s (string #\a c)) (q (regexp-quote s))) (pass-if (list "string \"aX\"" i (format #f "~s ~s ~s" c s q)) - (with-latin1-locale + (with-ascii-or-latin1-locale i (let* ((m (regexp-exec (make-regexp q flag) s))) (and (= 0 (match:start m)) (= 2 (match:end m))))))))