git-lfs/lfsapi/endpoint_test.go

24 lines
468 B
Go
Raw Normal View History

2016-12-19 18:45:22 +00:00
package lfsapi
2016-08-15 21:23:36 +00:00
import (
"testing"
)
func TestNewEndpointFromCloneURLWithConfig(t *testing.T) {
expected := "https://foo/bar.git/info/lfs"
tests := []string{
"https://foo/bar",
"https://foo/bar/",
"https://foo/bar.git",
"https://foo/bar.git/",
}
2016-12-19 18:45:22 +00:00
finder := NewEndpointFinder(nil)
2016-08-15 21:23:36 +00:00
for _, actual := range tests {
2016-12-19 18:45:22 +00:00
e := finder.NewEndpointFromCloneURL(actual)
2016-08-15 21:23:36 +00:00
if e.Url != expected {
t.Errorf("%s returned bad endpoint url %s", actual, e.Url)
}
}
}