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