Added repo parsing
This commit is contained in:
1 parent
38617c2781
commit
acf2a33a68
2 files changed
+63
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package github
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParsing(t *testing.T) {
|
||||
type source struct {
|
||||
sourceurl string
|
||||
owner string
|
||||
repo string
|
||||
}
|
||||
|
||||
neovim := source{sourceurl: "git+https://github.com/neovim/neovim.git"}
|
||||
neovim.owner, neovim.repo = parseSource(neovim.sourceurl)
|
||||
|
||||
if neovim.owner != "neovim" || neovim.repo != "neovim" {
|
||||
t.Fatalf("Expected to find neovim/neovim, found %+v/%+v", neovim.owner, neovim.repo)
|
||||
}
|
||||
|
||||
yay := source{sourceurl: "git://github.com/jguer/yay.git#branch=master"}
|
||||
yay.owner, yay.repo = parseSource(yay.sourceurl)
|
||||
if yay.owner != "jguer" || yay.repo != "yay" {
|
||||
t.Fatalf("Expected to find jguer/yay, found %+v/%+v", yay.owner, yay.repo)
|
||||
}
|
||||
|
||||
ack := source{sourceurl: "git://github.com/davidgiven/ack"}
|
||||
ack.owner, ack.repo = parseSource(ack.sourceurl)
|
||||
if ack.owner != "davidgiven" || ack.repo != "ack" {
|
||||
t.Fatalf("Expected to find davidgiven/ack, found %+v/%+v", ack.owner, ack.repo)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user