-
Notifications
You must be signed in to change notification settings - Fork 6
/
struct_cache_helper_test.go
59 lines (55 loc) · 1.11 KB
/
struct_cache_helper_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
50
51
52
53
54
55
56
57
58
59
package cache
import (
"testing"
)
func TestHelperPointer(t *testing.T) {
type A struct{}
a := A{}
b := &a
c := "hello"
d := &c
e := make(map[string]string)
f := &e
g := []string{}
h := &g
i := 11
j := &i
k := 11.11
l := &k
if isPointer(a) {
t.Errorf("expected a is not poiter, got - it is")
}
if !isPointer(b) {
t.Errorf("expected a is poiter, got - it is not")
}
if isPointer(c) {
t.Errorf("expected a is not poiter, got - it is")
}
if !isPointer(d) {
t.Errorf("expected a is poiter, got - it is not")
}
if isPointer(e) {
t.Errorf("expected a is not poiter, got - it is")
}
if !isPointer(f) {
t.Errorf("expected a is poiter, got - it is not")
}
if isPointer(g) {
t.Errorf("expected a is not poiter, got - it is")
}
if !isPointer(h) {
t.Errorf("expected a is poiter, got - it is not")
}
if isPointer(i) {
t.Errorf("expected a is not poiter, got - it is")
}
if !isPointer(j) {
t.Errorf("expected a is poiter, got - it is not")
}
if isPointer(k) {
t.Errorf("expected a is not poiter, got - it is")
}
if !isPointer(l) {
t.Errorf("expected a is poiter, got - it is not")
}
}