Test invalid sanitizeLatexOption() input as well

This commit is contained in:
Georg Baum 2014-12-28 17:34:46 +01:00
parent 62ed0aeefb
commit 449c766e03
2 changed files with 25 additions and 1 deletions

View File

@ -13,7 +13,17 @@ using namespace std;
void test_sanitizeLatexOption() void test_sanitizeLatexOption()
{ {
using external::sanitizeLatexOption; using external::sanitizeLatexOption;
// invalid input
cout << sanitizeLatexOption("") << endl;
cout << sanitizeLatexOption(",") << endl;
cout << sanitizeLatexOption(",,") << endl;
cout << sanitizeLatexOption("[") << endl;
cout << sanitizeLatexOption("]") << 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("[,,]") << endl; cout << sanitizeLatexOption("[,,]") << endl;
cout << sanitizeLatexOption("[,,,]") << endl; cout << sanitizeLatexOption("[,,,]") << endl;
@ -32,6 +42,7 @@ void test_sanitizeLatexOption()
int main(int, char **) int main(int, char **)
{ {
lyx::lyxerr.setStream(cerr); // Connect lyxerr with cout instead of cerr to catch error output
lyx::lyxerr.setStream(cout);
test_sanitizeLatexOption(); test_sanitizeLatexOption();
} }

View File

@ -1,4 +1,17 @@
Unable to sanitize LaTeX "Option":
Unable to sanitize LaTeX "Option": ,
Unable to sanitize LaTeX "Option": ,,
Unable to sanitize LaTeX "Option":
Unable to sanitize LaTeX "Option": ]
[[]
[]]
[[]]