mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-04 22:32:19 +00:00
dae8555234
As shown by the unit test this is not needed at all, even not for really awkward input.
56 lines
1.7 KiB
C++
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();
|
|
}
|