github.com/comcast/canticle@v0.0.0-20161108184242-c53cface56e8/canticles/command_test.go (about) 1 package canticles 2 3 import ( 4 "reflect" 5 "testing" 6 ) 7 8 func TestPackageName(t *testing.T) { 9 pkg, err := PackageName("/home/go", "/home/go/src/test.com/testpkg") 10 if err != nil { 11 t.Errorf("Error getting valid package: %s", err.Error()) 12 } 13 pname := "test.com/testpkg" 14 if pkg != pname { 15 t.Errorf("Expected package %s got %s", pkg, pname) 16 } 17 } 18 19 func TestParseCmdLineDeps(t *testing.T) { 20 pkgs := []string{"test.com/testpkg", "test.com/testpkg2"} 21 args := ParseCmdLinePackages(pkgs) 22 23 if !reflect.DeepEqual(pkgs, args) { 24 t.Errorf("Expected packages %v != %v", pkgs, args) 25 } 26 }