Files
strom/util/case_test.go
T
adman f6001c8b22 mojang cant get their cases straight
i had to implement like 4 cases just  to parse that file
2026-04-21 09:38:14 +02:00

30 lines
589 B
Go

package util_test
import (
"testing"
"github.com/admin-else/strom/util"
)
func TestCamelCase(t *testing.T) {
tests := []struct {
input string
expected string
}{
{"hello world", "HelloWorld"},
{"test_case", "TestCase"},
{"simple-test", "SimpleTest"},
{"already.Camel", "AlreadyCamel"},
{"UPPER_CASE", "UPPERCASE"},
{"mixed_Case_string", "MixedCaseString"},
{"", ""},
}
for _, test := range tests {
result := util.CamelCase(test.input)
if result != test.expected {
t.Errorf("CamelCase(%q) = %q; expected %q", test.input, result, test.expected)
}
}
}