chore(go): scaffold module and add failing link tests
This commit is contained in:
24
internal/homesick/core/core_test.go
Normal file
24
internal/homesick/core/core_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package core
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestDeriveDestination(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
uri string
|
||||
want string
|
||||
}{
|
||||
{name: "github short", uri: "technicalpickles/pickled-vim", want: "pickled-vim"},
|
||||
{name: "https", uri: "https://github.com/technicalpickles/pickled-vim.git", want: "pickled-vim"},
|
||||
{name: "git ssh", uri: "git@github.com:technicalpickles/pickled-vim.git", want: "pickled-vim"},
|
||||
{name: "file", uri: "file:///tmp/dotfiles.git", want: "dotfiles"},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := deriveDestination(tt.uri); got != tt.want {
|
||||
t.Fatalf("deriveDestination(%q) = %q, want %q", tt.uri, got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user