chore: add GUT test framework

This commit is contained in:
xiaji
2026-05-29 09:16:10 +08:00
parent 5741ba1dc0
commit 07fc763413
808 changed files with 76903 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
extends 'res://addons/gut/test.gd'
func test_passing():
assert_eq('one', 'one')
func test_failing():
assert_eq(1, 'two')
func test_pending_no_text():
pending()
func test_pending_with_text():
pending('this has text')
func test_parameterized_passing(p=use_parameters([1, 2, 3, 4])):
assert_gt(p, 0)
func test_parameterized_failing(p = use_parameters([[1, 2], [3, 4]])):
assert_eq(p[0], p[1])
func test_assert_called_failing():
var d = double(Node2D).new()
d.set_position(Vector2(1, 1))
d.get_name()
assert_called(d, 'get_position')