-
Notifications
You must be signed in to change notification settings - Fork 2
/
convert_test.go
101 lines (88 loc) · 2.37 KB
/
convert_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
package main
import (
"testing"
)
func TestSnakeCaseDasherized(t *testing.T) {
actual := SnakeCase("brave-tapir")
expected := "brave_tapir"
if actual != expected {
t.Errorf("SnakeCase(): %v, expected %v", actual, expected)
}
}
func TestSnakeCaseDromedar(t *testing.T) {
actual := SnakeCase("braveTapir")
expected := "brave_tapir"
if actual != expected {
t.Errorf("SnakeCase(): %v, expected %v", actual, expected)
}
}
func TestSnakeCaseCamel(t *testing.T) {
actual := SnakeCase("BraveTapir")
expected := "brave_tapir"
if actual != expected {
t.Errorf("SnakeCase(): %v, expected %v", actual, expected)
}
}
func TestSnakeCaseSpaceSeparated(t *testing.T) {
actual := SnakeCase("Brave tapir")
expected := "brave_tapir"
if actual != expected {
t.Errorf("SnakeCase(): %v, expected %v", actual, expected)
}
}
func TestSnakeCaseTitleCase(t *testing.T) {
actual := SnakeCase("Brave tapir")
expected := "brave_tapir"
if actual != expected {
t.Errorf("SnakeCase(): %v, expected %v", actual, expected)
}
}
func TestBoaCase(t *testing.T) {
actual := BoaCase("brave_tapir")
expected := "BRAVE_TAPIR"
if actual != expected {
t.Errorf("BoaCase(): %v, expected %v", actual, expected)
}
}
func TestCamelCase(t *testing.T) {
actual := CamelCase("brave_tapir")
expected := "BraveTapir"
if actual != expected {
t.Errorf("CamelCase(): %v, expected %v", actual, expected)
}
}
func TestDromedarCase(t *testing.T) {
actual := DromedarCase("brave_tapir")
expected := "braveTapir"
if actual != expected {
t.Errorf("DromedarCase(): %v, expected %v", actual, expected)
}
}
func TestDasherized(t *testing.T) {
actual := Dasherized("brave_tapir")
expected := "brave-tapir"
if actual != expected {
t.Errorf("Dasherize(): %v, expected %v", actual, expected)
}
}
func TestSpaceSeparated(t *testing.T) {
actual := SpaceSeparated("brave_tapir")
expected := "brave tapir"
if actual != expected {
t.Errorf("SpaceSeparated(): %v, expected %v", actual, expected)
}
}
func TestTitleCase(t *testing.T) {
actual := TitleCase("brave_tapir")
expected := "Brave Tapir"
if actual != expected {
t.Errorf("SpaceSeparated(): %v, expected %v", actual, expected)
}
}
func TestLowercaseLetters(t *testing.T) {
actual := LowercaseLetters("123 tapirs WILL rule ___EARTH!")
expected := "tapirswillruleearth"
if actual != expected {
t.Errorf("LowercaseLetters(): %v, expected %v", actual, expected)
}
}