mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console/frontend: better error formatting
This commit is contained in:
22
common/helpers/strings_test.go
Normal file
22
common/helpers/strings_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user