2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-16 17:45:09 +00:00
qpdf/libtests/numrange.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
613 B
C++
Raw Normal View History

#include <qpdf/QUtil.hh>
#include <iostream>
static void
test_numrange(char const* range)
{
2023-05-20 11:46:50 +00:00
if (range == nullptr) {
std::cout << "null" << std::endl;
} else {
std::vector<int> result = QUtil::parse_numrange(range, 15);
std::cout << "numeric range " << range << " ->";
for (int i: result) {
std::cout << " " << i;
}
std::cout << std::endl;
}
}
int
main(int argc, char* argv[])
{
try {
test_numrange(argv[1]);
} catch (std::exception& e) {
std::cout << e.what() << std::endl;
return 2;
}
return 0;
}