mirror of
https://github.com/go-task/task.git
synced 2024-12-14 10:52:43 +02:00
23 lines
627 B
Go
23 lines
627 B
Go
|
package taskfile
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestScheme(t *testing.T) {
|
||
|
scheme, err := getScheme("https://github.com/foo/bar.git")
|
||
|
assert.NoError(t, err)
|
||
|
assert.Equal(t, "git", scheme)
|
||
|
scheme, err = getScheme("https://github.com/foo/bar.git?ref=v1//taskfile/common.yml")
|
||
|
assert.NoError(t, err)
|
||
|
assert.Equal(t, "git", scheme)
|
||
|
scheme, err = getScheme("git@github.com:foo/bar.git?ref=main//Taskfile.yml")
|
||
|
assert.NoError(t, err)
|
||
|
assert.Equal(t, "git", scheme)
|
||
|
scheme, err = getScheme("https://github.com/foo/common.yml")
|
||
|
assert.NoError(t, err)
|
||
|
assert.Equal(t, "https", scheme)
|
||
|
}
|