This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/telemetry/git_test.go
Andrea Luzzardi f7628adee5 telemetry: Normalize git URLs
Normalize `https://github.com/dagger/dagger` and
`git@github.com:dagger/dagger.git` to `github.com/dagger/dagger`

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2022-03-21 16:56:35 -07:00

23 lines
457 B
Go

package telemetry
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestParseGit(t *testing.T) {
var (
endpoint string
err error
)
endpoint, err = parseGitURL("https://github.com/dagger/dagger")
require.NoError(t, err)
require.Equal(t, endpoint, "github.com/dagger/dagger")
endpoint, err = parseGitURL("git@github.com:dagger/dagger.git")
require.NoError(t, err)
require.Equal(t, endpoint, "github.com/dagger/dagger")
}