add gut testing framework
This commit is contained in:
parent
b4ca5f576c
commit
197704b82b
29 changed files with 5720 additions and 0 deletions
27
game/test/unit/test_example.gd
Normal file
27
game/test/unit/test_example.gd
Normal file
|
@ -0,0 +1,27 @@
|
|||
extends "res://addons/gut/test.gd"
|
||||
func before_each():
|
||||
gut.p("ran setup", 2)
|
||||
|
||||
func after_each():
|
||||
gut.p("ran teardown", 2)
|
||||
|
||||
func before_all():
|
||||
gut.p("ran run setup", 2)
|
||||
|
||||
func after_all():
|
||||
gut.p("ran run teardown", 2)
|
||||
|
||||
func test_assert_eq_number_not_equal():
|
||||
assert_eq(1, 2, "Should fail. 1 != 2")
|
||||
|
||||
func test_assert_eq_number_equal():
|
||||
assert_eq('asdf', 'asdf', "Should pass")
|
||||
|
||||
func test_assert_true_with_true():
|
||||
assert_true(true, "Should pass, true is true")
|
||||
|
||||
func test_assert_true_with_false():
|
||||
assert_true(false, "Should fail")
|
||||
|
||||
func test_something_else():
|
||||
assert_true(false, "didn't work")
|
Loading…
Add table
Add a link
Reference in a new issue