lyx_mirror/src/tests/check_ExternalTransforms.cpp
Georg Baum dae8555234 Get rid of regex_constants::match_partial
As shown by the unit test this is not needed at all, even not for really
awkward input.
2014-12-28 17:46:33 +01:00

56 lines
1.7 KiB
C++

#include <config.h>
#include "../insets/ExternalTransforms.h"
#include "../support/debug.h"
#include <iostream>
using namespace lyx;
using namespace std;
void test_sanitizeLatexOption()
{
using external::sanitizeLatexOption;
// invalid input
cout << sanitizeLatexOption("") << endl;
cout << sanitizeLatexOption(",") << endl;
cout << sanitizeLatexOption(",,") << endl;
cout << sanitizeLatexOption("[") << endl;
cout << sanitizeLatexOption("]") << endl;
cout << sanitizeLatexOption("a,[,c]") << endl;
cout << sanitizeLatexOption("[a,],c") << endl;
// valid input
cout << sanitizeLatexOption("[]") << endl;
cout << sanitizeLatexOption("[[]") << endl;
cout << sanitizeLatexOption("[]]") << endl;
cout << sanitizeLatexOption("[[]]") << endl;
cout << sanitizeLatexOption("[,]") << endl;
cout << sanitizeLatexOption("[,,]") << endl;
cout << sanitizeLatexOption("[,,,]") << endl;
cout << sanitizeLatexOption("[a]") << endl;
cout << sanitizeLatexOption("[,a]") << endl;
cout << sanitizeLatexOption("[,,a]") << endl;
cout << sanitizeLatexOption("[,,,a]") << endl;
cout << sanitizeLatexOption("[a,b]") << endl;
cout << sanitizeLatexOption("[a,,b]") << endl;
cout << sanitizeLatexOption("[a,,,b]") << endl;
cout << sanitizeLatexOption("[a,[,c]") << endl;
cout << sanitizeLatexOption("[a,],c]") << endl;
cout << sanitizeLatexOption("[a,[],c]") << endl;
cout << sanitizeLatexOption("[a,,[],,c]") << endl;
cout << sanitizeLatexOption("[a,,[,],,c]") << endl;
cout << sanitizeLatexOption("[a,]") << endl;
cout << sanitizeLatexOption("[a,,]") << endl;
cout << sanitizeLatexOption("[a,,,]") << endl;
}
int main(int, char **)
{
// Connect lyxerr with cout instead of cerr to catch error output
lyx::lyxerr.setStream(cout);
test_sanitizeLatexOption();
}