Skip to content

Commit ab05981

Browse files
committed
More tests
1 parent e16ec48 commit ab05981

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

strcase/opt.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package strcase
22

3-
import "sort"
3+
import (
4+
"sort"
5+
)
46

57
// A CaseConverter converts a string to a specific case.
68
type CaseConverter interface {

strcase/sentence_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ var vocabCases = []testCase{
2525
{"Six NASA Instruments Will Fly to Moon on Intuitive Machines Lander", "Six NASA instruments will fly to Moon on intuitive machines lander"},
2626
{"b. Next title text", "b. Next title text"},
2727
{"Axon Server connection", "Axon Server connection"},
28+
{"vale ale", "Vale ale"},
2829
}
2930

3031
func TestSentence(t *testing.T) {
@@ -41,13 +42,14 @@ func TestVocab(t *testing.T) {
4142
tc := strcase.NewSentenceConverter(
4243
strcase.UsingVocab([]string{
4344
"Vale Server",
44-
"\bI\b",
45+
`\bI\b`,
4546
"macOS",
4647
"[Cc]onfig",
4748
"NASA",
4849
"Moon",
4950
"Axon",
5051
"Axon Server",
52+
`\bale\b`,
5153
}),
5254
strcase.UsingPrefix(`^[a-z]\.\s`))
5355

strcase/title_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ var vocabTitles = []testCase{
2121
{"Understanding json and yaml", "Understanding JSON and YAML"},
2222
{"Develop File-Proxy Plugin", "Develop File-Proxy Plugin"},
2323
{"b. Next title text", "b. Next Title Text"},
24+
{"vale ale", "Vale ale"},
2425
}
2526

2627
func TestTitleVocab(t *testing.T) {
@@ -29,6 +30,7 @@ func TestTitleVocab(t *testing.T) {
2930
"iOS",
3031
"JSON",
3132
"YAML",
33+
`\bale\b`,
3234
}),
3335
strcase.UsingPrefix(`^[a-z]\.\s`))
3436

0 commit comments

Comments
 (0)