-
Notifications
You must be signed in to change notification settings - Fork 2
/
sort_test.go
74 lines (68 loc) · 1.44 KB
/
sort_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
package gorean
import (
"testing"
"github.com/stretchr/testify/assert"
)
var (
dummyQuestionSortKoreanEnglishNumber = []string{"ㄱ", "a", "1", "ㄴ", "b", "2", "ㄷ", "c", "3"}
dummyAnswerSortKoreanEnglishNumber = []string{"1", "2", "3", "a", "b", "c", "ㄱ", "ㄴ", "ㄷ"}
dummyQuestionSortKorean = []string{
"고동",
"동백",
"왕초",
"고등",
"마장동",
"하기스",
"고고학자",
"고무",
"까치꾸치",
"밥상머리",
"사자왕왕",
"고황",
"고창",
"창고",
"김치볶음밥",
"자루소바오이시",
}
dummyAnswerSortKoreanDesc = []string{
"하기스",
"창고",
"자루소바오이시",
"왕초",
"사자왕왕",
"밥상머리",
"마장동",
"동백",
"까치꾸치",
"김치볶음밥",
"고황",
"고창",
"고무",
"고등",
"고동",
"고고학자",
}
dummyAnswerSortKoreanAsc = []string{
"고고학자",
"고동",
"고등",
"고무",
"고창",
"고황",
"김치볶음밥",
"까치꾸치",
"동백",
"마장동",
"밥상머리",
"사자왕왕",
"왕초",
"자루소바오이시",
"창고",
"하기스",
}
)
func Test_Sort(t *testing.T) {
assert.Equal(t, dummyAnswerSortKoreanEnglishNumber, Sort(dummyQuestionSortKoreanEnglishNumber, SortOptAsc), "equal")
assert.Equal(t, dummyAnswerSortKoreanAsc, Sort(dummyQuestionSortKorean, SortOptAsc))
assert.Equal(t, dummyAnswerSortKoreanDesc, Sort(dummyQuestionSortKorean, SortOptDesc))
}