summaryrefslogtreecommitdiff
path: root/testdata/testinputEBC
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2014-10-26 18:00:19 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2014-10-26 18:00:19 +0000
commit3189791ed32db62b685506df7526ae7c5c941585 (patch)
tree95dccb735520039ec776039fae500002fbdbe222 /testdata/testinputEBC
parent6357bc55f55b1f648acfdb0c46d4571964e7da3d (diff)
downloadpcre2-3189791ed32db62b685506df7526ae7c5c941585.tar.gz
Convert the special "EBCDIC on an ASCII system" test.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@125 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'testdata/testinputEBC')
-rw-r--r--testdata/testinputEBC121
1 files changed, 121 insertions, 0 deletions
diff --git a/testdata/testinputEBC b/testdata/testinputEBC
new file mode 100644
index 0000000..e3f1154
--- /dev/null
+++ b/testdata/testinputEBC
@@ -0,0 +1,121 @@
+# This is a specialized test for checking, when PCRE2 is compiled with the
+# EBCDIC option but in an ASCII environment, that newline and white space
+# functionality is working. It catches cases where explicit values such as 0x0a
+# have been used instead of names like CHAR_LF. Needless to say, it is not a
+# genuine EBCDIC test! In patterns, alphabetic characters that follow a
+# backslash must be in EBCDIC code. In data, NL, NEL, LF, ESC, and DEL must be
+# in EBCDIC, but can of course be specified as escapes.
+
+# Test default newline and variations
+
+/^A/m
+ ABC
+ 12\x15ABC
+
+/^A/m,newline=any
+ 12\x15ABC
+ 12\x0dABC
+ 12\x0d\x15ABC
+ 12\x25ABC
+
+/^A/m,newline=anycrlf
+ 12\x15ABC
+ 12\x0dABC
+ 12\x0d\x15ABC
+ ** Fail
+ 12\x25ABC
+
+# Test \h
+
+/^A\ˆ/
+ A B
+
+# Test \H
+
+/^A\È/
+ AB
+ ** Fail
+ A B
+
+# Test \R
+
+/^A\Ù/
+ A\x15B
+ A\x0dB
+ A\x25B
+ A\x0bB
+ A\x0cB
+ ** Fail
+ A B
+
+# Test \v
+
+/^A\¥/
+ A\x15B
+ A\x0dB
+ A\x25B
+ A\x0bB
+ A\x0cB
+ ** Fail
+ A B
+
+# Test \V
+
+/^A\å/
+ A B
+ ** Fail
+ A\x15B
+ A\x0dB
+ A\x25B
+ A\x0bB
+ A\x0cB
+
+# For repeated items, use an atomic group so that the output is the same
+# for DFA matching (otherwise it may show multiple matches).
+
+# Test \h+
+
+/^A(?>\ˆ+)/
+ A B
+
+# Test \H+
+
+/^A(?>\È+)/
+ AB
+ ** Fail
+ A B
+
+# Test \R+
+
+/^A(?>\Ù+)/
+ A\x15B
+ A\x0dB
+ A\x25B
+ A\x0bB
+ A\x0cB
+ ** Fail
+ A B
+
+# Test \v+
+
+/^A(?>\¥+)/
+ A\x15B
+ A\x0dB
+ A\x25B
+ A\x0bB
+ A\x0cB
+ ** Fail
+ A B
+
+# Test \V+
+
+/^A(?>\å+)/
+ A B
+ ** Fail
+ A\x15B
+ A\x0dB
+ A\x25B
+ A\x0bB
+ A\x0cB
+
+# End