-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassert_true_test.go
45 lines (36 loc) · 918 Bytes
/
assert_true_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package actually
import (
"testing"
)
func TestTrue(t *testing.T) {
// pass
Got(1 == 1).True(t) //lint:ignore SA4000 this is test
Got("foo" == "foo").True(t) //lint:ignore SA4000 this is test
Got(1 == 2).False(t)
Got("foo" == "hoo").False(t)
// test name
Got(2 == 2).True(t, "True test") //lint:ignore SA4000 this is test
Got(2 == 3).False(t, "False test")
// fail now
//actually.Got(1==2).FailNow().True(t)
// fail
// actually.Got(12).True(t)
// actually.Got(1==2).True(t)
// actually.Got(12).False(t)
// actually.Got(1==1).False(t)
// actually.Got("foo"=="foo").False(t)
}
func TestTrue_Fail(t *testing.T) {
stubConfirm(t, func() {
Got(false).True(t)
}, message_ExpectTrue)
stubConfirm(t, func() {
Got(12).True(t)
}, reason_WrongType)
stubConfirm(t, func() {
Got(true).False(t)
}, message_ExpectFalse)
stubConfirm(t, func() {
Got(12).False(t)
}, reason_WrongType)
}