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
|
func TestStringSliceEqual(t *testing.T) {
Convey("TestStringSliceEqualIfBothNotNil", t, func() {
Convey("Given two string slice which are both not nil", func() {
a := []string{"hello", "goconvey"}
b := []string{"hello", "goconvey"}
Convey("When the comparision is done", func() {
result := StringSliceEqual(a, b)
Convey("Then the result should be true", func() {
So(result, ShouldBeTrue)
})
})
})
})
Convey("TestStringSliceEqualIfBothNil", t, func() {
Convey("Given two string slice which are both nil", func() {
var a []string = nil
var b []string = nil
Convey("When the comparision is done", func() {
result := StringSliceEqual(a, b)
Convey("Then the result should be true", func() {
So(result, ShouldBeTrue)
})
})
})
})
Convey("TestStringSliceNotEqualIfNotBothNil", t, func() {
Convey("Given two string slice which are both nil", func() {
a := []string(nil)
b := []string{}
Convey("When the comparision is done", func() {
result := StringSliceEqual(a, b)
Convey("Then the result should be false", func() {
So(result, ShouldBeFalse)
})
})
})
})
Convey("TestStringSliceNotEqualIfBothNotNil", t, func() {
Convey("Given two string slice which are both not nil", func() {
a := []string{"hello", "world"}
b := []string{"hello", "goconvey"}
Convey("When the comparision is done", func() {
result := StringSliceEqual(a, b)
Convey("Then the result should be false", func() {
So(result, ShouldBeFalse)
})
})
})
})
}
|