24 lines
456 B
Go
24 lines
456 B
Go
|
package config
|
||
|
|
||
|
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/",
|
||
|
}
|
||
|
|
||
|
cfg := New()
|
||
|
for _, actual := range tests {
|
||
|
e := NewEndpointFromCloneURLWithConfig(actual, cfg)
|
||
|
if e.Url != expected {
|
||
|
t.Errorf("%s returned bad endpoint url %s", actual, e.Url)
|
||
|
}
|
||
|
}
|
||
|
}
|