mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-03-16 17:54:07 +01:00
@@ -17,16 +17,13 @@ package common_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/forge/common"
|
||||
)
|
||||
|
||||
func Test_Netrc(t *testing.T) {
|
||||
host, err := common.ExtractHostFromCloneURL("https://git.example.com/foo/bar.git")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if host != "git.example.com" {
|
||||
t.Errorf("Expected host to be git.example.com, got %s", host)
|
||||
}
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "git.example.com", host)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user