From 1e61e422509f0991a24fc4bb4ed4563e627e5ea8 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Sat, 2 Mar 2024 19:49:32 +0100 Subject: [GDScript] Fix some test file paths --- .../parser/errors/dollar-assignment-bug-53696.gd | 2 - .../parser/errors/dollar-assignment-bug-53696.out | 2 - .../parser/errors/dollar_assignment_bug_53696.gd | 2 + .../parser/errors/dollar_assignment_bug_53696.out | 2 + .../features/compare-builtin-equals-null.gd | 142 --------------------- .../features/compare-builtin-equals-null.out | 36 ------ .../features/compare-builtin-not-equals-null.gd | 142 --------------------- .../features/compare-builtin-not-equals-null.out | 36 ------ .../features/compare-null-equals-builtin.gd | 138 -------------------- .../features/compare-null-equals-builtin.out | 35 ----- .../features/compare-null-not-equals-builtin.gd | 138 -------------------- .../features/compare-null-not-equals-builtin.out | 35 ----- .../features/compare_builtin_equals_null.gd | 142 +++++++++++++++++++++ .../features/compare_builtin_equals_null.out | 36 ++++++ .../features/compare_builtin_not_equals_null.gd | 142 +++++++++++++++++++++ .../features/compare_builtin_not_equals_null.out | 36 ++++++ .../features/compare_null_equals_builtin.gd | 138 ++++++++++++++++++++ .../features/compare_null_equals_builtin.out | 35 +++++ .../features/compare_null_not_equals_builtin.gd | 138 ++++++++++++++++++++ .../features/compare_null_not_equals_builtin.out | 35 +++++ .../features/reset_local_var_on exit_block.gd | 10 -- .../features/reset_local_var_on exit_block.out | 3 - .../features/reset_local_var_on_exit_block.gd | 10 ++ .../features/reset_local_var_on_exit_block.out | 3 + .../standalone-calls-do-not-write-to-nil.gd | 46 ------- .../standalone-calls-do-not-write-to-nil.out | 2 - .../standalone_calls_do_not_write_to_nil.gd | 46 +++++++ .../standalone_calls_do_not_write_to_nil.out | 2 + 28 files changed, 767 insertions(+), 767 deletions(-) delete mode 100644 modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.gd delete mode 100644 modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.out delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.out delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.out delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.out delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.out delete mode 100644 modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.out delete mode 100644 modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.gd delete mode 100644 modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.out create mode 100644 modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.out (limited to 'modules/gdscript/tests/scripts') diff --git a/modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.gd b/modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.gd deleted file mode 100644 index e9690ee93d..0000000000 --- a/modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.gd +++ /dev/null @@ -1,2 +0,0 @@ -func test(): - $=$ diff --git a/modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.out b/modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.out deleted file mode 100644 index 9fafcb5a64..0000000000 --- a/modules/gdscript/tests/scripts/parser/errors/dollar-assignment-bug-53696.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Expected node path as string or identifier after "$". diff --git a/modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.gd b/modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.gd new file mode 100644 index 0000000000..e9690ee93d --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.gd @@ -0,0 +1,2 @@ +func test(): + $=$ diff --git a/modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.out b/modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.out new file mode 100644 index 0000000000..9fafcb5a64 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/dollar_assignment_bug_53696.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Expected node path as string or identifier after "$". diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.gd b/modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.gd deleted file mode 100644 index 809d0d28a9..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.gd +++ /dev/null @@ -1,142 +0,0 @@ -func test(): - var value - - # null - value = null - print(value == null) - - # bool - value = false - print(value == null) - - # int - value = 0 - print(value == null) - - # float - value = 0.0 - print(value == null) - - # String - value = "" - print(value == null) - - # Vector2 - value = Vector2() - print(value == null) - - # Vector2i - value = Vector2i() - print(value == null) - - # Rect2 - value = Rect2() - print(value == null) - - # Rect2i - value = Rect2i() - print(value == null) - - # Vector3 - value = Vector3() - print(value == null) - - # Vector3i - value = Vector3i() - print(value == null) - - # Transform2D - value = Transform2D() - print(value == null) - - # Plane - value = Plane() - print(value == null) - - # Quaternion - value = Quaternion() - print(value == null) - - # AABB - value = AABB() - print(value == null) - - # Basis - value = Basis() - print(value == null) - - # Transform3D - value = Transform3D() - print(value == null) - - # Projection - value = Projection() - print(value == null) - - # Color - value = Color() - print(value == null) - - # StringName - value = &"" - print(value == null) - - # NodePath - value = ^"" - print(value == null) - - # RID - value = RID() - print(value == null) - - # Callable - value = Callable() - print(value == null) - - # Signal - value = Signal() - print(value == null) - - # Dictionary - value = {} - print(value == null) - - # Array - value = [] - print(value == null) - - # PackedByteArray - value = PackedByteArray() - print(value == null) - - # PackedInt32Array - value = PackedInt32Array() - print(value == null) - - # PackedInt64Array - value = PackedInt64Array() - print(value == null) - - # PackedFloat32Array - value = PackedFloat32Array() - print(value == null) - - # PackedFloat64Array - value = PackedFloat64Array() - print(value == null) - - # PackedStringArray - value = PackedStringArray() - print(value == null) - - # PackedVector2Array - value = PackedVector2Array() - print(value == null) - - # PackedVector3Array - value = PackedVector3Array() - print(value == null) - - # PackedColorArray - value = PackedColorArray() - print(value == null) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.out b/modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.out deleted file mode 100644 index 27423ab8e7..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-equals-null.out +++ /dev/null @@ -1,36 +0,0 @@ -GDTEST_OK -true -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.gd b/modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.gd deleted file mode 100644 index f46afb0f18..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.gd +++ /dev/null @@ -1,142 +0,0 @@ -func test(): - var value - - # null - value = null - print(value != null) - - # bool - value = false - print(value != null) - - # int - value = 0 - print(value != null) - - # float - value = 0.0 - print(value != null) - - # String - value = "" - print(value != null) - - # Vector2 - value = Vector2() - print(value != null) - - # Vector2i - value = Vector2i() - print(value != null) - - # Rect2 - value = Rect2() - print(value != null) - - # Rect2i - value = Rect2i() - print(value != null) - - # Vector3 - value = Vector3() - print(value != null) - - # Vector3i - value = Vector3i() - print(value != null) - - # Transform2D - value = Transform2D() - print(value != null) - - # Plane - value = Plane() - print(value != null) - - # Quaternion - value = Quaternion() - print(value != null) - - # AABB - value = AABB() - print(value != null) - - # Basis - value = Basis() - print(value != null) - - # Transform3D - value = Transform3D() - print(value != null) - - # Projection - value = Projection() - print(value != null) - - # Color - value = Color() - print(value != null) - - # StringName - value = &"" - print(value != null) - - # NodePath - value = ^"" - print(value != null) - - # RID - value = RID() - print(value != null) - - # Callable - value = Callable() - print(value != null) - - # Signal - value = Signal() - print(value != null) - - # Dictionary - value = {} - print(value != null) - - # Array - value = [] - print(value != null) - - # PackedByteArray - value = PackedByteArray() - print(value != null) - - # PackedInt32Array - value = PackedInt32Array() - print(value != null) - - # PackedInt64Array - value = PackedInt64Array() - print(value != null) - - # PackedFloat32Array - value = PackedFloat32Array() - print(value != null) - - # PackedFloat64Array - value = PackedFloat64Array() - print(value != null) - - # PackedStringArray - value = PackedStringArray() - print(value != null) - - # PackedVector2Array - value = PackedVector2Array() - print(value != null) - - # PackedVector3Array - value = PackedVector3Array() - print(value != null) - - # PackedColorArray - value = PackedColorArray() - print(value != null) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.out b/modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.out deleted file mode 100644 index a11c47854a..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-builtin-not-equals-null.out +++ /dev/null @@ -1,36 +0,0 @@ -GDTEST_OK -false -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.gd b/modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.gd deleted file mode 100644 index 7649062fda..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.gd +++ /dev/null @@ -1,138 +0,0 @@ -func test(): - var value - - # null - value = null - print(null == value) - - # bool - value = false - print(null == value) - - # int - value = 0 - print(null == value) - - # float - value = 0.0 - print(null == value) - - # String - value = "" - print(null == value) - - # Vector2 - value = Vector2() - print(null == value) - - # Vector2i - value = Vector2i() - print(null == value) - - # Rect2 - value = Rect2() - print(null == value) - - # Rect2i - value = Rect2i() - print(null == value) - - # Vector3 - value = Vector3() - print(null == value) - - # Vector3i - value = Vector3i() - print(null == value) - - # Transform2D - value = Transform2D() - print(null == value) - - # Plane - value = Plane() - print(null == value) - - # Quaternion - value = Quaternion() - print(null == value) - - # AABB - value = AABB() - print(null == value) - - # Basis - value = Basis() - print(null == value) - - # Transform3D - value = Transform3D() - print(null == value) - - # Color - value = Color() - print(null == value) - - # StringName - value = &"" - print(null == value) - - # NodePath - value = ^"" - print(null == value) - - # RID - value = RID() - print(null == value) - - # Callable - value = Callable() - print(null == value) - - # Signal - value = Signal() - print(null == value) - - # Dictionary - value = {} - print(null == value) - - # Array - value = [] - print(null == value) - - # PackedByteArray - value = PackedByteArray() - print(null == value) - - # PackedInt32Array - value = PackedInt32Array() - print(null == value) - - # PackedInt64Array - value = PackedInt64Array() - print(null == value) - - # PackedFloat32Array - value = PackedFloat32Array() - print(null == value) - - # PackedFloat64Array - value = PackedFloat64Array() - print(null == value) - - # PackedStringArray - value = PackedStringArray() - print(null == value) - - # PackedVector2Array - value = PackedVector2Array() - print(null == value) - - # PackedVector3Array - value = PackedVector3Array() - print(null == value) - - # PackedColorArray - value = PackedColorArray() - print(null == value) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.out b/modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.out deleted file mode 100644 index 639f6027b9..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-null-equals-builtin.out +++ /dev/null @@ -1,35 +0,0 @@ -GDTEST_OK -true -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false -false diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.gd b/modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.gd deleted file mode 100644 index 8d5f9df1b8..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.gd +++ /dev/null @@ -1,138 +0,0 @@ -func test(): - var value - - # null - value = null - print(null != value) - - # bool - value = false - print(null != value) - - # int - value = 0 - print(null != value) - - # float - value = 0.0 - print(null != value) - - # String - value = "" - print(null != value) - - # Vector2 - value = Vector2() - print(null != value) - - # Vector2i - value = Vector2i() - print(null != value) - - # Rect2 - value = Rect2() - print(null != value) - - # Rect2i - value = Rect2i() - print(null != value) - - # Vector3 - value = Vector3() - print(null != value) - - # Vector3i - value = Vector3i() - print(null != value) - - # Transform2D - value = Transform2D() - print(null != value) - - # Plane - value = Plane() - print(null != value) - - # Quaternion - value = Quaternion() - print(null != value) - - # AABB - value = AABB() - print(null != value) - - # Basis - value = Basis() - print(null != value) - - # Transform3D - value = Transform3D() - print(null != value) - - # Color - value = Color() - print(null != value) - - # StringName - value = &"" - print(null != value) - - # NodePath - value = ^"" - print(null != value) - - # RID - value = RID() - print(null != value) - - # Callable - value = Callable() - print(null != value) - - # Signal - value = Signal() - print(null != value) - - # Dictionary - value = {} - print(null != value) - - # Array - value = [] - print(null != value) - - # PackedByteArray - value = PackedByteArray() - print(null != value) - - # PackedInt32Array - value = PackedInt32Array() - print(null != value) - - # PackedInt64Array - value = PackedInt64Array() - print(null != value) - - # PackedFloat32Array - value = PackedFloat32Array() - print(null != value) - - # PackedFloat64Array - value = PackedFloat64Array() - print(null != value) - - # PackedStringArray - value = PackedStringArray() - print(null != value) - - # PackedVector2Array - value = PackedVector2Array() - print(null != value) - - # PackedVector3Array - value = PackedVector3Array() - print(null != value) - - # PackedColorArray - value = PackedColorArray() - print(null != value) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.out b/modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.out deleted file mode 100644 index d1e332afba..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/compare-null-not-equals-builtin.out +++ /dev/null @@ -1,35 +0,0 @@ -GDTEST_OK -false -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true -true diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.gd b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.gd new file mode 100644 index 0000000000..809d0d28a9 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.gd @@ -0,0 +1,142 @@ +func test(): + var value + + # null + value = null + print(value == null) + + # bool + value = false + print(value == null) + + # int + value = 0 + print(value == null) + + # float + value = 0.0 + print(value == null) + + # String + value = "" + print(value == null) + + # Vector2 + value = Vector2() + print(value == null) + + # Vector2i + value = Vector2i() + print(value == null) + + # Rect2 + value = Rect2() + print(value == null) + + # Rect2i + value = Rect2i() + print(value == null) + + # Vector3 + value = Vector3() + print(value == null) + + # Vector3i + value = Vector3i() + print(value == null) + + # Transform2D + value = Transform2D() + print(value == null) + + # Plane + value = Plane() + print(value == null) + + # Quaternion + value = Quaternion() + print(value == null) + + # AABB + value = AABB() + print(value == null) + + # Basis + value = Basis() + print(value == null) + + # Transform3D + value = Transform3D() + print(value == null) + + # Projection + value = Projection() + print(value == null) + + # Color + value = Color() + print(value == null) + + # StringName + value = &"" + print(value == null) + + # NodePath + value = ^"" + print(value == null) + + # RID + value = RID() + print(value == null) + + # Callable + value = Callable() + print(value == null) + + # Signal + value = Signal() + print(value == null) + + # Dictionary + value = {} + print(value == null) + + # Array + value = [] + print(value == null) + + # PackedByteArray + value = PackedByteArray() + print(value == null) + + # PackedInt32Array + value = PackedInt32Array() + print(value == null) + + # PackedInt64Array + value = PackedInt64Array() + print(value == null) + + # PackedFloat32Array + value = PackedFloat32Array() + print(value == null) + + # PackedFloat64Array + value = PackedFloat64Array() + print(value == null) + + # PackedStringArray + value = PackedStringArray() + print(value == null) + + # PackedVector2Array + value = PackedVector2Array() + print(value == null) + + # PackedVector3Array + value = PackedVector3Array() + print(value == null) + + # PackedColorArray + value = PackedColorArray() + print(value == null) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.out b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.out new file mode 100644 index 0000000000..27423ab8e7 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_equals_null.out @@ -0,0 +1,36 @@ +GDTEST_OK +true +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.gd b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.gd new file mode 100644 index 0000000000..f46afb0f18 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.gd @@ -0,0 +1,142 @@ +func test(): + var value + + # null + value = null + print(value != null) + + # bool + value = false + print(value != null) + + # int + value = 0 + print(value != null) + + # float + value = 0.0 + print(value != null) + + # String + value = "" + print(value != null) + + # Vector2 + value = Vector2() + print(value != null) + + # Vector2i + value = Vector2i() + print(value != null) + + # Rect2 + value = Rect2() + print(value != null) + + # Rect2i + value = Rect2i() + print(value != null) + + # Vector3 + value = Vector3() + print(value != null) + + # Vector3i + value = Vector3i() + print(value != null) + + # Transform2D + value = Transform2D() + print(value != null) + + # Plane + value = Plane() + print(value != null) + + # Quaternion + value = Quaternion() + print(value != null) + + # AABB + value = AABB() + print(value != null) + + # Basis + value = Basis() + print(value != null) + + # Transform3D + value = Transform3D() + print(value != null) + + # Projection + value = Projection() + print(value != null) + + # Color + value = Color() + print(value != null) + + # StringName + value = &"" + print(value != null) + + # NodePath + value = ^"" + print(value != null) + + # RID + value = RID() + print(value != null) + + # Callable + value = Callable() + print(value != null) + + # Signal + value = Signal() + print(value != null) + + # Dictionary + value = {} + print(value != null) + + # Array + value = [] + print(value != null) + + # PackedByteArray + value = PackedByteArray() + print(value != null) + + # PackedInt32Array + value = PackedInt32Array() + print(value != null) + + # PackedInt64Array + value = PackedInt64Array() + print(value != null) + + # PackedFloat32Array + value = PackedFloat32Array() + print(value != null) + + # PackedFloat64Array + value = PackedFloat64Array() + print(value != null) + + # PackedStringArray + value = PackedStringArray() + print(value != null) + + # PackedVector2Array + value = PackedVector2Array() + print(value != null) + + # PackedVector3Array + value = PackedVector3Array() + print(value != null) + + # PackedColorArray + value = PackedColorArray() + print(value != null) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.out b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.out new file mode 100644 index 0000000000..a11c47854a --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_builtin_not_equals_null.out @@ -0,0 +1,36 @@ +GDTEST_OK +false +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.gd b/modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.gd new file mode 100644 index 0000000000..7649062fda --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.gd @@ -0,0 +1,138 @@ +func test(): + var value + + # null + value = null + print(null == value) + + # bool + value = false + print(null == value) + + # int + value = 0 + print(null == value) + + # float + value = 0.0 + print(null == value) + + # String + value = "" + print(null == value) + + # Vector2 + value = Vector2() + print(null == value) + + # Vector2i + value = Vector2i() + print(null == value) + + # Rect2 + value = Rect2() + print(null == value) + + # Rect2i + value = Rect2i() + print(null == value) + + # Vector3 + value = Vector3() + print(null == value) + + # Vector3i + value = Vector3i() + print(null == value) + + # Transform2D + value = Transform2D() + print(null == value) + + # Plane + value = Plane() + print(null == value) + + # Quaternion + value = Quaternion() + print(null == value) + + # AABB + value = AABB() + print(null == value) + + # Basis + value = Basis() + print(null == value) + + # Transform3D + value = Transform3D() + print(null == value) + + # Color + value = Color() + print(null == value) + + # StringName + value = &"" + print(null == value) + + # NodePath + value = ^"" + print(null == value) + + # RID + value = RID() + print(null == value) + + # Callable + value = Callable() + print(null == value) + + # Signal + value = Signal() + print(null == value) + + # Dictionary + value = {} + print(null == value) + + # Array + value = [] + print(null == value) + + # PackedByteArray + value = PackedByteArray() + print(null == value) + + # PackedInt32Array + value = PackedInt32Array() + print(null == value) + + # PackedInt64Array + value = PackedInt64Array() + print(null == value) + + # PackedFloat32Array + value = PackedFloat32Array() + print(null == value) + + # PackedFloat64Array + value = PackedFloat64Array() + print(null == value) + + # PackedStringArray + value = PackedStringArray() + print(null == value) + + # PackedVector2Array + value = PackedVector2Array() + print(null == value) + + # PackedVector3Array + value = PackedVector3Array() + print(null == value) + + # PackedColorArray + value = PackedColorArray() + print(null == value) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.out b/modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.out new file mode 100644 index 0000000000..639f6027b9 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_null_equals_builtin.out @@ -0,0 +1,35 @@ +GDTEST_OK +true +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false +false diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.gd b/modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.gd new file mode 100644 index 0000000000..8d5f9df1b8 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.gd @@ -0,0 +1,138 @@ +func test(): + var value + + # null + value = null + print(null != value) + + # bool + value = false + print(null != value) + + # int + value = 0 + print(null != value) + + # float + value = 0.0 + print(null != value) + + # String + value = "" + print(null != value) + + # Vector2 + value = Vector2() + print(null != value) + + # Vector2i + value = Vector2i() + print(null != value) + + # Rect2 + value = Rect2() + print(null != value) + + # Rect2i + value = Rect2i() + print(null != value) + + # Vector3 + value = Vector3() + print(null != value) + + # Vector3i + value = Vector3i() + print(null != value) + + # Transform2D + value = Transform2D() + print(null != value) + + # Plane + value = Plane() + print(null != value) + + # Quaternion + value = Quaternion() + print(null != value) + + # AABB + value = AABB() + print(null != value) + + # Basis + value = Basis() + print(null != value) + + # Transform3D + value = Transform3D() + print(null != value) + + # Color + value = Color() + print(null != value) + + # StringName + value = &"" + print(null != value) + + # NodePath + value = ^"" + print(null != value) + + # RID + value = RID() + print(null != value) + + # Callable + value = Callable() + print(null != value) + + # Signal + value = Signal() + print(null != value) + + # Dictionary + value = {} + print(null != value) + + # Array + value = [] + print(null != value) + + # PackedByteArray + value = PackedByteArray() + print(null != value) + + # PackedInt32Array + value = PackedInt32Array() + print(null != value) + + # PackedInt64Array + value = PackedInt64Array() + print(null != value) + + # PackedFloat32Array + value = PackedFloat32Array() + print(null != value) + + # PackedFloat64Array + value = PackedFloat64Array() + print(null != value) + + # PackedStringArray + value = PackedStringArray() + print(null != value) + + # PackedVector2Array + value = PackedVector2Array() + print(null != value) + + # PackedVector3Array + value = PackedVector3Array() + print(null != value) + + # PackedColorArray + value = PackedColorArray() + print(null != value) diff --git a/modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.out b/modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.out new file mode 100644 index 0000000000..d1e332afba --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/compare_null_not_equals_builtin.out @@ -0,0 +1,35 @@ +GDTEST_OK +false +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true +true diff --git a/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.gd b/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.gd deleted file mode 100644 index c774ebf83c..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.gd +++ /dev/null @@ -1,10 +0,0 @@ -# GH-77666 - -func test(): - var ref := RefCounted.new() - print(ref.get_reference_count()) - - if true: - var _temp := ref - - print(ref.get_reference_count()) diff --git a/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.out b/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.out deleted file mode 100644 index 04b4638adf..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on exit_block.out +++ /dev/null @@ -1,3 +0,0 @@ -GDTEST_OK -1 -1 diff --git a/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.gd b/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.gd new file mode 100644 index 0000000000..c774ebf83c --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.gd @@ -0,0 +1,10 @@ +# GH-77666 + +func test(): + var ref := RefCounted.new() + print(ref.get_reference_count()) + + if true: + var _temp := ref + + print(ref.get_reference_count()) diff --git a/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.out b/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.out new file mode 100644 index 0000000000..04b4638adf --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/reset_local_var_on_exit_block.out @@ -0,0 +1,3 @@ +GDTEST_OK +1 +1 diff --git a/modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.gd b/modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.gd deleted file mode 100644 index 691b611574..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.gd +++ /dev/null @@ -1,46 +0,0 @@ -# https://github.com/godotengine/godot/issues/70964 - -func test(): - test_construct(0, false) - test_utility(0, false) - test_builtin_call(Vector2.UP, false) - test_builtin_call_validated(Vector2.UP, false) - test_object_call(RefCounted.new(), false) - test_object_call_method_bind(Resource.new(), false) - test_object_call_method_bind_validated(RefCounted.new(), false) - - print("end") - -func test_construct(v, f): - @warning_ignore("unsafe_call_argument") - Vector2(v, v) # Built-in type construct. - assert(not f) # Test unary operator reading from `nil`. - -func test_utility(v, f): - abs(v) # Utility function. - assert(not f) # Test unary operator reading from `nil`. - -func test_builtin_call(v, f): - @warning_ignore("unsafe_method_access") - v.angle() # Built-in method call. - assert(not f) # Test unary operator reading from `nil`. - -func test_builtin_call_validated(v: Vector2, f): - @warning_ignore("return_value_discarded") - v.abs() # Built-in method call validated. - assert(not f) # Test unary operator reading from `nil`. - -func test_object_call(v, f): - @warning_ignore("unsafe_method_access") - v.get_reference_count() # Native type method call. - assert(not f) # Test unary operator reading from `nil`. - -func test_object_call_method_bind(v: Resource, f): - @warning_ignore("return_value_discarded") - v.duplicate() # Native type method call with MethodBind. - assert(not f) # Test unary operator reading from `nil`. - -func test_object_call_method_bind_validated(v: RefCounted, f): - @warning_ignore("return_value_discarded") - v.get_reference_count() # Native type method call with validated MethodBind. - assert(not f) # Test unary operator reading from `nil`. diff --git a/modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.out b/modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.out deleted file mode 100644 index 5bc3dcf2db..0000000000 --- a/modules/gdscript/tests/scripts/runtime/features/standalone-calls-do-not-write-to-nil.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_OK -end diff --git a/modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.gd b/modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.gd new file mode 100644 index 0000000000..691b611574 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.gd @@ -0,0 +1,46 @@ +# https://github.com/godotengine/godot/issues/70964 + +func test(): + test_construct(0, false) + test_utility(0, false) + test_builtin_call(Vector2.UP, false) + test_builtin_call_validated(Vector2.UP, false) + test_object_call(RefCounted.new(), false) + test_object_call_method_bind(Resource.new(), false) + test_object_call_method_bind_validated(RefCounted.new(), false) + + print("end") + +func test_construct(v, f): + @warning_ignore("unsafe_call_argument") + Vector2(v, v) # Built-in type construct. + assert(not f) # Test unary operator reading from `nil`. + +func test_utility(v, f): + abs(v) # Utility function. + assert(not f) # Test unary operator reading from `nil`. + +func test_builtin_call(v, f): + @warning_ignore("unsafe_method_access") + v.angle() # Built-in method call. + assert(not f) # Test unary operator reading from `nil`. + +func test_builtin_call_validated(v: Vector2, f): + @warning_ignore("return_value_discarded") + v.abs() # Built-in method call validated. + assert(not f) # Test unary operator reading from `nil`. + +func test_object_call(v, f): + @warning_ignore("unsafe_method_access") + v.get_reference_count() # Native type method call. + assert(not f) # Test unary operator reading from `nil`. + +func test_object_call_method_bind(v: Resource, f): + @warning_ignore("return_value_discarded") + v.duplicate() # Native type method call with MethodBind. + assert(not f) # Test unary operator reading from `nil`. + +func test_object_call_method_bind_validated(v: RefCounted, f): + @warning_ignore("return_value_discarded") + v.get_reference_count() # Native type method call with validated MethodBind. + assert(not f) # Test unary operator reading from `nil`. diff --git a/modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.out b/modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.out new file mode 100644 index 0000000000..5bc3dcf2db --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.out @@ -0,0 +1,2 @@ +GDTEST_OK +end -- cgit v1.2.3