MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / TestNameFormat

Function TestNameFormat

pkg/sql2code/parser/nameFormat_test.go:7–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestNameFormat(t *testing.T) {
8 names := [][]string{
9 {"id_", "_id", "id", "iD", "ID", "Id", "order_id", "orderId", "orderID", "OrderID"},
10 {"ip_", "_ip", "ip", "iP", "IP", "Ip", "host_ip", "hostIp", "hostIP", "HostIP"},
11 {"url_", "_url", "url", "uRL", "URL", "Url", "blog_url", "blogUrl", "blogURL", "BlogURL"},
12 {"_user_name", "user_name", "userName", "UserName"},
13 {"_zh_中文", "zh_中文", "中文zh"},
14 }
15
16 for _, ns := range names {
17 var convertNames []string
18 var convertNames2 []string
19 var convertNames3 []string
20 for _, name := range ns {
21 convertNames = append(convertNames, toCamel(name))
22 convertNames2 = append(convertNames2, customToCamel(name))
23 convertNames3 = append(convertNames3, customToSnake(name))
24 }
25 t.Log("source: ", ns)
26 t.Log("toCamel: ", convertNames)
27 t.Log("customToCamel:", convertNames2)
28 t.Log("customToSnake:", convertNames3)
29 println()
30 }
31}

Callers

nothing calls this directly

Calls 3

toCamelFunction · 0.85
customToCamelFunction · 0.85
customToSnakeFunction · 0.85

Tested by

no test coverage detected