summaryrefslogtreecommitdiffstats
path: root/editor/project_converter_3_to_4.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-01-05 12:04:44 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-01-05 12:04:44 +0100
commite72e63a6b5474d2109755ea1c32b37ff2fdcc6bf (patch)
treee05d8a0bf5f904c72f9f811d1248150e02986382 /editor/project_converter_3_to_4.cpp
parent1e676e4a0a83765e0773071799a4e22cf46f7f11 (diff)
parent49f4860ce3e4122e17c869229701f7d86aa6956c (diff)
downloadredot-engine-e72e63a6b5474d2109755ea1c32b37ff2fdcc6bf.tar.gz
Merge pull request #85837 from akien-mga/clang-format-16
Style: Mark clang-format 16 as supported for pre-commit hook
Diffstat (limited to 'editor/project_converter_3_to_4.cpp')
-rw-r--r--editor/project_converter_3_to_4.cpp199
1 files changed, 100 insertions, 99 deletions
diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp
index 634e6be7ae..2b0f61c1b0 100644
--- a/editor/project_converter_3_to_4.cpp
+++ b/editor/project_converter_3_to_4.cpp
@@ -1045,107 +1045,108 @@ bool ProjectConverter3To4::test_conversion(RegExContainer &reg_container) {
// get_object_of_execution
{
- { String base = "var roman = kieliszek.";
- String expected = "kieliszek.";
- String got = get_object_of_execution(base);
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
+ String base = "var roman = kieliszek.";
+ String expected = "kieliszek.";
+ String got = get_object_of_execution(base);
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+ {
+ String base = "r.";
+ String expected = "r.";
+ String got = get_object_of_execution(base);
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+ {
+ String base = "mortadela(";
+ String expected = "";
+ String got = get_object_of_execution(base);
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+ {
+ String base = "var node = $world/ukraine/lviv.";
+ String expected = "$world/ukraine/lviv.";
+ String got = get_object_of_execution(base);
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+
+ // get_starting_space
+ {
+ String base = "\t\t\t var roman = kieliszek.";
+ String expected = "\t\t\t";
+ String got = get_starting_space(base);
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
}
- valid = valid && (got == expected);
-}
-{
- String base = "r.";
- String expected = "r.";
- String got = get_object_of_execution(base);
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-{
- String base = "mortadela(";
- String expected = "";
- String got = get_object_of_execution(base);
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-{
- String base = "var node = $world/ukraine/lviv.";
- String expected = "$world/ukraine/lviv.";
- String got = get_object_of_execution(base);
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-}
-// get_starting_space
-{
- String base = "\t\t\t var roman = kieliszek.";
- String expected = "\t\t\t";
- String got = get_starting_space(base);
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-// Parse Arguments
-{
- String line = "( )";
- Vector<String> got_vector = parse_arguments(line);
- String got = "";
- String expected = "";
- for (String &part : got_vector) {
- got += part + "|||";
- }
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-{
- String line = "(a , b , c)";
- Vector<String> got_vector = parse_arguments(line);
- String got = "";
- String expected = "a|||b|||c|||";
- for (String &part : got_vector) {
- got += part + "|||";
- }
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-{
- String line = "(a , \"b,\" , c)";
- Vector<String> got_vector = parse_arguments(line);
- String got = "";
- String expected = "a|||\"b,\"|||c|||";
- for (String &part : got_vector) {
- got += part + "|||";
- }
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-{
- String line = "(a , \"(,),,,,\" , c)";
- Vector<String> got_vector = parse_arguments(line);
- String got = "";
- String expected = "a|||\"(,),,,,\"|||c|||";
- for (String &part : got_vector) {
- got += part + "|||";
- }
- if (got != expected) {
- ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
- }
- valid = valid && (got == expected);
-}
-return valid;
+ // Parse Arguments
+ {
+ String line = "( )";
+ Vector<String> got_vector = parse_arguments(line);
+ String got = "";
+ String expected = "";
+ for (String &part : got_vector) {
+ got += part + "|||";
+ }
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+ {
+ String line = "(a , b , c)";
+ Vector<String> got_vector = parse_arguments(line);
+ String got = "";
+ String expected = "a|||b|||c|||";
+ for (String &part : got_vector) {
+ got += part + "|||";
+ }
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+ {
+ String line = "(a , \"b,\" , c)";
+ Vector<String> got_vector = parse_arguments(line);
+ String got = "";
+ String expected = "a|||\"b,\"|||c|||";
+ for (String &part : got_vector) {
+ got += part + "|||";
+ }
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+ {
+ String line = "(a , \"(,),,,,\" , c)";
+ Vector<String> got_vector = parse_arguments(line);
+ String got = "";
+ String expected = "a|||\"(,),,,,\"|||c|||";
+ for (String &part : got_vector) {
+ got += part + "|||";
+ }
+ if (got != expected) {
+ ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size()));
+ }
+ valid = valid && (got == expected);
+ }
+
+ return valid;
}
// Validate in all arrays if names don't do cyclic renames "Node" -> "Node2D" | "Node2D" -> "2DNode"