@@ -27,3 +27,34 @@ func TestMergeSlices(t *testing.T) {
27
27
resultIS := MergeSlices ([]int {}, []int {1 , 2 }, []int {4 }, nil )
28
28
assert .EqualValues (t , []int {1 , 2 , 4 }, resultIS )
29
29
}
30
+
31
+ func TestEqualSliceValues (t * testing.T ) {
32
+ tests := []struct {
33
+ in1 []string
34
+ in2 []string
35
+ out bool
36
+ }{{
37
+ in1 : []string {"" , "ab" , "12" , "ab" },
38
+ in2 : []string {"12" , "ab" },
39
+ out : false ,
40
+ }, {
41
+ in1 : nil ,
42
+ in2 : nil ,
43
+ out : true ,
44
+ }, {
45
+ in1 : []string {"AA" , "AA" , "2" , " " },
46
+ in2 : []string {"2" , "AA" , " " , "AA" },
47
+ out : true ,
48
+ }, {
49
+ in1 : []string {"AA" , "AA" , "2" , " " },
50
+ in2 : []string {"2" , "2" , " " , "AA" },
51
+ out : false ,
52
+ }}
53
+
54
+ for _ , tc := range tests {
55
+ assert .EqualValues (t , tc .out , EqualSliceValues (tc .in1 , tc .in2 ), "could not correctly process input: '%#v', %#v" , tc .in1 , tc .in2 )
56
+ }
57
+
58
+ assert .True (t , EqualSliceValues ([]bool {true , false , false }, []bool {false , false , true }))
59
+ assert .False (t , EqualSliceValues ([]bool {true , false , false }, []bool {true , false , true }))
60
+ }
0 commit comments