]> git.lyx.org Git - lyx.git/blobdiff - src/tests/check_ExternalTransforms.cpp
Fix bug #8814: Ask for place to export a file if it has not
[lyx.git] / src / tests / check_ExternalTransforms.cpp
index fe7c6f8569b4e4a44036506463e2029e3417072c..37cd20f19c7743f9fe54caf94bb909d87aac0e55 100644 (file)
@@ -13,7 +13,19 @@ 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;
@@ -24,6 +36,11 @@ void test_sanitizeLatexOption()
        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;
@@ -32,6 +49,7 @@ void test_sanitizeLatexOption()
 
 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();
 }