(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestSplitPascalCase(t *testing.T) { |
| 78 | for _, v := range []struct { |
| 79 | in string |
| 80 | expected stringList |
| 81 | }{ |
| 82 | { |
| 83 | "abcDEFgh", |
| 84 | stringList{"abc", "D", "E", "Fgh"}, |
| 85 | }, { |
| 86 | "ABC_DEF", |
| 87 | stringList{"A", "B", "C_D", "E", "F"}, |
| 88 | }, { |
| 89 | "ATitledString", |
| 90 | stringList{"A", "Titled", "String"}, |
| 91 | }, { |
| 92 | "anUntitledString", |
| 93 | stringList{"an", "Untitled", "String"}, |
| 94 | }, { |
| 95 | "xxx123ABC456DEf789ghi", |
| 96 | stringList{"xxx123A", "B", "C456D", "Ef789ghi"}, |
| 97 | }, |
| 98 | } { |
| 99 | got := Functions{}.SplitPascalCase(v.in) |
| 100 | if !reflect.DeepEqual(v.expected, got) { |
| 101 | t.Errorf("SplitPascalCase(%#v) returned unexpected value. Expected: %#v, got: %#v", |
| 102 | v.in, v.expected, got) |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | func TestTitle(t *testing.T) { |
| 108 | in := stringList{"abc", "dE f", "G hi", "JKL"} |
nothing calls this directly
no test coverage detected