diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-29 16:39:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-29 16:39:21 +0200 |
commit | bd573f8abac3122a4b2362a1e0224b79e8d9f2fc (patch) | |
tree | 55dec24634dd7fd2926e2657aaad5684c0488e35 /modules/gdscript/tests | |
parent | 5e609d0e8cecedc68d842fd9f1171d74c4584028 (diff) | |
parent | 991f4d8527bb7fcf95d35630f8c906646bbf6d39 (diff) |
Merge pull request #53215 from vnen/gdscript-property-assignment-op
Diffstat (limited to 'modules/gdscript/tests')
-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 |