1648 lines
81 KiB
C++
1648 lines
81 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 sourceBrace0Action = "action_A;struct MyStruct{}action_D;";
|
|
static etk::String sourceBrace1Action = "action_A;struct MyStruct{action_B;}action_D;";
|
|
static etk::String sourceBrace2Action = "action_A;struct MyStruct{action_B;action_C;}action_D;";
|
|
|
|
|
|
TEST(testStruct, brace_100000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{action_B;\n}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{action_B;\n}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{ action_B;\n} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\naction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\naction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\naction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\naction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_100100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{ action_B;\n} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testStruct, brace_010000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\naction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_010100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\naction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\naction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001000) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {action_B; }action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct { action_B; } action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\naction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_000100) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{ action_B;} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testStruct, brace_100001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{action_B;\n}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{action_B;\n}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{ action_B;\n} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\n\taction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\n\taction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\n\taction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{\n\taction_B;\n}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_100101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n{ action_B;\n} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testStruct, brace_010001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\n\taction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_010101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\n\taction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\n\taction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001001) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {action_B; }action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct { action_B; } action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\n\taction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_000101) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
//interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{ action_B;} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testStruct, brace_100010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{action_B;\n\t}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{action_B;\n\t}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{ action_B;\n\t} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_100110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{ action_B;\n\t} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testStruct, brace_010010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\n\taction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_010110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\n\taction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\n\taction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001010) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {action_B; }action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct { action_B; } action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\n\taction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_000110) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
//interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
//interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{ action_B;} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
TEST(testStruct, brace_100011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{action_B;\n\t}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{action_B;\n\t}action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_101111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{ action_B;\n\t} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\t\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_110111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\t\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\t\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_111111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\t\taction_B;\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_100111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{ action_B;\n\t} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
TEST(testStruct, brace_010011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\n\t\taction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_010111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{\n\t\taction_B;}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\n\t\taction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001011) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
//interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
//interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {action_B; }action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_001111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct { action_B; } action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_011111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {\n\t\taction_B; }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_000111) {
|
|
estyle::Generator interface;
|
|
// in:
|
|
//interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
//interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
//interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
//interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// single:
|
|
//interface.properties.set("brace-struct-single", "true");
|
|
etk::String outRef = "action_A;struct MyStruct{ action_B;} action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST(testStruct, brace_single_000) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
//interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-in-space", "true");
|
|
//interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-out-space", "true");
|
|
//interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStructaction_B;action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_single_100) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-in-space", "true");
|
|
interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-out-space", "true");
|
|
//interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\naction_B;\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_single_010) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
//interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
interface.properties.set("brace-struct-single-in-space", "true");
|
|
//interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
interface.properties.set("brace-struct-single-out-space", "true");
|
|
//interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct action_B; action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
TEST(testStruct, brace_single_110) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
interface.properties.set("brace-struct-single-in-space", "true");
|
|
interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
interface.properties.set("brace-struct-single-out-space", "true");
|
|
//interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\naction_B;\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
|
|
|
|
TEST(testStruct, brace_single_001) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
//interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-in-space", "true");
|
|
//interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-out-space", "true");
|
|
interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStructaction_B;action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_single_101) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-in-space", "true");
|
|
interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
//interface.properties.set("brace-struct-single-out-space", "true");
|
|
interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\taction_B;\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_single_011) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
//interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
interface.properties.set("brace-struct-single-in-space", "true");
|
|
//interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
interface.properties.set("brace-struct-single-out-space", "true");
|
|
interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct action_B; action_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
TEST(testStruct, brace_single_111) {
|
|
estyle::Generator interface;
|
|
//interface.properties.set("brace-struct-one-line-size-max", "40");
|
|
interface.properties.set("brace-struct-single", "true");
|
|
interface.properties.set("brace-struct-single-in-new-line", "true");
|
|
interface.properties.set("brace-struct-single-in-space", "true");
|
|
interface.properties.set("brace-struct-single-out-new-line", "true");
|
|
interface.properties.set("brace-struct-single-out-space", "true");
|
|
interface.properties.set("brace-struct-single-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\taction_B;\naction_D;";
|
|
etk::String output = interface.process(sourceBrace1Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
TEST(testStruct, brace_empty_000) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// empty
|
|
//interface.properties.set("brace-struct-one-line-size-max", "0");
|
|
//interface.properties.set("brace-empty-space", "true");
|
|
//interface.properties.set("brace-empty-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_empty_100) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("brace-struct-one-line-size-max", "0");
|
|
//interface.properties.set("brace-struct-empty-space", "true");
|
|
//interface.properties.set("brace-struct-empty-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct {}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_empty_110) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("brace-struct-one-line-size-max", "0");
|
|
interface.properties.set("brace-struct-empty-space", "true");
|
|
//interface.properties.set("brace-struct-empty-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct { }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_empty_111) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// empty
|
|
interface.properties.set("brace-struct-one-line-size-max", "0");
|
|
interface.properties.set("brace-struct-empty-space", "true");
|
|
interface.properties.set("brace-struct-empty-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct { }\naction_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|
|
|
|
TEST(testStruct, brace_empty_001) {
|
|
estyle::Generator interface;
|
|
// in out for specific empty change:
|
|
interface.properties.set("brace-struct-in-new-line-before", "true");
|
|
interface.properties.set("brace-struct-in-new-line-after", "true");
|
|
interface.properties.set("brace-struct-in-space-before", "true");
|
|
interface.properties.set("brace-struct-in-space-after", "true");
|
|
interface.properties.set("brace-struct-in-indent-before", "true");
|
|
interface.properties.set("brace-struct-in-indent-after", "true");
|
|
// out:
|
|
interface.properties.set("brace-struct-out-new-line-before", "true");
|
|
interface.properties.set("brace-struct-out-new-line-after", "true");
|
|
interface.properties.set("brace-struct-out-space-before", "true");
|
|
interface.properties.set("brace-struct-out-space-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-after", "true");
|
|
interface.properties.set("brace-struct-out-unindent-before", "true");
|
|
// empty
|
|
//interface.properties.set("brace-struct-one-line-size-max", "0");
|
|
//interface.properties.set("brace-struct-empty-space", "true");
|
|
interface.properties.set("brace-struct-empty-indent", "true");
|
|
etk::String outRef = "action_A;struct MyStruct\n\t{\n\t\t\n\t}\naction_D;";
|
|
etk::String output = interface.process(sourceBrace0Action);
|
|
EXPECT_EQ(output, outRef);
|
|
}
|