summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #59358 from strank/debug-inner-classesGeorge Marques2022-06-151-17/+29
|\
| * Extend test_compiler to also disassemble inner classesstrank2022-06-121-17/+29
| |
* | Merge pull request #61666 from nathanfranke/fix-match-bindGeorge Marques2022-06-152-0/+19
|\ \ | | | | | | gdscript: use correct error for unused bind match, suppress with underscore
| * | use correct error for unused bind match, suppress with underscoreNathan Franke2022-06-032-0/+19
| |/
* | Merge pull request #57151 from cdemirer/fix-match-array-dict-pattern-logic-errorGeorge Marques2022-06-144-0/+93
|\ \ | |/ |/| Fix logic errors in match-statement Array & Dictionary patterns
| * Fix logic errors in match-statement Array & Dictionary Patternscdemirer2022-03-024-0/+93
| |
* | Merge pull request #61440 from vnen/gdscript-scene-unique-nodesRémi Verschelde2022-05-316-4/+72
|\ \ | | | | | | GDScript: Support `%` in shorthand for `get_node`
| * | GDScript: Support `%` in shorthand for `get_node`George Marques2022-05-276-4/+72
| | | | | | | | | | | | | | | | | | The `%` is used in scene unique nodes. Now `%` can also be used instead of `$` for the shorthand, besides being allowed generally anywhere in the path as the prefix for a node name.
* | | Merge pull request #61279 from Trioct/fix-typed-array-assignmentRémi Verschelde2022-05-252-0/+4
|\ \ \
| * | | Fix const typed array assignmentTrioct2022-05-252-0/+4
| | | |
* | | | GDScript: Don't show redundant await warning on unknown typesGeorge Marques2022-05-242-0/+14
| |/ / |/| | | | | | | | Also avoid it when the type is known to be a signal.
* | | GDScript: Fix lambda captures in default argument valuesGeorge Marques2022-05-232-0/+9
| | |
* | | GDScript: Fix `if` after lambda being seen as ternaryGeorge Marques2022-05-232-0/+9
| | |
* | | GDScript: Do not allow standalone lambdasGeorge Marques2022-05-232-0/+5
|/ / | | | | | | | | They cannot be accessed in this case, so an error is shown to avoid misleading the uses, especially in case of named lambdas.
* | Merge pull request #55201 from Scony/fix-unreachable-code-false-positiveRémi Verschelde2022-05-182-0/+18
|\ \
| * | Fix 'unreachable-code' false-positive, fixes #55154Pawel Lampe2021-11-212-0/+18
| | |
* | | Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* | | Add a new HashMap implementationreduz2022-05-121-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* | | Merge pull request #59863 from cdemirer/fix-match-multiple-bind-single-patternRémi Verschelde2022-05-114-0/+16
|\ \ \ | | | | | | | | Fix issues with multiple bind patterns in match statement
| * | | Fix issues with multiple bind patterns in match statementcdemirer2022-04-044-0/+16
| | | |
* | | | Merge pull request #60732 from CalebJohn/matching_signature_regression_testRémi Verschelde2022-05-112-0/+16
|\ \ \ \
| * | | | Add regression test for gdscript valid function signatureCalebJohn2022-05-032-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, there was an issue where the gdscript analyzer incorrectly riased a validation error for code that had a default Dictionary, Array, or custom type.
* | | | | quote strings inside arrays and dictionariesNathan Franke2022-05-036-11/+11
|/ / / /
* | | | Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* | | | Merge pull request #60396 from vnen/gdscript-self-lambdaRémi Verschelde2022-04-272-0/+28
|\ \ \ \
| * | | | GDScript: Allow using self in lambdasGeorge Marques2022-04-242-0/+28
| | | | |
* | | | | Fixes GDScript define nested dictionary and array as constants #50285PastMoments2022-04-193-1/+64
|/ / / /
* | | | Make FileAccess and DirAccess classes reference counted.bruvzg2022-04-112-7/+6
| | | |
* | | | Merge pull request #59885 from Jayman2000/autoload-inheritance-messageRémi Verschelde2022-04-041-1/+1
|\ \ \ \
| * | | | Improve autoload inheritance error messageJason Yundt2022-04-041-1/+1
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Autoloaded scripts should always inherit from Node. When you run a project that tries to autoload a script which doesn’t inherit from Node, then Godot gives an error. Before this change, the error said “Script does not inherit a Node”. That error message is a little bit misleading. If a class inherits a Node, then one of its superclasses has a Node. If a class inherits _from_ Node, then one of its superclasses is Node. This change corrects that mistake. Fixes #59884.
* / / / Zero initialize all pointer class and struct membersRémi Verschelde2022-04-041-2/+2
|/ / / | | | | | | | | | | | | This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
* | | Remove VARIANT_ARG* macrosreduz2022-03-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
* | | GDScript: Check if method signature matches the parentGeorge Marques2022-03-0612-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To guarantee polymorphism, a method signature must be compatible with the parent. This checks if: 1. Return type is the same. 2. The subclass method takes at least the same amount of parameters. 3. The matching parameters have the same type. 4. If the subclass takes more parameters, all of the extra ones have a default value. 5. If the superclass has default values, so must have the subclass. There's a few test cases to ensure this holds up.
* | | Add test cases for accessing parent elements from child classstrank2022-03-042-0/+56
| |/ |/|
* | Refactor some object type checking code with `cast_to`Rémi Verschelde2022-02-081-10/+8
| | | | | | | | Less stringly typed logic, and less String allocations and comparisons.
* | Merge pull request #57591 from vnen/gdscript-enum-fixesRémi Verschelde2022-02-0425-1/+241
|\ \
| * | GDScript: Treat enum values as int and enum types as dictionaryGeorge Marques2022-02-034-0/+48
| | | | | | | | | | | | | | | | | | | | | Since enums resolve to a dictionary at runtime, calling dictionary methods on an enum type is a valid use case. This ensures this is true by adding test cases. This also makes enum values be treated as ints when used in operations.
| * | GDScript: Allow tests to run on release buildsGeorge Marques2022-02-033-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix compilation issues by disabling warnings on release builds. This also strips warnings from expected result before the comparison to avoid false mismatches. - Add a `#debug-only` flag to tests. Must be the first line of the test script. Those won't run with release builds. Can be used for test cases that rely on checks only available on debug builds.
| * | GDScript: Consolidate behavior for assigning enum typesGeorge Marques2022-02-0318-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes sure that assigning values to enum-typed variables are consistent. Same enum is always valid, different enum is always invalid (without casting) and assigning `int` creates a warning if there is no casting. There are new test cases to ensure this behavior doesn't break in the future.
* | | Merge pull request #57052 from KoBeWi/nosortRémi Verschelde2022-01-231-1/+1
|\ \ \
| * | | Don't sort printed Dictionarykobewi2022-01-221-1/+1
| |/ /
* | | Merge pull request #55214 from Scony/fix-gdscript-crash-2Rémi Verschelde2022-01-222-0/+4
|\ \ \ | |/ / |/| | Fix GDScript parser crash on 'dollar mixed with assignment' expression
| * | Fix GDScript parser crash on 'dollar mixed with assignment' expressionPawel Lampe2021-11-212-0/+4
| |/ | | | | | | fixes #53696
* | GDScript: Fix parsing default parameter values from function callsstrank2022-01-134-0/+52
| |
* | Fix multiple missing UTF-8 decoding.bruvzg2022-01-061-4/+4
| |
* | Merge pull request #56483 from vnen/gdscript-warning-annotationRémi Verschelde2022-01-052-0/+19
|\ \ | | | | | | Add annotation to ignore warnings
| * | GDScript: Add annotation to ignore warningsGeorge Marques2022-01-042-0/+19
| | |
* | | Update copyright statements to 2022Rémi Verschelde2022-01-035-10/+10
|/ / | | | | | | Happy new year to the wonderful Godot community!
* | Fix various typosluz paz2022-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn` Update editor/import/resource_importer_layered_texture.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update doc/classes/TileSetScenesCollectionSource.xml Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/gui/graph_edit.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/resources/animation.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/resources/animation.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/resources/animation.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Update scene/gui/rich_text_label.cpp Co-authored-by: Raul Santos <raulsntos@gmail.com> Revert previously committed change
* | Fix shadowed global identifier warning duplicationYuri Roubinsky2021-12-131-4/+4
| |