photoprism-client-go/test/regression_test.go
Kris Nóva afcb80f913 Fixes 2: Fixing regression for issue 2
Signed-off-by: Kris Nóva <kris@nivenly.com>
2021-02-13 13:30:08 -08:00

22 lines
505 B
Go

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()
}
}
}