mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Style: Mark clang-format 16 as supported for pre-commit hook
It only introduced a difference in a .glsl file, which I've worked around by removing an empty line. This keeps formatting consistent between clang-format 15 and 16. Also added a change in the 3-to-4 project converter to fix bogus formatting in clang-format < 17.
This commit is contained in:
parent
2f73a059ce
commit
49f4860ce3
4 changed files with 100 additions and 100 deletions
|
|
@ -1044,107 +1044,108 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_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);
|
||||
}
|
||||
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()));
|
||||
{
|
||||
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);
|
||||
}
|
||||
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()));
|
||||
{
|
||||
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);
|
||||
}
|
||||
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()));
|
||||
{
|
||||
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);
|
||||
}
|
||||
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;
|
||||
// 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;
|
||||
}
|
||||
|
||||
// Validate in all arrays if names don't do cyclic renames "Node" -> "Node2D" | "Node2D" -> "2DNode"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue