diff options
| author | Danil Alexeev <danil@alexeev.xyz> | 2023-02-15 17:41:46 +0300 |
|---|---|---|
| committer | Danil Alexeev <danil@alexeev.xyz> | 2023-02-15 17:41:46 +0300 |
| commit | d15511725acdfe90f9d5967119294b591becd8fa (patch) | |
| tree | a583082b6cff2e980ed0743917db870688f89c12 /modules/gdscript/tests/scripts | |
| parent | d2b1474da79a4dce5c2031b3a3fafe8aaa2a161f (diff) | |
| download | redot-engine-d15511725acdfe90f9d5967119294b591becd8fa.tar.gz | |
GDScript: Fix `MIN_INT` not representable as numeric literal
Diffstat (limited to 'modules/gdscript/tests/scripts')
| -rw-r--r-- | modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.gd | 17 | ||||
| -rw-r--r-- | modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.out | 16 |
2 files changed, 33 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.gd b/modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.gd new file mode 100644 index 0000000000..cf7fb1518c --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.gd @@ -0,0 +1,17 @@ +func test(): + print(-9223372036854775808 == (1 << 63)) + print(-2) + print(- 2) + print(---2) + print(3 - 2) + print(3-2) + print(3---2) + print(-3 - 2) + print(-3 - -2) + print(-(3 - 2)-2) + print([1, 2, 3][0]-1) + var t = 1 + print(t-1) + print(-0xFF) + print(1--0xFF) + print(floor(PI-1)) diff --git a/modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.out b/modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.out new file mode 100644 index 0000000000..c5958365ec --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/number_literals_with_sign.out @@ -0,0 +1,16 @@ +GDTEST_OK +true +-2 +-2 +-2 +1 +1 +1 +-5 +-1 +-3 +0 +0 +-255 +256 +2 |
