Files
akvorado/common/helpers/strings_test.go
Vincent Bernat 8be1bca4fd license: AGPL-3.0-only
```
git ls-files \*.js \*.go \
  | xargs sed -i '1i // SPDX-FileCopyrightText: 2022 Free Mobile\n// SPDX-License-Identifier: AGPL-3.0-only\n'
git ls-files \*.vue \
  | xargs sed -i '1i <!-- SPDX-FileCopyrightText: 2022 Free Mobile -->\n<!-- SPDX-License-Identifier: AGPL-3.0-only -->\n'
```
2022-06-29 11:42:28 +02:00

26 lines
487 B
Go

// SPDX-FileCopyrightText: 2022 Free Mobile
// SPDX-License-Identifier: AGPL-3.0-only
package helpers
import "testing"
func TestCapitalize(t *testing.T) {
cases := []struct {
In string
Out string
}{
{"", ""},
{"Hello", "Hello"},
{"bye", "Bye"},
{" nothing", " nothing"},
{"école", "École"},
}
for _, tc := range cases {
got := Capitalize(tc.In)
if diff := Diff(got, tc.Out); diff != "" {
t.Errorf("Capitalize(%q) (-got, +want):\n%s", tc.In, diff)
}
}
}