diff options
author | George Marques <george@gmarqu.es> | 2021-09-29 10:53:47 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-09-29 10:54:16 -0300 |
commit | 991f4d8527bb7fcf95d35630f8c906646bbf6d39 (patch) | |
tree | d1b80c748e9fa2980b2e161737f5162df9aaa775 /modules/gdscript/tests/scripts/runtime | |
parent | c1f59139b40f40907b0507a84ec3515c5cc4794b (diff) |
GDScript: Fix assignment with operation for properties
Diffstat (limited to 'modules/gdscript/tests/scripts/runtime')
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.gd | 11 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/runtime/features/property_with_operator_assignment.out | 8 |
2 files changed, 19 insertions, 0 deletions
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 |