photoprism-client-go/test/regression_test.go
2021-05-05 15:18:05 +01:00

22 lines
509 B
Go

package test
import (
"testing"
"github.com/astravexton/photoprism-client-go"
)
// Trailing slash issue
// https://github.com/astravexton/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()
}
}
}