2014-12-28 12:23:35 +00:00
|
|
|
#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;
|
2014-12-28 16:34:46 +00:00
|
|
|
// invalid input
|
|
|
|
cout << sanitizeLatexOption("") << endl;
|
|
|
|
cout << sanitizeLatexOption(",") << endl;
|
|
|
|
cout << sanitizeLatexOption(",,") << endl;
|
|
|
|
cout << sanitizeLatexOption("[") << endl;
|
|
|
|
cout << sanitizeLatexOption("]") << endl;
|
2014-12-28 16:46:33 +00:00
|
|
|
cout << sanitizeLatexOption("a,[,c]") << endl;
|
|
|
|
cout << sanitizeLatexOption("[a,],c") << endl;
|
2014-12-28 16:34:46 +00:00
|
|
|
// valid input
|
2014-12-28 12:23:35 +00:00
|
|
|
cout << sanitizeLatexOption("[]") << endl;
|
2014-12-28 16:34:46 +00:00
|
|
|
cout << sanitizeLatexOption("[[]") << endl;
|
|
|
|
cout << sanitizeLatexOption("[]]") << endl;
|
|
|
|
cout << sanitizeLatexOption("[[]]") << endl;
|
2014-12-28 12:23:35 +00:00
|
|
|
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;
|
2014-12-28 16:46:33 +00:00
|
|
|
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;
|
2014-12-28 12:23:35 +00:00
|
|
|
cout << sanitizeLatexOption("[a,]") << endl;
|
|
|
|
cout << sanitizeLatexOption("[a,,]") << endl;
|
|
|
|
cout << sanitizeLatexOption("[a,,,]") << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(int, char **)
|
|
|
|
{
|
2014-12-28 16:34:46 +00:00
|
|
|
// Connect lyxerr with cout instead of cerr to catch error output
|
|
|
|
lyx::lyxerr.setStream(cout);
|
2014-12-28 12:23:35 +00:00
|
|
|
test_sanitizeLatexOption();
|
|
|
|
}
|