-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaliases_test.go
49 lines (42 loc) · 885 Bytes
/
aliases_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
46
47
48
49
package actually
import (
"os"
"testing"
)
func TestActual(t *testing.T) {
a := Actual("g")
if a.got != "g" {
t.Errorf("Actual method was wrong. Actually got %s", a.got)
}
ac := &testingA{}
ac.Actual("G")
if ac.got != "G" {
t.Errorf("Actual method was wrong. Actually got %s", ac.got)
}
}
func TestWant(t *testing.T) {
a := Want("e")
if a.expect != "e" {
t.Errorf("Want method was wrong. Actually got %s", a.expect)
}
ac := &testingA{}
ac.Want("E")
if ac.expect != "E" {
t.Errorf("Want method was wrong. Actually got %s", ac.expect)
}
}
func TestFatal(t *testing.T) {
a := Got("g").Fatal()
if !*a.failNow {
t.Error("expect failNow is false")
}
}
func TestFatalOn(t *testing.T) {
if os.Getenv(envKey_FailNow) != "" {
t.Error("Already set ENV somehow")
}
FatalOn(t)
if os.Getenv(envKey_FailNow) == "" {
t.Error("expect failNow is false")
}
}