79 lines
1.8 KiB
GDScript
79 lines
1.8 KiB
GDScript
# This script is used by test_test.gd/TestTestStateChecking.
|
|
# Each of these tests are run by that test class and the
|
|
# pass/fail count is checked.
|
|
extends GutTest
|
|
|
|
class TestIsPassing:
|
|
extends GutTest
|
|
|
|
func test_is_passing_returns_true_when_test_is_passing():
|
|
assert_true(true, 'should pass')
|
|
assert_true(is_passing(), 'should pass')
|
|
|
|
func test_is_passing_returns_false_when_test_is_failing():
|
|
assert_true(false, 'should fail')
|
|
assert_false(is_passing(), 'should pass')
|
|
|
|
func test_is_passing_false_by_default():
|
|
assert_false(is_passing(), 'this should pass')
|
|
|
|
func test_is_passing_returns_true_before_test_fails():
|
|
assert_true(true, 'should pass')
|
|
assert_true(is_passing(), 'should pass')
|
|
assert_true(false, 'should fail')
|
|
|
|
class TestIsFailing:
|
|
extends GutTest
|
|
|
|
func test_is_failing_returns_true_when_failing():
|
|
assert_false(true, 'should fail')
|
|
assert_true(is_failing(), 'should pass')
|
|
|
|
func test_is_failing_returns_false_when_passing():
|
|
assert_true(true, 'should pass')
|
|
assert_false(is_failing(), 'should pass')
|
|
|
|
func test_is_failing_returns_false_by_default():
|
|
assert_false(is_failing())
|
|
|
|
func test_is_failing_returns_false_before_test_passes():
|
|
assert_false(is_failing(), 'should pass')
|
|
assert_true(true, 'should pass')
|
|
|
|
class TestUseIsPassingInBeforeAll:
|
|
extends GutTest
|
|
|
|
func before_all():
|
|
var is_it = is_passing()
|
|
|
|
func test_nothing():
|
|
pass_test('pass it')
|
|
|
|
class TestUseIsPassingInAfterAll:
|
|
extends GutTest
|
|
|
|
func after_all():
|
|
var is_it = is_passing()
|
|
|
|
func test_nothing():
|
|
pass_test('pass it')
|
|
|
|
|
|
class TestUseIsFailingInBeforeAll:
|
|
extends GutTest
|
|
|
|
func before_all():
|
|
var is_it = is_failing()
|
|
|
|
func test_nothing():
|
|
pass_test('pass it')
|
|
|
|
class TestUseIsFailingInAfterAll:
|
|
extends GutTest
|
|
|
|
func after_all():
|
|
var is_it = is_failing()
|
|
|
|
func test_nothing():
|
|
pass_test('pass it')
|