summaryrefslogtreecommitdiffstats
path: root/libtests/pcre.cc
blob: 6ebec01e21baf62cbfdcac1b7373d83bb631b9cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <qpdf/PCRE.hh>
#include <iostream>
#include <string.h>

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 (std::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;
}