Fixes 2: Fixing regression for issue 2

Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
Kris Nóva 2021-02-13 13:30:08 -08:00
parent 414bfb6aa1
commit afcb80f913
13 changed files with 127 additions and 3 deletions

22
test/regression_test.go Normal file
View file

@ -0,0 +1,22 @@
package test
import (
"testing"
"github.com/kris-nova/photoprism-client-go"
)
// Trailing slash issue
// https://github.com/kris-nova/photoprism-client-go/issues/2
func TestRegressionIssue2(t *testing.T) {
testStrings := []string{"localhost/", "localhost///////", "localhost//"}
goal := "localhost"
for _, str := range testStrings {
client := photoprism.New(str)
if client.ConnectionString() != goal {
t.Error("Failed to trim suffix / in client connection string")
t.FailNow()
}
}
}