From c0083c0f90238f0eec01604dd9c952c8c5dc3c22 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Mon, 19 Apr 2021 20:50:52 +0200 Subject: Add dozens of new integration tests to the GDScript test suite This also ignores `.out` files in the file format static checks. --- modules/gdscript/tests/scripts/parser/features/array.gd | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 modules/gdscript/tests/scripts/parser/features/array.gd (limited to 'modules/gdscript/tests/scripts/parser/features/array.gd') diff --git a/modules/gdscript/tests/scripts/parser/features/array.gd b/modules/gdscript/tests/scripts/parser/features/array.gd new file mode 100644 index 0000000000..828ce8d134 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/array.gd @@ -0,0 +1,16 @@ +func test(): + # Indexing from the beginning: + print([1, 2, 3][0]) + print([1, 2, 3][1]) + print([1, 2, 3][2]) + + # Indexing from the end: + print([1, 2, 3][-1]) + print([1, 2, 3][-2]) + print([1, 2, 3][-3]) + + # Float indices are currently allowed, but should probably be an error? + print([1, 2, 3][0.4]) + print([1, 2, 3][0.8]) + print([1, 2, 3][1.0]) + print([1, 2, 3][-1.0]) -- cgit v1.2.3