From d580158c3b9bab8cf87db46803643dd05c2e0be7 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Mon, 1 Jun 2020 13:31:49 +0200 Subject: [PATCH] Backend: Add title capitalization tests Signed-off-by: Michael Mayer --- pkg/txt/capitalization_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/txt/capitalization_test.go b/pkg/txt/capitalization_test.go index b253dd61a..f5dae4c98 100644 --- a/pkg/txt/capitalization_test.go +++ b/pkg/txt/capitalization_test.go @@ -73,6 +73,15 @@ func TestTitle(t *testing.T) { t.Run("youtube", func(t *testing.T) { assert.Equal(t, "YouTube", Title("youtube")) }) + t.Run("interpunctio-1", func(t *testing.T) { + assert.Equal(t, "This,,, Is !a ! a Very Strange Title....", Title("this,,, is !a ! a very strange title....")) + }) + t.Run("interpunctio-2", func(t *testing.T) { + assert.Equal(t, "This Is a Not So Strange Title!", Title("This is a not so strange title!")) + }) + t.Run("horse", func(t *testing.T) { + assert.Equal(t, "A Horse Is Not a Cow :-)", Title("a horse is not a cow :-)")) + }) } func TestTitleFromFileName(t *testing.T) {