From 991f4d8527bb7fcf95d35630f8c906646bbf6d39 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 29 Sep 2021 10:53:47 -0300 Subject: GDScript: Fix assignment with operation for properties --- .../runtime/features/property_with_operator_assignment.gd | 11 +++++++++++ .../runtime/features/property_with_operator_assignment.out | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd create mode 100644 modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.out (limited to 'modules/gdscript/tests') diff --git a/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd new file mode 100644 index 0000000000..3eb02816ed --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd @@ -0,0 +1,11 @@ +#GDTEST_OK +var prop : int = 0: + get: + return prop + set(value): + prop = value % 7 + +func test(): + for i in 7: + prop += 1 + print(prop) diff --git a/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.out b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.out new file mode 100644 index 0000000000..76157853f2 --- /dev/null +++ b/modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.out @@ -0,0 +1,8 @@ +GDTEST_OK +1 +2 +3 +4 +5 +6 +0 -- cgit v1.2.3