aboutsummaryrefslogtreecommitdiffstats
path: root/libtests/pcre.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2008-04-29 14:55:25 +0200
committerJay Berkenbilt <ejb@ql.org>2008-04-29 14:55:25 +0200
commit9a0b88bf7777c153dc46ace22db74ef24d51583a (patch)
treef567ac1cf2bf5071a611eb49323a935b6ac938ff /libtests/pcre.cc
downloadqpdf-9a0b88bf7777c153dc46ace22db74ef24d51583a.tar.zst
update release date to actual daterelease-qpdf-2.0
git-svn-id: svn+q:///qpdf/trunk@599 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'libtests/pcre.cc')
-rw-r--r--libtests/pcre.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/libtests/pcre.cc b/libtests/pcre.cc
new file mode 100644
index 00000000..0df692a3
--- /dev/null
+++ b/libtests/pcre.cc
@@ -0,0 +1,30 @@
+
+#include <qpdf/PCRE.hh>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ if ((argc == 2) && (strcmp(argv[1], "--unicode-classes-supported") == 0))
+ {
+ try
+ {
+ PCRE("^([\\p{L}]+)", PCRE_UTF8);
+ std::cout << "1" << std::endl;
+ }
+ catch (PCRE::Exception& e)
+ {
+ std::cout << "0" << std::endl;
+ }
+ return 0;
+ }
+
+ if ((argc == 2) && (strcmp(argv[1], "--unicode-classes") == 0))
+ {
+ PCRE::test(1);
+ }
+ else
+ {
+ PCRE::test();
+ }
+ return 0;
+}