mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +02:00
8-bit locale needed for 8-bit regexp tests
Since the regex library expects 8-bit clean characters and an 8-bit locale, tests of 8-bit characters need to occur within the context of an 8-bit locale. * test-suite/tests/regexp.test (regexp-quote tests): wrap them in an ISO-8859-1 locale
This commit is contained in:
parent
7519234547
commit
0d05ae7c4b
1 changed files with 44 additions and 43 deletions
|
@ -132,6 +132,7 @@
|
||||||
|
|
||||||
(with-test-prefix "regexp-quote"
|
(with-test-prefix "regexp-quote"
|
||||||
|
|
||||||
|
(with-locale "en_US.iso88591"
|
||||||
(pass-if-exception "no args" exception:wrong-num-args
|
(pass-if-exception "no args" exception:wrong-num-args
|
||||||
(regexp-quote))
|
(regexp-quote))
|
||||||
|
|
||||||
|
@ -157,7 +158,7 @@
|
||||||
(let* ((c (integer->char i))
|
(let* ((c (integer->char i))
|
||||||
(s (string c))
|
(s (string c))
|
||||||
(q (regexp-quote s)))
|
(q (regexp-quote s)))
|
||||||
(pass-if (list "char" i c s q)
|
(pass-if (list "char" i (format #f "~s ~s ~s" c s q))
|
||||||
(let ((m (regexp-exec (make-regexp q flag) s)))
|
(let ((m (regexp-exec (make-regexp q flag) s)))
|
||||||
(and (= 0 (match:start m))
|
(and (= 0 (match:start m))
|
||||||
(= 1 (match:end m)))))))
|
(= 1 (match:end m)))))))
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
(let* ((c (integer->char i))
|
(let* ((c (integer->char i))
|
||||||
(s (string #\a c))
|
(s (string #\a c))
|
||||||
(q (regexp-quote s)))
|
(q (regexp-quote s)))
|
||||||
(pass-if (list "string \"aX\"" i c s q)
|
(pass-if (list "string \"aX\"" i (format #f "~s ~s ~s" c s q))
|
||||||
(let ((m (regexp-exec (make-regexp q flag) s)))
|
(let ((m (regexp-exec (make-regexp q flag) s)))
|
||||||
(and (= 0 (match:start m))
|
(and (= 0 (match:start m))
|
||||||
(= 2 (match:end m)))))))
|
(= 2 (match:end m)))))))
|
||||||
|
@ -180,7 +181,7 @@
|
||||||
flag) allchars)))
|
flag) allchars)))
|
||||||
(and (= 0 (match:start m))
|
(and (= 0 (match:start m))
|
||||||
(= (string-length allchars) (match:end m))))))))
|
(= (string-length allchars) (match:end m))))))))
|
||||||
lst)))
|
lst))))
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; regexp-substitute
|
;;; regexp-substitute
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue