forked from godot-rust/gdext
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
extends ArrayTest | ||
|
||
var test_suite: TestSuite = TestSuite.new() | ||
|
||
# In order to reproduce the bahevaior discovered in https://github.com/godot-rust/gdext/issues/138 | ||
# we must inherit a Godot Node. Because of this we can't just inherit TesSuite like the rest of the tests. | ||
func assert_that(what: bool, message: String = "") -> bool: | ||
return test_suite.assert_that(what, message) | ||
|
||
func assert_eq(left, right, message: String = "") -> bool: | ||
return test_suite.assert_eq(left, right, message) | ||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready(): | ||
pass | ||
|
||
func test_vector_array_return_from_user_func(): | ||
var array: Array = return_typed_array(2) | ||
assert_eq(array, [1,2]) | ||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters