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