You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
structure changes
This commit is contained in:
31
tools/variables/transform_test.go
Normal file
31
tools/variables/transform_test.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package variables
|
||||
|
||||
import "testing"
|
||||
|
||||
type testSplitCapitalize struct {
|
||||
name string
|
||||
result string
|
||||
}
|
||||
|
||||
var testSplitCapitalizeCases = []testSplitCapitalize{
|
||||
{"loremIpsum", "Lorem ipsum"},
|
||||
{"LoremIpsum", "Lorem ipsum"},
|
||||
{"loremipsum", "Loremipsum"},
|
||||
{"YouTube", "YouTube"},
|
||||
{"GitHub", "GitHub"},
|
||||
{"GooglePlus", "Google Plus"},
|
||||
{"Facebook", "Facebook"},
|
||||
}
|
||||
|
||||
func TestSplitCapitalize(t *testing.T) {
|
||||
for _, pair := range testSplitCapitalizeCases {
|
||||
v := SplitCapitalize(pair.name)
|
||||
if v != pair.result {
|
||||
t.Error(
|
||||
"For", pair.name,
|
||||
"expected", pair.result,
|
||||
"got", v,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user