MCPcopy
hub / github.com/pocketbase/pocketbase / TestColumnify

Function TestColumnify

tools/inflector/inflector_test.go:32–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestColumnify(t *testing.T) {
33 scenarios := []struct {
34 val string
35 expected string
36 }{
37 {"", ""},
38 {" ", ""},
39 {"123", "123"},
40 {"Test.", "Test."},
41 {" test ", "test"},
42 {"test1.test2", "test1.test2"},
43 {"@test!abc", "@testabc"},
44 {"#test?abc", "#testabc"},
45 {"123test(123)#", "123test123#"},
46 {"test1--test2", "test1--test2"},
47 }
48
49 for i, s := range scenarios {
50 t.Run(fmt.Sprintf("%d_%#v", i, s.val), func(t *testing.T) {
51 result := inflector.Columnify(s.val)
52 if result != s.expected {
53 t.Fatalf("Expected %q, got %q", s.expected, result)
54 }
55 })
56 }
57}
58
59func TestSentenize(t *testing.T) {
60 scenarios := []struct {

Callers

nothing calls this directly

Calls 2

ColumnifyFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…