(t *testing.T)
| 59 | } |
| 60 | |
| 61 | func TestToCamelCaseWithDigits(t *testing.T) { |
| 62 | tests := []struct { |
| 63 | str string |
| 64 | want string |
| 65 | }{{ |
| 66 | str: "", |
| 67 | want: "", |
| 68 | }, { |
| 69 | str: " foo_bar ", |
| 70 | want: "FooBar", |
| 71 | }, { |
| 72 | str: "hi hello-hey-hallo", |
| 73 | want: "HiHelloHeyHallo", |
| 74 | }, { |
| 75 | str: "foo#bar", |
| 76 | want: "FooBar", |
| 77 | }, { |
| 78 | str: "foo2bar", |
| 79 | want: "Foo2Bar", |
| 80 | }, { |
| 81 | str: "пир2пир", |
| 82 | want: "Пир2Пир", |
| 83 | }, { |
| 84 | // Test that each substitution works |
| 85 | str: "word.word3word-WORD+Word_word~word(Word)Word{Word}Word[Word]Word:Word;", |
| 86 | want: "WordWord3WordWORDWordWordWordWordWordWordWordWordWordWord", |
| 87 | }, { |
| 88 | // Make sure numbers don't interact in a funny way. |
| 89 | str: "number-1234", |
| 90 | want: "Number1234", |
| 91 | }, |
| 92 | } |
| 93 | for i := range tests { |
| 94 | tt := tests[i] |
| 95 | t.Run(tt.str, func(t *testing.T) { |
| 96 | require.Equal(t, tt.want, ToCamelCaseWithDigits(tt.str)) |
| 97 | }) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func TestToCamelCaseWithInitialisms(t *testing.T) { |
| 102 | tests := []struct { |
nothing calls this directly
no test coverage detected