-
Notifications
You must be signed in to change notification settings - Fork 0
/
cases_test.go
122 lines (120 loc) · 2.88 KB
/
cases_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package sublist
// This is an auto-generated file. Do not change it manually. Run the generator to update the file.
// See https://github.com/exercism/go#synchronizing-tests-and-instructions
// Source: exercism/problem-specifications
// Commit: 5bf8c7d sublist test: substring does not make a sublist (#1866)
var testCases = []struct {
description string
listOne []int
listTwo []int
expected Relation
}{
{
description: "empty lists",
listOne: []int{},
listTwo: []int{},
expected: "equal",
},
{
description: "empty list within non empty list",
listOne: []int{},
listTwo: []int{1, 2, 3},
expected: "sublist",
},
{
description: "non empty list contains empty list",
listOne: []int{1, 2, 3},
listTwo: []int{},
expected: "superlist",
},
{
description: "list equals itself",
listOne: []int{1, 2, 3},
listTwo: []int{1, 2, 3},
expected: "equal",
},
{
description: "different lists",
listOne: []int{1, 2, 3},
listTwo: []int{2, 3, 4},
expected: "unequal",
},
{
description: "false start",
listOne: []int{1, 2, 5},
listTwo: []int{0, 1, 2, 3, 1, 2, 5, 6},
expected: "sublist",
},
{
description: "consecutive",
listOne: []int{1, 1, 2},
listTwo: []int{0, 1, 1, 1, 2, 1, 2},
expected: "sublist",
},
{
description: "sublist at start",
listOne: []int{0, 1, 2},
listTwo: []int{0, 1, 2, 3, 4, 5},
expected: "sublist",
},
{
description: "sublist in middle",
listOne: []int{2, 3, 4},
listTwo: []int{0, 1, 2, 3, 4, 5},
expected: "sublist",
},
{
description: "sublist at end",
listOne: []int{3, 4, 5},
listTwo: []int{0, 1, 2, 3, 4, 5},
expected: "sublist",
},
{
description: "at start of superlist",
listOne: []int{0, 1, 2, 3, 4, 5},
listTwo: []int{0, 1, 2},
expected: "superlist",
},
{
description: "in middle of superlist",
listOne: []int{0, 1, 2, 3, 4, 5},
listTwo: []int{2, 3},
expected: "superlist",
},
{
description: "at end of superlist",
listOne: []int{0, 1, 2, 3, 4, 5},
listTwo: []int{3, 4, 5},
expected: "superlist",
},
{
description: "first list missing element from second list",
listOne: []int{1, 3},
listTwo: []int{1, 2, 3},
expected: "unequal",
},
{
description: "second list missing element from first list",
listOne: []int{1, 2, 3},
listTwo: []int{1, 3},
expected: "unequal",
},
{
description: "first list missing additional digits from second list",
listOne: []int{1, 2},
listTwo: []int{1, 22},
expected: "unequal",
},
{
description: "order matters to a list",
listOne: []int{1, 2, 3},
listTwo: []int{3, 2, 1},
expected: "unequal",
},
{
description: "same digits but different numbers",
listOne: []int{1, 0, 1},
listTwo: []int{10, 1},
expected: "unequal",
},
}