1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00
Commit graph

24 commits

Author SHA1 Message Date
Chris K. Jester-Young
d6e1c8bfdb In fold-matches, set regexp/notbol unless matching string start.
* module/ice-9/regex.scm (fold-matches): Set regexp/notbol if the
  starting position is nonzero.
* test-suite/tests/regexp.test (fold-matches): Check that when
  matching /^foo/ against "foofoofoofoo", only one match results.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2012-09-26 23:46:05 +02:00
Ludovic Courtès
7aa394b53c doc: Fix description of regexp/locale encoding interaction.
* doc/ref/api-regex.texi (Regexp Functions): Update paragraph that
  mentions locale encoding and strings-as-bytes.

* test-suite/tests/regexp.test ("nonascii locales")["match structures
  refer to char offsets, non-ASCII pattern"]: New test.
2012-08-27 00:09:30 +02:00
Ludovic Courtès
211e71a184 Make sure `regexp-quote' tests use Unicode-capable string ports.
* test-suite/tests/regexp.test (with-unicode): New macro.
  ("regexp-quote"): Wrap all `regexp-quote' calls in it.  This fixes
  tests on machines where the default port encoding is US-ASCII.
2012-01-09 23:16:20 +01:00
Ludovic Courtès
43ecaffc2f Fix `regexp.test' when the "en_US.utf8" locale isn't available.
* test-suite/tests/regexp.test ("nonascii locales"): Move `with-locale'
  within the body of `pass-if' so that `unresolved' is caught.
2010-11-24 23:38:01 +01:00
Andy Wingo
644c5165ee fix regexp matches to refer to chars, not bytes
* libguile/regex-posix.c (fixup_multibyte_match): Fixup the match
  structure to refer to character offsets, not byte offsets. Fixes bug
  31650.

* test-suite/tests/regexp.test: Add a test.
2010-11-23 22:39:20 +01:00
Ludovic Courtès
8a954f3df5 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'.
2010-10-08 15:25:56 +02:00
Ludovic Courtès
dec84a0a6e Try to avoid `guile-test' failures when it can't display the name of a test.
This can happen, e.g., when printing "UNRESOLVED: regexp.test: TEST-NAME",
where TEST-NAME contains characters that cannot be converted to the
encoding of the current output or error port.

* test-suite/guile-test (main): Set the conversion strategy for the
  output and error ports to `escape'.

* test-suite/tests/regexp.test (current-output-port): Likewise.
2010-03-04 11:32:51 +01:00
Ludovic Courtès
1c242b37f0 Use with-latin1-locale' in regexp.test'.
As a side effect, it fixes tests on platforms with no 8-bit locale and
where executing regexps on characters >= 128 can lead to errors such as
`cannot convert to output locale "US-ASCII": ""\x80""'.

This commit partially reverts 7583976b ("More setlocale robustness in
regexp tests").

* test-suite/tests/regexp.test (mysetlocale, set-latin-1): Remove.
  ("regexp-quote"): Use `with-latin1-locale' instead of the above
  procedures.
2010-03-04 00:47:21 +01:00
Michael Gran
d71db1f9a9 Modify regexp.test to work better with mac/darwin
* test-suite/tests/regexp.test (set-latin-1): also add .ISO8859-1 as a
  possible extension for latin-1 locales.  Use set-latin-1 exclusively
  to set the locale for tests.
2009-10-12 06:55:25 -07:00
Michael Gran
7583976b3a More setlocale robustness in regexp tests
* test-suite/tests/regexp.test (mysetlocale, set-latin-1): new functions
  (with-latin1-locale): removed
  (regexp-quote tests): try to print test names in locale but run tests
  in ISO-8859-1.
2009-09-10 21:30:11 -07:00
Michael Gran
e354d7689a Avoid prematurely ending regexp test when ISO-8859-1 locale not found
* test-suite/tests/regexp.test (with-latin1-locale): new function
  Call tests in context of with-latin1-locale
2009-09-09 08:11:21 -07:00
Michael Gran
0d05ae7c4b 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
2009-09-07 19:12:40 -07:00
Neil Jerram
53befeb700 Change Guile license to LGPLv3+
(Not quite finished, the following will be done tomorrow.
   module/srfi/*.scm
   module/rnrs/*.scm
   module/scripts/*.scm
   testsuite/*.scm
   guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
76ed3e877f Enclose `regexp.test' in a module.
* test-suite/tests/regexp.test: Add `define-module' clause.
2008-09-25 21:36:14 +02:00
Ludovic Courtès
c633310265 Fix handling of the FLAGS argument in `fold-matches'.
* ice-9/regex.scm (fold-matches): If FLAGS is non-null, use
  `(car flags)', not `flags'.

* test-suite/tests/regexp.test ("fold-matches"): New test prefix.

* NEWS: Update.
2008-09-25 21:07:06 +02:00
Kevin Ryde
8e1973d9ab merge from 1.8 2007-01-15 23:49:04 +00:00
Kevin Ryde
6e7d5622ee merge from 1.8 branch 2006-04-16 23:37:40 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Kevin Ryde
38923713f1 (match:string): New tests. 2004-09-28 23:53:02 +00:00
Kevin Ryde
1df6de9637 (regexp-quote): New tests. 2004-08-27 01:14:49 +00:00
Kevin Ryde
710491c564 (make-regexp): Exercise flags args validation. 2004-07-27 22:49:52 +00:00
Marius Vollmer
0a77048bfd (regexp-substitute/global): Do not test with empty regexp. Empty
regexps do not work on NetBSD.
2002-05-06 19:32:20 +00:00
Jim Blandy
f88fdc6e32 * tests/regexp.test: Check regexp-substitute/global when there are
no matches.  (Duh.)
1999-09-20 22:52:02 +00:00
Jim Blandy
3dcdcfe8c7 * tests/regexp.test: New test file. 1999-09-11 17:39:30 +00:00