/** * @author Edouard DUPIN * @copyright 2017, Edouard DUPIN, all right reserved * @license MPL-2 (see license file) */ #include #include #include #include #include static etk::String sourceIf1Action = "action_A;print_console(){action_B;}action_D;"; static etk::String sourceIf2Action = "action_A;print_console(){action_B;action_C;}action_D;"; static etk::String sourceBrace0Action = "action_A;if(true){}action_D;"; static etk::String sourceBrace1Action = "action_A;if(true){action_B;}action_D;"; static etk::String sourceBrace1ActionNoBrace = "action_A;if(true)action_B;action_D;"; static etk::String sourceBrace2Action = "action_A;if(true){action_B;action_C;}action_D;"; TEST(testFunction, brace_100000) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{action_B;\n}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101000) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{action_B;\n}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101100) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{ action_B;\n} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110000) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\naction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110100) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\naction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111000) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\naction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111100) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\naction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_100100) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{ action_B;\n} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010000) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\naction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010100) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\naction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011000) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\naction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001000) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {action_B; }action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001100) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) { action_B; } action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011100) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\naction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_000100) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){ action_B;} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } ///////////////////////////////////////////////////////////////////////////////////////// TEST(testFunction, brace_100001) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{action_B;\n}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101001) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{action_B;\n}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101101) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{ action_B;\n} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110001) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\n\taction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110101) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\n\taction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111001) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\n\taction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111101) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{\n\taction_B;\n}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_100101) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n{ action_B;\n} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010001) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\n\taction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010101) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\n\taction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011001) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\n\taction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001001) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {action_B; }action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001101) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) { action_B; } action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011101) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\n\taction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_000101) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); //interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); //interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){ action_B;} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } ///////////////////////////////////////////////////////////////////////////////////////// TEST(testFunction, brace_100010) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{action_B;\n\t}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101010) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{action_B;\n\t}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101110) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{ action_B;\n\t} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110010) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110110) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111010) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111110) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_100110) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{ action_B;\n\t} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010010) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\n\taction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010110) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\n\taction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011010) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\n\taction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001010) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {action_B; }action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001110) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) { action_B; } action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011110) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\n\taction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_000110) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); //interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); //interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){ action_B;} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } ///////////////////////////////////////////////////////////////////////////////////////// TEST(testFunction, brace_100011) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{action_B;\n\t}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101011) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{action_B;\n\t}action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_101111) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{ action_B;\n\t} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110011) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\t\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_110111) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\t\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111011) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\t\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_111111) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\t\taction_B;\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_100111) { estyle::Generator interface; // in: interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true)\n\t{ action_B;\n\t} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010011) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\n\t\taction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_010111) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){\n\t\taction_B;}\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011011) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\n\t\taction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001011) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); //interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); //interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {action_B; }action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_001111) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) { action_B; } action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_011111) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true) {\n\t\taction_B; }\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_000111) { estyle::Generator interface; // in: //interface.properties.set("brace-function-in-new-line-before", "true"); //interface.properties.set("brace-function-in-new-line-after", "true"); //interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: //interface.properties.set("brace-function-out-new-line-before", "true"); //interface.properties.set("brace-function-out-new-line-after", "true"); //interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // single: //interface.properties.set("brace-function-single", "true"); etk::String outRef = "action_A;if(true){ action_B;} action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } ///////////////////////////////////////////////////////////////////////////////////////// TEST(testFunction, brace_single_000) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); //interface.properties.set("brace-function-single-in-new-line", "true"); //interface.properties.set("brace-function-single-in-space", "true"); //interface.properties.set("brace-function-single-out-new-line", "true"); //interface.properties.set("brace-function-single-out-space", "true"); //interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true)action_B;action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_100) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); interface.properties.set("brace-function-single-in-new-line", "true"); //interface.properties.set("brace-function-single-in-space", "true"); interface.properties.set("brace-function-single-out-new-line", "true"); //interface.properties.set("brace-function-single-out-space", "true"); //interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true)\naction_B;\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_010) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); //interface.properties.set("brace-function-single-in-new-line", "true"); interface.properties.set("brace-function-single-in-space", "true"); //interface.properties.set("brace-function-single-out-new-line", "true"); interface.properties.set("brace-function-single-out-space", "true"); //interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true) action_B; action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_110) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); interface.properties.set("brace-function-single-in-new-line", "true"); interface.properties.set("brace-function-single-in-space", "true"); interface.properties.set("brace-function-single-out-new-line", "true"); interface.properties.set("brace-function-single-out-space", "true"); //interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true)\naction_B;\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_001) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); //interface.properties.set("brace-function-single-in-new-line", "true"); //interface.properties.set("brace-function-single-in-space", "true"); //interface.properties.set("brace-function-single-out-new-line", "true"); //interface.properties.set("brace-function-single-out-space", "true"); interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true)action_B;action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_101) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); interface.properties.set("brace-function-single-in-new-line", "true"); //interface.properties.set("brace-function-single-in-space", "true"); interface.properties.set("brace-function-single-out-new-line", "true"); //interface.properties.set("brace-function-single-out-space", "true"); interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true)\n\taction_B;\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_011) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); //interface.properties.set("brace-function-single-in-new-line", "true"); interface.properties.set("brace-function-single-in-space", "true"); //interface.properties.set("brace-function-single-out-new-line", "true"); interface.properties.set("brace-function-single-out-space", "true"); interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true) action_B; action_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_single_111) { estyle::Generator interface; //interface.properties.set("brace-function-one-line-size-max", "40"); interface.properties.set("brace-function-single", "true"); interface.properties.set("brace-function-single-in-new-line", "true"); interface.properties.set("brace-function-single-in-space", "true"); interface.properties.set("brace-function-single-out-new-line", "true"); interface.properties.set("brace-function-single-out-space", "true"); interface.properties.set("brace-function-single-indent", "true"); etk::String outRef = "action_A;if(true)\n\taction_B;\naction_D;"; etk::String output = interface.process(sourceBrace1Action); EXPECT_EQ(output, outRef); output = interface.process(sourceBrace1ActionNoBrace); EXPECT_EQ(output, outRef); } /////////////////////////////////////////////////////////////////////////////////////////////////// TEST(testFunction, brace_empty_000) { estyle::Generator interface; // in out for specific empty change: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // empty //interface.properties.set("brace-function-one-line-size-max", "0"); //interface.properties.set("brace-empty-space", "true"); //interface.properties.set("brace-empty-indent", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace0Action); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_empty_100) { estyle::Generator interface; // in out for specific empty change: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // empty interface.properties.set("brace-function-one-line-size-max", "0"); //interface.properties.set("brace-function-empty-space", "true"); //interface.properties.set("brace-function-empty-indent", "true"); etk::String outRef = "action_A;if(true) {}\naction_D;"; etk::String output = interface.process(sourceBrace0Action); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_empty_110) { estyle::Generator interface; // in out for specific empty change: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // empty interface.properties.set("brace-function-one-line-size-max", "0"); interface.properties.set("brace-function-empty-space", "true"); //interface.properties.set("brace-function-empty-indent", "true"); etk::String outRef = "action_A;if(true) { }\naction_D;"; etk::String output = interface.process(sourceBrace0Action); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_empty_111) { estyle::Generator interface; // in out for specific empty change: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // empty interface.properties.set("brace-function-one-line-size-max", "0"); interface.properties.set("brace-function-empty-space", "true"); interface.properties.set("brace-function-empty-indent", "true"); etk::String outRef = "action_A;if(true) { }\naction_D;"; etk::String output = interface.process(sourceBrace0Action); EXPECT_EQ(output, outRef); } TEST(testFunction, brace_empty_001) { estyle::Generator interface; // in out for specific empty change: interface.properties.set("brace-function-in-new-line-before", "true"); interface.properties.set("brace-function-in-new-line-after", "true"); interface.properties.set("brace-function-in-space-before", "true"); interface.properties.set("brace-function-in-space-after", "true"); interface.properties.set("brace-function-in-indent-before", "true"); interface.properties.set("brace-function-in-indent-after", "true"); // out: interface.properties.set("brace-function-out-new-line-before", "true"); interface.properties.set("brace-function-out-new-line-after", "true"); interface.properties.set("brace-function-out-space-before", "true"); interface.properties.set("brace-function-out-space-after", "true"); interface.properties.set("brace-function-out-unindent-after", "true"); interface.properties.set("brace-function-out-unindent-before", "true"); // empty //interface.properties.set("brace-function-one-line-size-max", "0"); //interface.properties.set("brace-function-empty-space", "true"); interface.properties.set("brace-function-empty-indent", "true"); etk::String outRef = "action_A;if(true)\n\t{\n\t\t\n\t}\naction_D;"; etk::String output = interface.process(sourceBrace0Action); EXPECT_EQ(output, outRef); }