summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/assymetric_assignment_good.gd9
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/const_conversions.gd25
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/enums_in_range_call.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd2
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_extra_parameters.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/return_conversions.gd24
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/ternary_hard_infer.gd4
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/type_test_usage.gd193
-rw-r--r--modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd159
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.gd7
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.notest.gd1
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.out9
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.gd9
-rw-r--r--modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.out1
-rw-r--r--modules/gdscript/tests/scripts/completion/index/array_type.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/index/array_type.gd10
-rw-r--r--modules/gdscript/tests/scripts/completion/index/array_value.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/index/array_value.gd10
-rw-r--r--modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.cfg11
-rw-r--r--modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.gd13
-rw-r--r--modules/gdscript/tests/scripts/completion/index/dictionary_type.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/index/dictionary_type.gd10
-rw-r--r--modules/gdscript/tests/scripts/completion/index/dictionary_value.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/index/dictionary_value.gd10
-rw-r--r--modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.cfg11
-rw-r--r--modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.gd13
-rw-r--r--modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.gd13
-rw-r--r--modules/gdscript/tests/scripts/completion/index/untyped_local.cfg5
-rw-r--r--modules/gdscript/tests/scripts/completion/index/untyped_local.gd10
-rw-r--r--modules/gdscript/tests/scripts/completion/index/untyped_property.cfg5
-rw-r--r--modules/gdscript/tests/scripts/completion/index/untyped_property.gd9
-rw-r--r--modules/gdscript/tests/scripts/parser/features/annotations.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/class.gd4
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_arrays.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_enum.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/export_variable.gd1
-rw-r--r--modules/gdscript/tests/scripts/parser/features/good_continue_in_lambda.gd2
-rw-r--r--modules/gdscript/tests/scripts/parser/features/truthiness.gd40
-rw-r--r--modules/gdscript/tests/scripts/parser/features/truthiness.out65
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/array_string_stringname_equivalent.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd9
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd4
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd14
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/match_with_pattern_guards.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/member_info.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/member_info_inheritance.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/metatypes.gd1
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.gd4
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/single_underscore_node_name.gd2
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/standalone_calls_do_not_write_to_nil.gd14
-rw-r--r--modules/gdscript/tests/scripts/runtime/features/typed_array_init_with_untyped_in_literal.gd4
-rw-r--r--modules/gdscript/tests/scripts/utils.notest.gd18
55 files changed, 477 insertions, 347 deletions
diff --git a/modules/gdscript/tests/scripts/analyzer/features/assymetric_assignment_good.gd b/modules/gdscript/tests/scripts/analyzer/features/assymetric_assignment_good.gd
index efd8ad6edb..60bcde4b8c 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/assymetric_assignment_good.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/assymetric_assignment_good.gd
@@ -3,14 +3,13 @@ const const_color: Color = 'red'
func func_color(arg_color: Color = 'blue') -> bool:
return arg_color == Color.BLUE
-@warning_ignore("assert_always_true")
func test():
- assert(const_color == Color.RED)
+ Utils.check(const_color == Color.RED)
- assert(func_color() == true)
- assert(func_color('blue') == true)
+ Utils.check(func_color() == true)
+ Utils.check(func_color('blue') == true)
var var_color: Color = 'green'
- assert(var_color == Color.GREEN)
+ Utils.check(var_color == Color.GREEN)
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/const_conversions.gd b/modules/gdscript/tests/scripts/analyzer/features/const_conversions.gd
index bed9dd0e96..5318d11f33 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/const_conversions.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/const_conversions.gd
@@ -5,20 +5,19 @@ const const_float_cast: float = 76 as float
const const_packed_empty: PackedFloat64Array = []
const const_packed_ints: PackedFloat64Array = [52]
-@warning_ignore("assert_always_true")
func test():
- assert(typeof(const_float_int) == TYPE_FLOAT)
- assert(str(const_float_int) == '19')
- assert(typeof(const_float_plus) == TYPE_FLOAT)
- assert(str(const_float_plus) == '34')
- assert(typeof(const_float_cast) == TYPE_FLOAT)
- assert(str(const_float_cast) == '76')
+ Utils.check(typeof(const_float_int) == TYPE_FLOAT)
+ Utils.check(str(const_float_int) == '19')
+ Utils.check(typeof(const_float_plus) == TYPE_FLOAT)
+ Utils.check(str(const_float_plus) == '34')
+ Utils.check(typeof(const_float_cast) == TYPE_FLOAT)
+ Utils.check(str(const_float_cast) == '76')
- assert(typeof(const_packed_empty) == TYPE_PACKED_FLOAT64_ARRAY)
- assert(str(const_packed_empty) == '[]')
- assert(typeof(const_packed_ints) == TYPE_PACKED_FLOAT64_ARRAY)
- assert(str(const_packed_ints) == '[52]')
- assert(typeof(const_packed_ints[0]) == TYPE_FLOAT)
- assert(str(const_packed_ints[0]) == '52')
+ Utils.check(typeof(const_packed_empty) == TYPE_PACKED_FLOAT64_ARRAY)
+ Utils.check(str(const_packed_empty) == '[]')
+ Utils.check(typeof(const_packed_ints) == TYPE_PACKED_FLOAT64_ARRAY)
+ Utils.check(str(const_packed_ints) == '[52]')
+ Utils.check(typeof(const_packed_ints[0]) == TYPE_FLOAT)
+ Utils.check(str(const_packed_ints[0]) == '52')
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/enums_in_range_call.gd b/modules/gdscript/tests/scripts/analyzer/features/enums_in_range_call.gd
index d2d9d04508..a569488d3c 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/enums_in_range_call.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/enums_in_range_call.gd
@@ -5,5 +5,5 @@ func test():
for value in range(E.E0, E.E3):
var inferable := value
total += inferable
- assert(total == 0 + 1 + 2)
+ Utils.check(total == 0 + 1 + 2)
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.gd b/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.gd
index 39f490c4b3..ec89226328 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/export_enum_as_dictionary.gd
@@ -2,8 +2,6 @@ class_name TestExportEnumAsDictionary
enum MyEnum {A, B, C}
-const Utils = preload("../../utils.notest.gd")
-
@export var test_1 = MyEnum
@export var test_2 = MyEnum.A
@export var test_3 := MyEnum
diff --git a/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd b/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd
index 4a7f10f1ee..9ce0782d5c 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/for_range_usage.gd
@@ -3,5 +3,5 @@ func test():
var result := ''
for i in range(array.size(), 0, -1):
result += str(array[i - 1])
- assert(result == '963')
+ Utils.check(result == '963')
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_extra_parameters.gd b/modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_extra_parameters.gd
index d678f3acfc..e0cbdacb38 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_extra_parameters.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/function_match_parent_signature_with_extra_parameters.gd
@@ -2,11 +2,11 @@ func test():
var instance := Parent.new()
var result := instance.my_function(1)
print(result)
- assert(result == 1)
+ Utils.check(result == 1)
instance = Child.new()
result = instance.my_function(2)
print(result)
- assert(result == 0)
+ Utils.check(result == 0)
class Parent:
func my_function(par1: int) -> int:
diff --git a/modules/gdscript/tests/scripts/analyzer/features/return_conversions.gd b/modules/gdscript/tests/scripts/analyzer/features/return_conversions.gd
index 0b1576e66e..cbe8e9da34 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/return_conversions.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/return_conversions.gd
@@ -8,27 +8,27 @@ func convert_var_array_to_packed() -> PackedStringArray: var array := ['79']; re
func test():
var converted_literal_int := convert_literal_int_to_float()
- assert(typeof(converted_literal_int) == TYPE_FLOAT)
- assert(converted_literal_int == 76.0)
+ Utils.check(typeof(converted_literal_int) == TYPE_FLOAT)
+ Utils.check(converted_literal_int == 76.0)
var converted_arg_int := convert_arg_int_to_float(36)
- assert(typeof(converted_arg_int) == TYPE_FLOAT)
- assert(converted_arg_int == 36.0)
+ Utils.check(typeof(converted_arg_int) == TYPE_FLOAT)
+ Utils.check(converted_arg_int == 36.0)
var converted_var_int := convert_var_int_to_float()
- assert(typeof(converted_var_int) == TYPE_FLOAT)
- assert(converted_var_int == 59.0)
+ Utils.check(typeof(converted_var_int) == TYPE_FLOAT)
+ Utils.check(converted_var_int == 59.0)
var converted_literal_array := convert_literal_array_to_packed()
- assert(typeof(converted_literal_array) == TYPE_PACKED_STRING_ARRAY)
- assert(str(converted_literal_array) == '["46"]')
+ Utils.check(typeof(converted_literal_array) == TYPE_PACKED_STRING_ARRAY)
+ Utils.check(str(converted_literal_array) == '["46"]')
var converted_arg_array := convert_arg_array_to_packed(['91'])
- assert(typeof(converted_arg_array) == TYPE_PACKED_STRING_ARRAY)
- assert(str(converted_arg_array) == '["91"]')
+ Utils.check(typeof(converted_arg_array) == TYPE_PACKED_STRING_ARRAY)
+ Utils.check(str(converted_arg_array) == '["91"]')
var converted_var_array := convert_var_array_to_packed()
- assert(typeof(converted_var_array) == TYPE_PACKED_STRING_ARRAY)
- assert(str(converted_var_array) == '["79"]')
+ Utils.check(typeof(converted_var_array) == TYPE_PACKED_STRING_ARRAY)
+ Utils.check(str(converted_var_array) == '["79"]')
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/ternary_hard_infer.gd b/modules/gdscript/tests/scripts/analyzer/features/ternary_hard_infer.gd
index 44ca5f4dd0..d49acaacd3 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/ternary_hard_infer.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/ternary_hard_infer.gd
@@ -2,7 +2,7 @@ func test():
var left_hard_int := 1
var right_hard_int := 2
var result_hard_int := left_hard_int if true else right_hard_int
- assert(result_hard_int == 1)
+ Utils.check(result_hard_int == 1)
@warning_ignore("inference_on_variant")
var left_hard_variant := 1 as Variant
@@ -10,6 +10,6 @@ func test():
var right_hard_variant := 2.0 as Variant
@warning_ignore("inference_on_variant")
var result_hard_variant := left_hard_variant if true else right_hard_variant
- assert(result_hard_variant == 1)
+ Utils.check(result_hard_variant == 1)
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/type_test_usage.gd b/modules/gdscript/tests/scripts/analyzer/features/type_test_usage.gd
index 12dc0b93df..ee30f01dfb 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/type_test_usage.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/type_test_usage.gd
@@ -4,124 +4,123 @@ class A extends RefCounted:
class B extends A:
pass
-@warning_ignore("assert_always_true")
func test():
var builtin: Variant = 3
- assert((builtin is Variant) == true)
- assert((builtin is int) == true)
- assert(is_instance_of(builtin, TYPE_INT) == true)
- assert((builtin is float) == false)
- assert(is_instance_of(builtin, TYPE_FLOAT) == false)
+ Utils.check((builtin is Variant) == true)
+ Utils.check((builtin is int) == true)
+ Utils.check(is_instance_of(builtin, TYPE_INT) == true)
+ Utils.check((builtin is float) == false)
+ Utils.check(is_instance_of(builtin, TYPE_FLOAT) == false)
const const_builtin: Variant = 3
- assert((const_builtin is Variant) == true)
- assert((const_builtin is int) == true)
- assert(is_instance_of(const_builtin, TYPE_INT) == true)
- assert((const_builtin is float) == false)
- assert(is_instance_of(const_builtin, TYPE_FLOAT) == false)
+ Utils.check((const_builtin is Variant) == true)
+ Utils.check((const_builtin is int) == true)
+ Utils.check(is_instance_of(const_builtin, TYPE_INT) == true)
+ Utils.check((const_builtin is float) == false)
+ Utils.check(is_instance_of(const_builtin, TYPE_FLOAT) == false)
var int_array: Variant = [] as Array[int]
- assert((int_array is Variant) == true)
- assert((int_array is Array) == true)
- assert(is_instance_of(int_array, TYPE_ARRAY) == true)
- assert((int_array is Array[int]) == true)
- assert((int_array is Array[float]) == false)
- assert((int_array is int) == false)
- assert(is_instance_of(int_array, TYPE_INT) == false)
+ Utils.check((int_array is Variant) == true)
+ Utils.check((int_array is Array) == true)
+ Utils.check(is_instance_of(int_array, TYPE_ARRAY) == true)
+ Utils.check((int_array is Array[int]) == true)
+ Utils.check((int_array is Array[float]) == false)
+ Utils.check((int_array is int) == false)
+ Utils.check(is_instance_of(int_array, TYPE_INT) == false)
var const_int_array: Variant = [] as Array[int]
- assert((const_int_array is Variant) == true)
- assert((const_int_array is Array) == true)
- assert(is_instance_of(const_int_array, TYPE_ARRAY) == true)
- assert((const_int_array is Array[int]) == true)
- assert((const_int_array is Array[float]) == false)
- assert((const_int_array is int) == false)
- assert(is_instance_of(const_int_array, TYPE_INT) == false)
+ Utils.check((const_int_array is Variant) == true)
+ Utils.check((const_int_array is Array) == true)
+ Utils.check(is_instance_of(const_int_array, TYPE_ARRAY) == true)
+ Utils.check((const_int_array is Array[int]) == true)
+ Utils.check((const_int_array is Array[float]) == false)
+ Utils.check((const_int_array is int) == false)
+ Utils.check(is_instance_of(const_int_array, TYPE_INT) == false)
var b_array: Variant = [] as Array[B]
- assert((b_array is Variant) == true)
- assert((b_array is Array) == true)
- assert(is_instance_of(b_array, TYPE_ARRAY) == true)
- assert((b_array is Array[B]) == true)
- assert((b_array is Array[A]) == false)
- assert((b_array is Array[int]) == false)
- assert((b_array is int) == false)
- assert(is_instance_of(b_array, TYPE_INT) == false)
+ Utils.check((b_array is Variant) == true)
+ Utils.check((b_array is Array) == true)
+ Utils.check(is_instance_of(b_array, TYPE_ARRAY) == true)
+ Utils.check((b_array is Array[B]) == true)
+ Utils.check((b_array is Array[A]) == false)
+ Utils.check((b_array is Array[int]) == false)
+ Utils.check((b_array is int) == false)
+ Utils.check(is_instance_of(b_array, TYPE_INT) == false)
var const_b_array: Variant = [] as Array[B]
- assert((const_b_array is Variant) == true)
- assert((const_b_array is Array) == true)
- assert(is_instance_of(const_b_array, TYPE_ARRAY) == true)
- assert((const_b_array is Array[B]) == true)
- assert((const_b_array is Array[A]) == false)
- assert((const_b_array is Array[int]) == false)
- assert((const_b_array is int) == false)
- assert(is_instance_of(const_b_array, TYPE_INT) == false)
+ Utils.check((const_b_array is Variant) == true)
+ Utils.check((const_b_array is Array) == true)
+ Utils.check(is_instance_of(const_b_array, TYPE_ARRAY) == true)
+ Utils.check((const_b_array is Array[B]) == true)
+ Utils.check((const_b_array is Array[A]) == false)
+ Utils.check((const_b_array is Array[int]) == false)
+ Utils.check((const_b_array is int) == false)
+ Utils.check(is_instance_of(const_b_array, TYPE_INT) == false)
var native: Variant = RefCounted.new()
- assert((native is Variant) == true)
- assert((native is Object) == true)
- assert(is_instance_of(native, TYPE_OBJECT) == true)
- assert(is_instance_of(native, Object) == true)
- assert((native is RefCounted) == true)
- assert(is_instance_of(native, RefCounted) == true)
- assert((native is Node) == false)
- assert(is_instance_of(native, Node) == false)
- assert((native is int) == false)
- assert(is_instance_of(native, TYPE_INT) == false)
+ Utils.check((native is Variant) == true)
+ Utils.check((native is Object) == true)
+ Utils.check(is_instance_of(native, TYPE_OBJECT) == true)
+ Utils.check(is_instance_of(native, Object) == true)
+ Utils.check((native is RefCounted) == true)
+ Utils.check(is_instance_of(native, RefCounted) == true)
+ Utils.check((native is Node) == false)
+ Utils.check(is_instance_of(native, Node) == false)
+ Utils.check((native is int) == false)
+ Utils.check(is_instance_of(native, TYPE_INT) == false)
var a_script: Variant = A.new()
- assert((a_script is Variant) == true)
- assert((a_script is Object) == true)
- assert(is_instance_of(a_script, TYPE_OBJECT) == true)
- assert(is_instance_of(a_script, Object) == true)
- assert((a_script is RefCounted) == true)
- assert(is_instance_of(a_script, RefCounted) == true)
- assert((a_script is A) == true)
- assert(is_instance_of(a_script, A) == true)
- assert((a_script is B) == false)
- assert(is_instance_of(a_script, B) == false)
- assert((a_script is Node) == false)
- assert(is_instance_of(a_script, Node) == false)
- assert((a_script is int) == false)
- assert(is_instance_of(a_script, TYPE_INT) == false)
+ Utils.check((a_script is Variant) == true)
+ Utils.check((a_script is Object) == true)
+ Utils.check(is_instance_of(a_script, TYPE_OBJECT) == true)
+ Utils.check(is_instance_of(a_script, Object) == true)
+ Utils.check((a_script is RefCounted) == true)
+ Utils.check(is_instance_of(a_script, RefCounted) == true)
+ Utils.check((a_script is A) == true)
+ Utils.check(is_instance_of(a_script, A) == true)
+ Utils.check((a_script is B) == false)
+ Utils.check(is_instance_of(a_script, B) == false)
+ Utils.check((a_script is Node) == false)
+ Utils.check(is_instance_of(a_script, Node) == false)
+ Utils.check((a_script is int) == false)
+ Utils.check(is_instance_of(a_script, TYPE_INT) == false)
var b_script: Variant = B.new()
- assert((b_script is Variant) == true)
- assert((b_script is Object) == true)
- assert(is_instance_of(b_script, TYPE_OBJECT) == true)
- assert(is_instance_of(b_script, Object) == true)
- assert((b_script is RefCounted) == true)
- assert(is_instance_of(b_script, RefCounted) == true)
- assert((b_script is A) == true)
- assert(is_instance_of(b_script, A) == true)
- assert((b_script is B) == true)
- assert(is_instance_of(b_script, B) == true)
- assert((b_script is Node) == false)
- assert(is_instance_of(b_script, Node) == false)
- assert((b_script is int) == false)
- assert(is_instance_of(b_script, TYPE_INT) == false)
+ Utils.check((b_script is Variant) == true)
+ Utils.check((b_script is Object) == true)
+ Utils.check(is_instance_of(b_script, TYPE_OBJECT) == true)
+ Utils.check(is_instance_of(b_script, Object) == true)
+ Utils.check((b_script is RefCounted) == true)
+ Utils.check(is_instance_of(b_script, RefCounted) == true)
+ Utils.check((b_script is A) == true)
+ Utils.check(is_instance_of(b_script, A) == true)
+ Utils.check((b_script is B) == true)
+ Utils.check(is_instance_of(b_script, B) == true)
+ Utils.check((b_script is Node) == false)
+ Utils.check(is_instance_of(b_script, Node) == false)
+ Utils.check((b_script is int) == false)
+ Utils.check(is_instance_of(b_script, TYPE_INT) == false)
var var_null: Variant = null
- assert((var_null is Variant) == true)
- assert((var_null is int) == false)
- assert(is_instance_of(var_null, TYPE_INT) == false)
- assert((var_null is Object) == false)
- assert(is_instance_of(var_null, TYPE_OBJECT) == false)
- assert((var_null is RefCounted) == false)
- assert(is_instance_of(var_null, RefCounted) == false)
- assert((var_null is A) == false)
- assert(is_instance_of(var_null, A) == false)
+ Utils.check((var_null is Variant) == true)
+ Utils.check((var_null is int) == false)
+ Utils.check(is_instance_of(var_null, TYPE_INT) == false)
+ Utils.check((var_null is Object) == false)
+ Utils.check(is_instance_of(var_null, TYPE_OBJECT) == false)
+ Utils.check((var_null is RefCounted) == false)
+ Utils.check(is_instance_of(var_null, RefCounted) == false)
+ Utils.check((var_null is A) == false)
+ Utils.check(is_instance_of(var_null, A) == false)
const const_null: Variant = null
- assert((const_null is Variant) == true)
- assert((const_null is int) == false)
- assert(is_instance_of(const_null, TYPE_INT) == false)
- assert((const_null is Object) == false)
- assert(is_instance_of(const_null, TYPE_OBJECT) == false)
- assert((const_null is RefCounted) == false)
- assert(is_instance_of(const_null, RefCounted) == false)
- assert((const_null is A) == false)
- assert(is_instance_of(const_null, A) == false)
+ Utils.check((const_null is Variant) == true)
+ Utils.check((const_null is int) == false)
+ Utils.check(is_instance_of(const_null, TYPE_INT) == false)
+ Utils.check((const_null is Object) == false)
+ Utils.check(is_instance_of(const_null, TYPE_OBJECT) == false)
+ Utils.check((const_null is RefCounted) == false)
+ Utils.check(is_instance_of(const_null, RefCounted) == false)
+ Utils.check((const_null is A) == false)
+ Utils.check(is_instance_of(const_null, A) == false)
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd b/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd
index b000c82717..fe0274c27b 100644
--- a/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd
+++ b/modules/gdscript/tests/scripts/analyzer/features/typed_array_usage.gd
@@ -10,206 +10,205 @@ class Members:
var two: Array[int] = one
func check_passing() -> bool:
- assert(str(one) == '[104]')
- assert(str(two) == '[104]')
+ Utils.check(str(one) == '[104]')
+ Utils.check(str(two) == '[104]')
two.push_back(582)
- assert(str(one) == '[104, 582]')
- assert(str(two) == '[104, 582]')
+ Utils.check(str(one) == '[104, 582]')
+ Utils.check(str(two) == '[104, 582]')
two = [486]
- assert(str(one) == '[104, 582]')
- assert(str(two) == '[486]')
+ Utils.check(str(one) == '[104, 582]')
+ Utils.check(str(two) == '[486]')
return true
@warning_ignore("unsafe_method_access")
-@warning_ignore("assert_always_true")
@warning_ignore("return_value_discarded")
func test():
var untyped_basic = [459]
- assert(str(untyped_basic) == '[459]')
- assert(untyped_basic.get_typed_builtin() == TYPE_NIL)
+ Utils.check(str(untyped_basic) == '[459]')
+ Utils.check(untyped_basic.get_typed_builtin() == TYPE_NIL)
var inferred_basic := [366]
- assert(str(inferred_basic) == '[366]')
- assert(inferred_basic.get_typed_builtin() == TYPE_NIL)
+ Utils.check(str(inferred_basic) == '[366]')
+ Utils.check(inferred_basic.get_typed_builtin() == TYPE_NIL)
var typed_basic: Array = [521]
- assert(str(typed_basic) == '[521]')
- assert(typed_basic.get_typed_builtin() == TYPE_NIL)
+ Utils.check(str(typed_basic) == '[521]')
+ Utils.check(typed_basic.get_typed_builtin() == TYPE_NIL)
var empty_floats: Array[float] = []
- assert(str(empty_floats) == '[]')
- assert(empty_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(empty_floats) == '[]')
+ Utils.check(empty_floats.get_typed_builtin() == TYPE_FLOAT)
untyped_basic = empty_floats
- assert(untyped_basic.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(untyped_basic.get_typed_builtin() == TYPE_FLOAT)
inferred_basic = empty_floats
- assert(inferred_basic.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(inferred_basic.get_typed_builtin() == TYPE_FLOAT)
typed_basic = empty_floats
- assert(typed_basic.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(typed_basic.get_typed_builtin() == TYPE_FLOAT)
empty_floats.push_back(705.0)
untyped_basic.push_back(430.0)
inferred_basic.push_back(263.0)
typed_basic.push_back(518.0)
- assert(str(empty_floats) == '[705, 430, 263, 518]')
- assert(str(untyped_basic) == '[705, 430, 263, 518]')
- assert(str(inferred_basic) == '[705, 430, 263, 518]')
- assert(str(typed_basic) == '[705, 430, 263, 518]')
+ Utils.check(str(empty_floats) == '[705, 430, 263, 518]')
+ Utils.check(str(untyped_basic) == '[705, 430, 263, 518]')
+ Utils.check(str(inferred_basic) == '[705, 430, 263, 518]')
+ Utils.check(str(typed_basic) == '[705, 430, 263, 518]')
const constant_float := 950.0
const constant_int := 170
var typed_float := 954.0
var filled_floats: Array[float] = [constant_float, constant_int, typed_float, empty_floats[1] + empty_floats[2]]
- assert(str(filled_floats) == '[950, 170, 954, 693]')
- assert(filled_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(filled_floats) == '[950, 170, 954, 693]')
+ Utils.check(filled_floats.get_typed_builtin() == TYPE_FLOAT)
var casted_floats := [empty_floats[2] * 2] as Array[float]
- assert(str(casted_floats) == '[526]')
- assert(casted_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(casted_floats) == '[526]')
+ Utils.check(casted_floats.get_typed_builtin() == TYPE_FLOAT)
var returned_floats = (func () -> Array[float]: return [554]).call()
- assert(str(returned_floats) == '[554]')
- assert(returned_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(returned_floats) == '[554]')
+ Utils.check(returned_floats.get_typed_builtin() == TYPE_FLOAT)
var passed_floats = floats_identity([663.0 if randf() > 0.5 else 663.0])
- assert(str(passed_floats) == '[663]')
- assert(passed_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(passed_floats) == '[663]')
+ Utils.check(passed_floats.get_typed_builtin() == TYPE_FLOAT)
var default_floats = (func (floats: Array[float] = [364.0]): return floats).call()
- assert(str(default_floats) == '[364]')
- assert(default_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(default_floats) == '[364]')
+ Utils.check(default_floats.get_typed_builtin() == TYPE_FLOAT)
var typed_int := 556
var converted_floats: Array[float] = [typed_int]
converted_floats.push_back(498)
- assert(str(converted_floats) == '[556, 498]')
- assert(converted_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(converted_floats) == '[556, 498]')
+ Utils.check(converted_floats.get_typed_builtin() == TYPE_FLOAT)
const constant_basic = [228]
- assert(str(constant_basic) == '[228]')
- assert(constant_basic.get_typed_builtin() == TYPE_NIL)
+ Utils.check(str(constant_basic) == '[228]')
+ Utils.check(constant_basic.get_typed_builtin() == TYPE_NIL)
const constant_floats: Array[float] = [constant_float - constant_basic[0] - constant_int]
- assert(str(constant_floats) == '[552]')
- assert(constant_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(constant_floats) == '[552]')
+ Utils.check(constant_floats.get_typed_builtin() == TYPE_FLOAT)
var source_floats: Array[float] = [999.74]
untyped_basic = source_floats
var destination_floats: Array[float] = untyped_basic
destination_floats[0] -= 0.74
- assert(str(source_floats) == '[999]')
- assert(str(untyped_basic) == '[999]')
- assert(str(destination_floats) == '[999]')
- assert(destination_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(source_floats) == '[999]')
+ Utils.check(str(untyped_basic) == '[999]')
+ Utils.check(str(destination_floats) == '[999]')
+ Utils.check(destination_floats.get_typed_builtin() == TYPE_FLOAT)
var duplicated_floats := empty_floats.duplicate().slice(2, 3)
duplicated_floats[0] *= 3
- assert(str(duplicated_floats) == '[789]')
- assert(duplicated_floats.get_typed_builtin() == TYPE_FLOAT)
+ Utils.check(str(duplicated_floats) == '[789]')
+ Utils.check(duplicated_floats.get_typed_builtin() == TYPE_FLOAT)
var b_objects: Array[B] = [B.new(), B.new() as A, null]
- assert(b_objects.size() == 3)
- assert(b_objects.get_typed_builtin() == TYPE_OBJECT)
- assert(b_objects.get_typed_script() == B)
+ Utils.check(b_objects.size() == 3)
+ Utils.check(b_objects.get_typed_builtin() == TYPE_OBJECT)
+ Utils.check(b_objects.get_typed_script() == B)
var a_objects: Array[A] = [A.new(), B.new(), null, b_objects[0]]
- assert(a_objects.size() == 4)
- assert(a_objects.get_typed_builtin() == TYPE_OBJECT)
- assert(a_objects.get_typed_script() == A)
+ Utils.check(a_objects.size() == 4)
+ Utils.check(a_objects.get_typed_builtin() == TYPE_OBJECT)
+ Utils.check(a_objects.get_typed_script() == A)
var a_passed = (func check_a_passing(p_objects: Array[A]): return p_objects.size()).call(a_objects)
- assert(a_passed == 4)
+ Utils.check(a_passed == 4)
var b_passed = (func check_b_passing(basic: Array): return basic[0] != null).call(b_objects)
- assert(b_passed == true)
+ Utils.check(b_passed == true)
var empty_strings: Array[String] = []
var empty_bools: Array[bool] = []
var empty_basic_one := []
var empty_basic_two := []
- assert(empty_strings == empty_bools)
- assert(empty_basic_one == empty_basic_two)
- assert(empty_strings.hash() == empty_bools.hash())
- assert(empty_basic_one.hash() == empty_basic_two.hash())
+ Utils.check(empty_strings == empty_bools)
+ Utils.check(empty_basic_one == empty_basic_two)
+ Utils.check(empty_strings.hash() == empty_bools.hash())
+ Utils.check(empty_basic_one.hash() == empty_basic_two.hash())
var assign_source: Array[int] = [527]
var assign_target: Array[int] = []
assign_target.assign(assign_source)
- assert(str(assign_source) == '[527]')
- assert(str(assign_target) == '[527]')
+ Utils.check(str(assign_source) == '[527]')
+ Utils.check(str(assign_target) == '[527]')
assign_source.push_back(657)
- assert(str(assign_source) == '[527, 657]')
- assert(str(assign_target) == '[527]')
+ Utils.check(str(assign_source) == '[527, 657]')
+ Utils.check(str(assign_target) == '[527]')
var defaults_passed = (func check_defaults_passing(one: Array[int] = [], two := one):
one.push_back(887)
two.push_back(198)
- assert(str(one) == '[887, 198]')
- assert(str(two) == '[887, 198]')
+ Utils.check(str(one) == '[887, 198]')
+ Utils.check(str(two) == '[887, 198]')
two = [130]
- assert(str(one) == '[887, 198]')
- assert(str(two) == '[130]')
+ Utils.check(str(one) == '[887, 198]')
+ Utils.check(str(two) == '[130]')
return true
).call()
- assert(defaults_passed == true)
+ Utils.check(defaults_passed == true)
var members := Members.new()
var members_passed := members.check_passing()
- assert(members_passed == true)
+ Utils.check(members_passed == true)
var resized_basic: Array = []
resized_basic.resize(1)
- assert(typeof(resized_basic[0]) == TYPE_NIL)
- assert(resized_basic[0] == null)
+ Utils.check(typeof(resized_basic[0]) == TYPE_NIL)
+ Utils.check(resized_basic[0] == null)
var resized_ints: Array[int] = []
resized_ints.resize(1)
- assert(typeof(resized_ints[0]) == TYPE_INT)
- assert(resized_ints[0] == 0)
+ Utils.check(typeof(resized_ints[0]) == TYPE_INT)
+ Utils.check(resized_ints[0] == 0)
var resized_arrays: Array[Array] = []
resized_arrays.resize(1)
- assert(typeof(resized_arrays[0]) == TYPE_ARRAY)
+ Utils.check(typeof(resized_arrays[0]) == TYPE_ARRAY)
resized_arrays[0].resize(1)
resized_arrays[0][0] = 523
- assert(str(resized_arrays) == '[[523]]')
+ Utils.check(str(resized_arrays) == '[[523]]')
var resized_objects: Array[Object] = []
resized_objects.resize(1)
- assert(typeof(resized_objects[0]) == TYPE_NIL)
- assert(resized_objects[0] == null)
+ Utils.check(typeof(resized_objects[0]) == TYPE_NIL)
+ Utils.check(resized_objects[0] == null)
var typed_enums: Array[E] = []
typed_enums.resize(1)
- assert(str(typed_enums) == '[0]')
+ Utils.check(str(typed_enums) == '[0]')
typed_enums[0] = E.E0
- assert(str(typed_enums) == '[391]')
- assert(typed_enums.get_typed_builtin() == TYPE_INT)
+ Utils.check(str(typed_enums) == '[391]')
+ Utils.check(typed_enums.get_typed_builtin() == TYPE_INT)
const const_enums: Array[E] = []
- assert(const_enums.get_typed_builtin() == TYPE_INT)
- assert(const_enums.get_typed_class_name() == &'')
+ Utils.check(const_enums.get_typed_builtin() == TYPE_INT)
+ Utils.check(const_enums.get_typed_class_name() == &'')
var a := A.new()
var typed_natives: Array[RefCounted] = [a]
var typed_scripts = Array(typed_natives, TYPE_OBJECT, "RefCounted", A)
- assert(typed_scripts[0] == a)
+ Utils.check(typed_scripts[0] == a)
print('ok')
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.gd b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.gd
new file mode 100644
index 0000000000..95d497c3f3
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.gd
@@ -0,0 +1,7 @@
+extends "./non_tool_extends_tool.notest.gd"
+
+class InnerClass extends "./non_tool_extends_tool.notest.gd":
+ pass
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.notest.gd b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.notest.gd
new file mode 100644
index 0000000000..07427846d1
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.notest.gd
@@ -0,0 +1 @@
+@tool
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.out b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.out
new file mode 100644
index 0000000000..f65caf5222
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool.out
@@ -0,0 +1,9 @@
+GDTEST_OK
+>> WARNING
+>> Line: 1
+>> MISSING_TOOL
+>> The base class script has the "@tool" annotation, but this script does not have it.
+>> WARNING
+>> Line: 3
+>> MISSING_TOOL
+>> The base class script has the "@tool" annotation, but this script does not have it.
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.gd b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.gd
new file mode 100644
index 0000000000..a452307d99
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.gd
@@ -0,0 +1,9 @@
+@warning_ignore("missing_tool")
+extends "./non_tool_extends_tool.notest.gd"
+
+@warning_ignore("missing_tool")
+class InnerClass extends "./non_tool_extends_tool.notest.gd":
+ pass
+
+func test():
+ pass
diff --git a/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.out b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.out
new file mode 100644
index 0000000000..d73c5eb7cd
--- /dev/null
+++ b/modules/gdscript/tests/scripts/analyzer/warnings/non_tool_extends_tool_ignored.out
@@ -0,0 +1 @@
+GDTEST_OK
diff --git a/modules/gdscript/tests/scripts/completion/index/array_type.cfg b/modules/gdscript/tests/scripts/completion/index/array_type.cfg
new file mode 100644
index 0000000000..5cd5565d00
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/array_type.cfg
@@ -0,0 +1,9 @@
+[output]
+include=[
+ {"display": "outer"},
+ {"display": "inner"},
+]
+exclude=[
+ {"display": "append"},
+ {"display": "\"append\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/array_type.gd b/modules/gdscript/tests/scripts/completion/index/array_type.gd
new file mode 100644
index 0000000000..e0a15da556
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/array_type.gd
@@ -0,0 +1,10 @@
+extends Node
+
+var outer
+
+func _ready() -> void:
+ var inner
+
+ var array: Array
+
+ array[i➡]
diff --git a/modules/gdscript/tests/scripts/completion/index/array_value.cfg b/modules/gdscript/tests/scripts/completion/index/array_value.cfg
new file mode 100644
index 0000000000..5cd5565d00
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/array_value.cfg
@@ -0,0 +1,9 @@
+[output]
+include=[
+ {"display": "outer"},
+ {"display": "inner"},
+]
+exclude=[
+ {"display": "append"},
+ {"display": "\"append\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/array_value.gd b/modules/gdscript/tests/scripts/completion/index/array_value.gd
new file mode 100644
index 0000000000..17451725bc
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/array_value.gd
@@ -0,0 +1,10 @@
+extends Node
+
+var outer
+
+func _ready() -> void:
+ var inner
+
+ var array = []
+
+ array[i➡]
diff --git a/modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.cfg b/modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.cfg
new file mode 100644
index 0000000000..ecea284b5d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.cfg
@@ -0,0 +1,11 @@
+[output]
+include=[
+ {"display": "\"key1\""},
+ {"display": "\"key2\""},
+]
+exclude=[
+ {"display": "keys"},
+ {"display": "\"keys\""},
+ {"display": "key1"},
+ {"display": "key2"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.gd b/modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.gd
new file mode 100644
index 0000000000..06498c57a6
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/const_dictionary_keys.gd
@@ -0,0 +1,13 @@
+extends Node
+
+var outer
+
+const dict = {
+ "key1": "value",
+ "key2": null,
+}
+
+func _ready() -> void:
+ var inner
+
+ dict["➡"]
diff --git a/modules/gdscript/tests/scripts/completion/index/dictionary_type.cfg b/modules/gdscript/tests/scripts/completion/index/dictionary_type.cfg
new file mode 100644
index 0000000000..cddf7b8cc8
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/dictionary_type.cfg
@@ -0,0 +1,9 @@
+[output]
+include=[
+ {"display": "outer"},
+ {"display": "inner"},
+]
+exclude=[
+ {"display": "keys"},
+ {"display": "\"keys\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/dictionary_type.gd b/modules/gdscript/tests/scripts/completion/index/dictionary_type.gd
new file mode 100644
index 0000000000..b02c62eea5
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/dictionary_type.gd
@@ -0,0 +1,10 @@
+extends Node
+
+var outer
+
+func _ready() -> void:
+ var inner
+
+ var dict: Dictionary
+
+ dict[i➡]
diff --git a/modules/gdscript/tests/scripts/completion/index/dictionary_value.cfg b/modules/gdscript/tests/scripts/completion/index/dictionary_value.cfg
new file mode 100644
index 0000000000..cddf7b8cc8
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/dictionary_value.cfg
@@ -0,0 +1,9 @@
+[output]
+include=[
+ {"display": "outer"},
+ {"display": "inner"},
+]
+exclude=[
+ {"display": "keys"},
+ {"display": "\"keys\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/dictionary_value.gd b/modules/gdscript/tests/scripts/completion/index/dictionary_value.gd
new file mode 100644
index 0000000000..60bf391716
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/dictionary_value.gd
@@ -0,0 +1,10 @@
+extends Node
+
+var outer
+
+func _ready() -> void:
+ var inner
+
+ var dict = {}
+
+ dict[i➡]
diff --git a/modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.cfg b/modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.cfg
new file mode 100644
index 0000000000..ecea284b5d
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.cfg
@@ -0,0 +1,11 @@
+[output]
+include=[
+ {"display": "\"key1\""},
+ {"display": "\"key2\""},
+]
+exclude=[
+ {"display": "keys"},
+ {"display": "\"keys\""},
+ {"display": "key1"},
+ {"display": "key2"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.gd b/modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.gd
new file mode 100644
index 0000000000..2220cdcc59
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/local_dictionary_keys.gd
@@ -0,0 +1,13 @@
+extends Node
+
+var outer
+
+func _ready() -> void:
+ var inner
+
+ var dict: Dictionary = {
+ "key1": "value",
+ "key2": null,
+ }
+
+ dict["➡"]
diff --git a/modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.cfg b/modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.cfg
new file mode 100644
index 0000000000..8da525bff8
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.cfg
@@ -0,0 +1,9 @@
+[output]
+exclude=[
+ {"display": "keys"},
+ {"display": "\"keys\""},
+ {"display": "key1"},
+ {"display": "key2"},
+ {"display": "\"key1\""},
+ {"display": "\"key2\""},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.gd b/modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.gd
new file mode 100644
index 0000000000..ba8d7f76fd
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/property_dictionary_keys.gd
@@ -0,0 +1,13 @@
+extends Node
+
+var outer
+
+var dict = {
+ "key1": "value",
+ "key2": null,
+}
+
+func _ready() -> void:
+ var inner
+
+ dict["➡"]
diff --git a/modules/gdscript/tests/scripts/completion/index/untyped_local.cfg b/modules/gdscript/tests/scripts/completion/index/untyped_local.cfg
new file mode 100644
index 0000000000..1173043f94
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/untyped_local.cfg
@@ -0,0 +1,5 @@
+[output]
+include=[
+ {"display": "outer"},
+ {"display": "inner"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/untyped_local.gd b/modules/gdscript/tests/scripts/completion/index/untyped_local.gd
new file mode 100644
index 0000000000..1a1157af02
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/untyped_local.gd
@@ -0,0 +1,10 @@
+extends Node
+
+var outer
+
+func _ready() -> void:
+ var inner
+
+ var array
+
+ array[i➡]
diff --git a/modules/gdscript/tests/scripts/completion/index/untyped_property.cfg b/modules/gdscript/tests/scripts/completion/index/untyped_property.cfg
new file mode 100644
index 0000000000..1173043f94
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/untyped_property.cfg
@@ -0,0 +1,5 @@
+[output]
+include=[
+ {"display": "outer"},
+ {"display": "inner"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/index/untyped_property.gd b/modules/gdscript/tests/scripts/completion/index/untyped_property.gd
new file mode 100644
index 0000000000..9fa23da504
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/index/untyped_property.gd
@@ -0,0 +1,9 @@
+extends Node
+
+var outer
+var array
+
+func _ready() -> void:
+ var inner
+
+ array[i➡]
diff --git a/modules/gdscript/tests/scripts/parser/features/annotations.gd b/modules/gdscript/tests/scripts/parser/features/annotations.gd
index 7a7d6d953e..1e5d3fdcad 100644
--- a/modules/gdscript/tests/scripts/parser/features/annotations.gd
+++ b/modules/gdscript/tests/scripts/parser/features/annotations.gd
@@ -1,7 +1,5 @@
extends Node
-const Utils = preload("../../utils.notest.gd")
-
@export_enum("A", "B", "C") var test_1
@export_enum("A", "B", "C",) var test_2
diff --git a/modules/gdscript/tests/scripts/parser/features/class.gd b/modules/gdscript/tests/scripts/parser/features/class.gd
index af24b32322..482d04a63b 100644
--- a/modules/gdscript/tests/scripts/parser/features/class.gd
+++ b/modules/gdscript/tests/scripts/parser/features/class.gd
@@ -18,8 +18,8 @@ func test():
test_instance.number = 42
var test_sub = TestSub.new()
- assert(test_sub.number == 25) # From Test.
- assert(test_sub.other_string == "bye") # From TestSub.
+ Utils.check(test_sub.number == 25) # From Test.
+ Utils.check(test_sub.other_string == "bye") # From TestSub.
var _test_constructor = TestConstructor.new()
_test_constructor = TestConstructor.new(500)
diff --git a/modules/gdscript/tests/scripts/parser/features/export_arrays.gd b/modules/gdscript/tests/scripts/parser/features/export_arrays.gd
index 0d97135a7b..cfda255905 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_arrays.gd
+++ b/modules/gdscript/tests/scripts/parser/features/export_arrays.gd
@@ -1,5 +1,3 @@
-const Utils = preload("../../utils.notest.gd")
-
@export_dir var test_dir: Array[String]
@export_dir var test_dir_packed: PackedStringArray
@export_file var test_file: Array[String]
diff --git a/modules/gdscript/tests/scripts/parser/features/export_enum.gd b/modules/gdscript/tests/scripts/parser/features/export_enum.gd
index 7f0737f4db..d50f0b2528 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_enum.gd
+++ b/modules/gdscript/tests/scripts/parser/features/export_enum.gd
@@ -1,5 +1,3 @@
-const Utils = preload("../../utils.notest.gd")
-
@export_enum("Red", "Green", "Blue") var test_untyped
@export_enum("Red:10", "Green:20", "Blue:30") var test_with_values
diff --git a/modules/gdscript/tests/scripts/parser/features/export_variable.gd b/modules/gdscript/tests/scripts/parser/features/export_variable.gd
index 8bcb2bcb9a..1e134d0e0e 100644
--- a/modules/gdscript/tests/scripts/parser/features/export_variable.gd
+++ b/modules/gdscript/tests/scripts/parser/features/export_variable.gd
@@ -1,7 +1,6 @@
class_name ExportVariableTest
extends Node
-const Utils = preload("../../utils.notest.gd")
const PreloadedGlobalClass = preload("./export_variable_global.notest.gd")
const PreloadedUnnamedClass = preload("./export_variable_unnamed.notest.gd")
diff --git a/modules/gdscript/tests/scripts/parser/features/good_continue_in_lambda.gd b/modules/gdscript/tests/scripts/parser/features/good_continue_in_lambda.gd
index 2fa45c1d7d..0ec118b6b7 100644
--- a/modules/gdscript/tests/scripts/parser/features/good_continue_in_lambda.gd
+++ b/modules/gdscript/tests/scripts/parser/features/good_continue_in_lambda.gd
@@ -9,5 +9,5 @@ func test():
j_string += str(j)
return j_string
i_string += lambda.call()
- assert(i_string == '0202')
+ Utils.check(i_string == '0202')
print('ok')
diff --git a/modules/gdscript/tests/scripts/parser/features/truthiness.gd b/modules/gdscript/tests/scripts/parser/features/truthiness.gd
index 9c67a152f5..736cda7f74 100644
--- a/modules/gdscript/tests/scripts/parser/features/truthiness.gd
+++ b/modules/gdscript/tests/scripts/parser/features/truthiness.gd
@@ -1,30 +1,32 @@
func test():
- # The assertions below should all evaluate to `true` for this test to pass.
- assert(true)
- assert(not false)
- assert(500)
- assert(not 0)
- assert(500.5)
- assert(not 0.0)
- assert("non-empty string")
- assert(["non-empty array"])
- assert({"non-empty": "dictionary"})
- assert(Vector2(1, 0))
- assert(Vector2i(-1, -1))
- assert(Vector3(0, 0, 0.0001))
- assert(Vector3i(0, 0, 10000))
+ # The checks below should all evaluate to `true` for this test to pass.
+ Utils.check(true)
+ Utils.check(not false)
+ Utils.check(500)
+ Utils.check(not 0)
+ Utils.check(500.5)
+ Utils.check(not 0.0)
+ Utils.check("non-empty string")
+ Utils.check(["non-empty array"])
+ Utils.check({"non-empty": "dictionary"})
+ Utils.check(Vector2(1, 0))
+ Utils.check(Vector2i(-1, -1))
+ Utils.check(Vector3(0, 0, 0.0001))
+ Utils.check(Vector3i(0, 0, 10000))
# Zero position is `true` only if the Rect2's size is non-zero.
- assert(Rect2(0, 0, 0, 1))
+ Utils.check(Rect2(0, 0, 0, 1))
# Zero size is `true` only if the position is non-zero.
- assert(Rect2(1, 1, 0, 0))
+ Utils.check(Rect2(1, 1, 0, 0))
# Zero position is `true` only if the Rect2's size is non-zero.
- assert(Rect2i(0, 0, 0, 1))
+ Utils.check(Rect2i(0, 0, 0, 1))
# Zero size is `true` only if the position is non-zero.
- assert(Rect2i(1, 1, 0, 0))
+ Utils.check(Rect2i(1, 1, 0, 0))
# A fully black color is only truthy if its alpha component is not equal to `1`.
- assert(Color(0, 0, 0, 0.5))
+ Utils.check(Color(0, 0, 0, 0.5))
+
+ print("ok")
diff --git a/modules/gdscript/tests/scripts/parser/features/truthiness.out b/modules/gdscript/tests/scripts/parser/features/truthiness.out
index 705524857b..1b47ed10dc 100644
--- a/modules/gdscript/tests/scripts/parser/features/truthiness.out
+++ b/modules/gdscript/tests/scripts/parser/features/truthiness.out
@@ -1,65 +1,2 @@
GDTEST_OK
->> WARNING
->> Line: 3
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 4
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 5
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 6
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 7
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 8
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 9
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 12
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 13
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 14
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 15
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 18
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 21
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 24
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 27
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
->> WARNING
->> Line: 30
->> ASSERT_ALWAYS_TRUE
->> Assert statement is redundant because the expression is always true.
+ok
diff --git a/modules/gdscript/tests/scripts/runtime/features/array_string_stringname_equivalent.gd b/modules/gdscript/tests/scripts/runtime/features/array_string_stringname_equivalent.gd
index bd38259cec..6eec37d64d 100644
--- a/modules/gdscript/tests/scripts/runtime/features/array_string_stringname_equivalent.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/array_string_stringname_equivalent.gd
@@ -25,7 +25,7 @@ func test():
print("String in Array[StringName]: ", "abc" in stringname_array)
var packed_string_array: PackedStringArray = []
- assert(!packed_string_array.push_back("abc"))
+ Utils.check(!packed_string_array.push_back("abc"))
print("StringName in PackedStringArray: ", &"abc" in packed_string_array)
string_array.push_back("abc")
diff --git a/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd b/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd
index d1746979be..6aa863c05f 100644
--- a/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/constants_are_read_only.gd
@@ -1,10 +1,9 @@
const array: Array = [0]
const dictionary := {1: 2}
-@warning_ignore("assert_always_true")
func test():
- assert(array.is_read_only() == true)
- assert(str(array) == '[0]')
- assert(dictionary.is_read_only() == true)
- assert(str(dictionary) == '{ 1: 2 }')
+ Utils.check(array.is_read_only() == true)
+ Utils.check(str(array) == '[0]')
+ Utils.check(dictionary.is_read_only() == true)
+ Utils.check(str(dictionary) == '{ 1: 2 }')
print('ok')
diff --git a/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd b/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd
index a778fb1a94..0f2526667d 100644
--- a/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/conversions_from_native_members.gd
@@ -2,8 +2,8 @@ class Foo extends Node:
func _init():
name = 'f'
var string: String = name
- assert(typeof(string) == TYPE_STRING)
- assert(string == 'f')
+ Utils.check(typeof(string) == TYPE_STRING)
+ Utils.check(string == 'f')
print('ok')
func test():
diff --git a/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd b/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
index 0851d939dc..9e67e75140 100644
--- a/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/default_set_beforehand.gd
@@ -6,15 +6,15 @@ extends Node
@onready var later_untyped = [1]
func test():
- assert(typeof(later_inferred) == TYPE_ARRAY)
- assert(later_inferred.size() == 0)
+ Utils.check(typeof(later_inferred) == TYPE_ARRAY)
+ Utils.check(later_inferred.size() == 0)
- assert(typeof(later_static) == TYPE_ARRAY)
- assert(later_static.size() == 0)
+ Utils.check(typeof(later_static) == TYPE_ARRAY)
+ Utils.check(later_static.size() == 0)
- assert(typeof(later_static_with_init) == TYPE_ARRAY)
- assert(later_static_with_init.size() == 0)
+ Utils.check(typeof(later_static_with_init) == TYPE_ARRAY)
+ Utils.check(later_static_with_init.size() == 0)
- assert(typeof(later_untyped) == TYPE_NIL)
+ Utils.check(typeof(later_untyped) == TYPE_NIL)
print("ok")
diff --git a/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.gd b/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.gd
index 0133d7fcfc..90df98e05b 100644
--- a/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/export_group_no_name_conflict_with_properties.gd
@@ -1,5 +1,3 @@
-const Utils = preload("../../utils.notest.gd")
-
# GH-73843
@export_group("Resource")
diff --git a/modules/gdscript/tests/scripts/runtime/features/match_with_pattern_guards.gd b/modules/gdscript/tests/scripts/runtime/features/match_with_pattern_guards.gd
index 4cb51f8512..48a9349bf8 100644
--- a/modules/gdscript/tests/scripts/runtime/features/match_with_pattern_guards.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/match_with_pattern_guards.gd
@@ -62,7 +62,7 @@ func test():
0 when side_effect():
print("will run the side effect call, but not this")
_:
- assert(global == 1)
+ Utils.check(global == 1)
print("side effect only ran once")
func side_effect():
diff --git a/modules/gdscript/tests/scripts/runtime/features/member_info.gd b/modules/gdscript/tests/scripts/runtime/features/member_info.gd
index 42b29eee43..91d5a501c8 100644
--- a/modules/gdscript/tests/scripts/runtime/features/member_info.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/member_info.gd
@@ -5,8 +5,6 @@ class MyClass:
enum MyEnum {}
-const Utils = preload("../../utils.notest.gd")
-
static var test_static_var_untyped
static var test_static_var_weak_null = null
static var test_static_var_weak_int = 1
diff --git a/modules/gdscript/tests/scripts/runtime/features/member_info_inheritance.gd b/modules/gdscript/tests/scripts/runtime/features/member_info_inheritance.gd
index ee5c1e1267..4ddbeaec0b 100644
--- a/modules/gdscript/tests/scripts/runtime/features/member_info_inheritance.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/member_info_inheritance.gd
@@ -1,7 +1,5 @@
# GH-82169
-const Utils = preload("../../utils.notest.gd")
-
class A:
static var test_static_var_a1
static var test_static_var_a2
diff --git a/modules/gdscript/tests/scripts/runtime/features/metatypes.gd b/modules/gdscript/tests/scripts/runtime/features/metatypes.gd
index fd23ea0db5..d6847768e6 100644
--- a/modules/gdscript/tests/scripts/runtime/features/metatypes.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/metatypes.gd
@@ -3,7 +3,6 @@ class MyClass:
enum MyEnum {A, B, C}
-const Utils = preload("../../utils.notest.gd")
const Other = preload("./metatypes.notest.gd")
var test_native := JSON
diff --git a/modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.gd b/modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.gd
index e1aba83507..dee36d3ae0 100644
--- a/modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/set_does_not_leak.gd
@@ -6,6 +6,6 @@ class MyObj:
func test():
var obj_1 = MyObj.new()
var obj_2 = MyObj.new()
- assert(obj_2.get_reference_count() == 1)
+ Utils.check(obj_2.get_reference_count() == 1)
obj_1.set(&"obj", obj_2)
- assert(obj_2.get_reference_count() == 1)
+ Utils.check(obj_2.get_reference_count() == 1)
diff --git a/modules/gdscript/tests/scripts/runtime/features/single_underscore_node_name.gd b/modules/gdscript/tests/scripts/runtime/features/single_underscore_node_name.gd
index b07c40b6da..11a670a7fb 100644
--- a/modules/gdscript/tests/scripts/runtime/features/single_underscore_node_name.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/single_underscore_node_name.gd
@@ -12,4 +12,4 @@ func test() -> void:
node1.add_child(node2)
add_child(node3)
- assert(get_node("_/Child") == $_/Child)
+ Utils.check(get_node("_/Child") == $_/Child)
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
index 691b611574..d72662736e 100644
--- 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
@@ -14,33 +14,33 @@ func test():
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`.
+ Utils.check(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`.
+ Utils.check(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`.
+ Utils.check(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`.
+ Utils.check(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`.
+ Utils.check(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`.
+ Utils.check(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`.
+ Utils.check(not f) # Test unary operator reading from `nil`.
diff --git a/modules/gdscript/tests/scripts/runtime/features/typed_array_init_with_untyped_in_literal.gd b/modules/gdscript/tests/scripts/runtime/features/typed_array_init_with_untyped_in_literal.gd
index ec444b4ffa..859bfd7987 100644
--- a/modules/gdscript/tests/scripts/runtime/features/typed_array_init_with_untyped_in_literal.gd
+++ b/modules/gdscript/tests/scripts/runtime/features/typed_array_init_with_untyped_in_literal.gd
@@ -1,6 +1,6 @@
func test():
var untyped: Variant = 32
var typed: Array[int] = [untyped]
- assert(typed.get_typed_builtin() == TYPE_INT)
- assert(str(typed) == '[32]')
+ Utils.check(typed.get_typed_builtin() == TYPE_INT)
+ Utils.check(str(typed) == '[32]')
print('ok')
diff --git a/modules/gdscript/tests/scripts/utils.notest.gd b/modules/gdscript/tests/scripts/utils.notest.gd
index 7fdd6556ec..5d615d8557 100644
--- a/modules/gdscript/tests/scripts/utils.notest.gd
+++ b/modules/gdscript/tests/scripts/utils.notest.gd
@@ -1,3 +1,13 @@
+class_name Utils
+
+
+# `assert()` is not evaluated in non-debug builds. Do not use `assert()`
+# for anything other than testing the `assert()` itself.
+static func check(condition: Variant) -> void:
+ if not condition:
+ printerr("Check failed.")
+
+
static func get_type(property: Dictionary, is_return: bool = false) -> String:
match property.type:
TYPE_NIL:
@@ -46,7 +56,7 @@ static func get_human_readable_hint_string(property: Dictionary) -> String:
while true:
if not hint_string.contains(":"):
- push_error("Invalid PROPERTY_HINT_TYPE_STRING format.")
+ printerr("Invalid PROPERTY_HINT_TYPE_STRING format.")
var elem_type_hint: String = hint_string.get_slice(":", 0)
hint_string = hint_string.substr(elem_type_hint.length() + 1)
@@ -58,7 +68,7 @@ static func get_human_readable_hint_string(property: Dictionary) -> String:
type_hint_prefixes += "<%s>:" % type_string(elem_type)
else:
if elem_type_hint.count("/") != 1:
- push_error("Invalid PROPERTY_HINT_TYPE_STRING format.")
+ printerr("Invalid PROPERTY_HINT_TYPE_STRING format.")
elem_type = elem_type_hint.get_slice("/", 0).to_int()
elem_hint = elem_type_hint.get_slice("/", 1).to_int()
type_hint_prefixes += "<%s>/<%s>:" % [
@@ -188,7 +198,7 @@ static func get_property_hint_name(hint: PropertyHint) -> String:
return "PROPERTY_HINT_HIDE_QUATERNION_EDIT"
PROPERTY_HINT_PASSWORD:
return "PROPERTY_HINT_PASSWORD"
- push_error("Argument `hint` is invalid. Use `PROPERTY_HINT_*` constants.")
+ printerr("Argument `hint` is invalid. Use `PROPERTY_HINT_*` constants.")
return "<invalid hint>"
@@ -240,7 +250,7 @@ static func get_property_usage_string(usage: int) -> String:
usage &= ~flag[0]
if usage != PROPERTY_USAGE_NONE:
- push_error("Argument `usage` is invalid. Use `PROPERTY_USAGE_*` constants.")
+ printerr("Argument `usage` is invalid. Use `PROPERTY_USAGE_*` constants.")
return "<invalid usage flags>"
return result.left(-1)