diff --git a/extra/pcre/pcre-tests.factor b/extra/pcre/pcre-tests.factor index 033acd7331..6582a71424 100644 --- a/extra/pcre/pcre-tests.factor +++ b/extra/pcre/pcre-tests.factor @@ -1,7 +1,8 @@ USING: accessors arrays assocs continuations http.client kernel -literals math.ranges pcre pcre.ffi pcre.private random sequences -system tools.test ; +literals math math.parser math.ranges pcre pcre.ffi pcre.private +random sequences system tools.test ; QUALIFIED: regexp +QUALIFIED: splitting IN: pcre.tests { { "Bords" "words" "word" } } [ @@ -102,16 +103,29 @@ os unix? [ [ 10 ] [ PCRE_CONFIG_NEWLINE pcre-config ] unit-test ] when { t } [ "abcö" "\\p{Ll}{4}" matches? ] unit-test -! Dotall mode, off by default -{ f } [ "." PCRE_DOTALL has-option? ] unit-test -{ t } [ "(?s)." PCRE_DOTALL has-option? ] unit-test +! This used to work in 8.36, but might have changed in later versions. +! See: https://bugs.exim.org/show_bug.cgi?id=1875 +pcre_version " " splitting:split1 drop string>number 8.36 <= [ + { t t } [ + "(?s)." PCRE_DOTALL has-option? + "(?i)x" PCRE_CASELESS has-option? + ] unit-test +] when { f } [ "\n" "." matches? ] unit-test { t } [ "\n" "(?s)." matches? ] unit-test -! Caseless mode, off by default -{ { f t } } [ - { "x" "(?i)x" } [ PCRE_CASELESS has-option? ] map +{ f t } [ + "hello\nthere" "^.*$" matches? + "hello\nthere" "(?s)^.*$" matches? +] unit-test + +! Modes off by default +{ f f } [ + ! Caseless mode + "x" PCRE_CASELESS has-option? + ! Dotall mode + "." PCRE_DOTALL has-option? ] unit-test ! Backreferences