diff options
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime')
10 files changed, 65 insertions, 37 deletions
diff --git a/modules/gdscript/tests/scripts/runtime/features/chain_assignment_works.out b/modules/gdscript/tests/scripts/runtime/features/chain_assignment_works.out index 22929bf636..04b0773991 100644 --- a/modules/gdscript/tests/scripts/runtime/features/chain_assignment_works.out +++ b/modules/gdscript/tests/scripts/runtime/features/chain_assignment_works.out @@ -1,7 +1,7 @@ GDTEST_OK -{ 1: (2, 0) } -{ 3: (4, 0) } -[[(5, 0)]] -[[(6, 0)]] -[[(7, 0)]] -[X: (8, 9, 7), Y: (0, 1, 0), Z: (0, 0, 1), O: (0, 0, 0)] +{ 1: (2.0, 0.0) } +{ 3: (4.0, 0.0) } +[[(5.0, 0.0)]] +[[(6.0, 0.0)]] +[[(7.0, 0.0)]] +[X: (8.0, 9.0, 7.0), Y: (0.0, 1.0, 0.0), Z: (0.0, 0.0, 1.0), O: (0.0, 0.0, 0.0)] diff --git a/modules/gdscript/tests/scripts/runtime/features/conversion_for_default_parameter.out b/modules/gdscript/tests/scripts/runtime/features/conversion_for_default_parameter.out index a9ef4919cf..78ea2a2d80 100644 --- a/modules/gdscript/tests/scripts/runtime/features/conversion_for_default_parameter.out +++ b/modules/gdscript/tests/scripts/runtime/features/conversion_for_default_parameter.out @@ -1,8 +1,8 @@ GDTEST_OK -x is 1 +x is 1.0 typeof x is 3 -x is 2 +x is 2.0 typeof x is 3 -x is 3 +x is 3.0 typeof x is 3 ok diff --git a/modules/gdscript/tests/scripts/runtime/features/gdscript_utility_implicit_conversion.gd b/modules/gdscript/tests/scripts/runtime/features/gdscript_utility_implicit_conversion.gd new file mode 100644 index 0000000000..59bdb6eceb --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/gdscript_utility_implicit_conversion.gd @@ -0,0 +1,12 @@ +func test(): + const COLOR = Color8(255, 0.0, false) + var false_value := false + @warning_ignore("narrowing_conversion") + var color = Color8(255, 0.0, false_value) + print(var_to_str(COLOR)) + print(var_to_str(color)) + + var string := "Node" + var string_name := &"Node" + print(type_exists(string)) + print(type_exists(string_name)) diff --git a/modules/gdscript/tests/scripts/runtime/features/gdscript_utility_implicit_conversion.out b/modules/gdscript/tests/scripts/runtime/features/gdscript_utility_implicit_conversion.out new file mode 100644 index 0000000000..00913faa49 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/gdscript_utility_implicit_conversion.out @@ -0,0 +1,5 @@ +GDTEST_OK +Color(1, 0, 0, 1) +Color(1, 0, 0, 1) +true +true diff --git a/modules/gdscript/tests/scripts/runtime/features/native_static_method_as_callable.gd b/modules/gdscript/tests/scripts/runtime/features/native_static_method_as_callable.gd new file mode 100644 index 0000000000..63d5935d1e --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/native_static_method_as_callable.gd @@ -0,0 +1,8 @@ +func get_parse_string(t: Variant): + return t.parse_string + +func test(): + var a: Callable = JSON.parse_string + var b: Callable = get_parse_string(JSON) + prints(a.call("{\"test\": \"a\"}"), a.is_valid()) + prints(b.call("{\"test\": \"b\"}"), b.is_valid()) diff --git a/modules/gdscript/tests/scripts/runtime/features/native_static_method_as_callable.out b/modules/gdscript/tests/scripts/runtime/features/native_static_method_as_callable.out new file mode 100644 index 0000000000..a2cb4b9a07 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/native_static_method_as_callable.out @@ -0,0 +1,3 @@ +GDTEST_OK +{ "test": "a" } false +{ "test": "b" } false diff --git a/modules/gdscript/tests/scripts/runtime/features/parameter_shadowing.out b/modules/gdscript/tests/scripts/runtime/features/parameter_shadowing.out index 5b981bc8bb..1650acadb5 100644 --- a/modules/gdscript/tests/scripts/runtime/features/parameter_shadowing.out +++ b/modules/gdscript/tests/scripts/runtime/features/parameter_shadowing.out @@ -2,16 +2,16 @@ GDTEST_OK >> WARNING >> Line: 5 >> SHADOWED_VARIABLE ->> The local function parameter "a" is shadowing an already-declared variable at line 3. +>> The local function parameter "a" is shadowing an already-declared variable at line 3 in the current class. >> WARNING >> Line: 15 >> SHADOWED_VARIABLE ->> The local function parameter "v" is shadowing an already-declared variable at line 13. +>> The local function parameter "v" is shadowing an already-declared variable at line 13 in the current class. a 1 b 1 -(1, 1) -(0, 0) -(6, 1) -(0, 0) +(1.0, 1.0) +(0.0, 0.0) +(6.0, 1.0) +(0.0, 0.0) diff --git a/modules/gdscript/tests/scripts/runtime/features/setter_chain_shared_types.out b/modules/gdscript/tests/scripts/runtime/features/setter_chain_shared_types.out index c51759f481..e82e31bbed 100644 --- a/modules/gdscript/tests/scripts/runtime/features/setter_chain_shared_types.out +++ b/modules/gdscript/tests/scripts/runtime/features/setter_chain_shared_types.out @@ -1,26 +1,26 @@ GDTEST_OK === -prop1 setter (0, 0) -prop1 setter (1, 0) +prop1 setter (0.0, 0.0) +prop1 setter (1.0, 0.0) --- prop1 setter <Inner> subprop getter -subprop setter (1, 0) +subprop setter (1.0, 0.0) === prop2 setter <Inner> subprop getter -subprop setter (1, 0) +subprop setter (1.0, 0.0) === -prop3 setter (0, 0) +prop3 setter (0.0, 0.0) prop3 getter -prop3 setter (1, 0) +prop3 setter (1.0, 0.0) --- prop3 setter <Inner> prop3 getter subprop getter -subprop setter (1, 0) +subprop setter (1.0, 0.0) === prop4 setter <Inner> prop4 getter subprop getter -subprop setter (1, 0) +subprop setter (1.0, 0.0) diff --git a/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out b/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out index 31b3b3a3a8..8617a65c33 100644 --- a/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out +++ b/modules/gdscript/tests/scripts/runtime/features/simple_setter_chain_call_setter.out @@ -1,4 +1,4 @@ GDTEST_OK -setting vec from (0, 0) to (2, 0) -setting vec from (0, 0) to (0, 2) -vec is (0, 0) +setting vec from (0.0, 0.0) to (2.0, 0.0) +setting vec from (0.0, 0.0) to (0.0, 2.0) +vec is (0.0, 0.0) diff --git a/modules/gdscript/tests/scripts/runtime/features/stringify.out b/modules/gdscript/tests/scripts/runtime/features/stringify.out index 7833b6e213..2463d70ef4 100644 --- a/modules/gdscript/tests/scripts/runtime/features/stringify.out +++ b/modules/gdscript/tests/scripts/runtime/features/stringify.out @@ -9,13 +9,13 @@ hello world [P: (0, 0), S: (0, 0)] (0.25, 0.25, 0.25) (0, 0, 0) -[X: (1, 0), Y: (0, 1), O: (0, 0)] -[N: (1, 2, 3), D: 4] -(1, 2, 3, 4) -[P: (0, 0, 0), S: (1, 1, 1)] -[X: (1, 0, 0), Y: (0, 1, 0), Z: (0, 0, 1)] -[X: (1, 0, 0), Y: (0, 1, 0), Z: (0, 0, 1), O: (0, 0, 0)] +[X: (1.0, 0.0), Y: (0.0, 1.0), O: (0.0, 0.0)] +[N: (1.0, 2.0, 3.0), D: 4] (1, 2, 3, 4) +[P: (0.0, 0.0, 0.0), S: (1.0, 1.0, 1.0)] +[X: (1.0, 0.0, 0.0), Y: (0.0, 1.0, 0.0), Z: (0.0, 0.0, 1.0)] +[X: (1.0, 0.0, 0.0), Y: (0.0, 1.0, 0.0), Z: (0.0, 0.0, 1.0), O: (0.0, 0.0, 0.0)] +(1.0, 2.0, 3.0, 4.0) hello hello/world RID(0) @@ -26,10 +26,10 @@ Node::[signal]property_list_changed [255, 0, 1] [-1, 0, 1] [-1, 0, 1] -[-1, 0, 1] -[-1, 0, 1] +[-1.0, 0.0, 1.0] +[-1.0, 0.0, 1.0] ["hello", "world"] -[(1, 1), (0, 0)] -[(1, 1, 1), (0, 0, 0)] -[(1, 0, 0, 1), (0, 0, 1, 1), (0, 1, 0, 1)] +[(1.0, 1.0), (0.0, 0.0)] +[(1.0, 1.0, 1.0), (0.0, 0.0, 0.0)] +[(1.0, 0.0, 0.0, 1.0), (0.0, 0.0, 1.0, 1.0), (0.0, 1.0, 0.0, 1.0)] [(1, 1, 1, 1), (0, 0, 0, 0)] |