// TODO: package4 is not clean, need to make some new fixture to get this test done.
package4 is not clean, need to make some new fixture to get this test done.
// TODO : package4 is not clean need to make some new fixture to get this test done .
func (s *GetSuite) TestSimpleCrossPkgsGetWithPakfileLock(c *C) {
	MustRun("cp", "fixtures/Pakfile3-for-cross-pkgs-get2", "Pakfile")
	err := Get(PakOption{
		PakMeter:       []string{},
		UsePakfileLock: true,
		Force:          false,
	})
	c.Check(err, Equals, nil)
	c.Log("Git Packages")
	s.pakPkgs[0].Sync()
	s.pakPkgs[1].Sync()
	s.pakPkgs[2].Sync()
	c.Check(s.pakPkgs[0].HeadRefName, Equals, "refs/heads/pak")
	c.Check(s.pakPkgs[1].HeadRefName, Equals, "refs/heads/pak")
	c.Check(s.pakPkgs[2].HeadRefName, Equals, "refs/heads/pak")
	s.pakPkgs[3].Sync()
	c.Check(s.pakPkgs[3].HeadRefName, Equals, "pak")
	pkg7 := NewPakPkg(PkgCfg{Name: "github.com/theplant/package7", PakName: "pak", TargetBranch: "origin/master"})
	pkg7.Dial()
	pkg7.Sync()
	c.Check(pkg7.HeadRefName, Equals, "refs/heads/pak")
	pkg5 := NewPakPkg(PkgCfg{Name: "github.com/theplant/package5", PakName: "pak", TargetBranch: "origin/master"})
	pkg5.Dial()
	pkg5.Sync()
	c.Check(pkg5.HeadRefName, Equals, "refs/heads/pak")
	c.Check(pkg5.HeadChecksum, Equals, "19d82466c490d6fd09b5a000d00c84d7e5261126")
	pkg6 := NewPakPkg(PkgCfg{Name: "github.com/theplant/package6", PakName: "pak", TargetBranch: "origin/master"})
	pkg6.Dial()
	pkg6.Sync()
	c.Check(pkg6.HeadRefName, Equals, "refs/heads/pak")
	c.Check(pkg6.HeadChecksum, Equals, "a86f8e88ee813dea53403af0ac3c3440d3f75390")
}
func ( s * GetSuite ) TestSimpleCrossPkgsGetWithPakfileLock ( c * C ) { MustRun ( " " , " " , " " ) err := Get ( PakOption { PakMeter : [ ] string { } , UsePakfileLock : true , Force : false , } ) c . Check ( err , Equals , nil ) c . Log ( " " ) s . pakPkgs [ 0 ] . Sync ( ) s . pakPkgs [ 1 ] . Sync ( ) s . pakPkgs [ 2 ] . Sync ( ) c . Check ( s . pakPkgs [ 0 ] . HeadRefName , Equals , " " ) c . Check ( s . pakPkgs [ 1 ] . HeadRefName , Equals , " " ) c . Check ( s . pakPkgs [ 2 ] . HeadRefName , Equals , " " ) s . pakPkgs [ 3 ] . Sync ( ) c . Check ( s . pakPkgs [ 3 ] . HeadRefName , Equals , " " ) pkg7 := NewPakPkg ( PkgCfg { Name : " " , PakName : " " , TargetBranch : " " } ) pkg7 . Dial ( ) pkg7 . Sync ( ) c . Check ( pkg7 . HeadRefName , Equals , " " ) pkg5 := NewPakPkg ( PkgCfg { Name : " " , PakName : " " , TargetBranch : " " } ) pkg5 . Dial ( ) pkg5 . Sync ( ) c . Check ( pkg5 . HeadRefName , Equals , " " ) c . Check ( pkg5 . HeadChecksum , Equals , " " ) pkg6 := NewPakPkg ( PkgCfg { Name : " " , PakName : " " , TargetBranch : " " } ) pkg6 . Dial ( ) pkg6 . Sync ( ) c . Check ( pkg6 . HeadRefName , Equals , " " ) c . Check ( pkg6 . HeadChecksum , Equals , " " ) }
package4 is not clean, need to make some new fixture to get this test done.
package4 is not clean need to make some new fixture to get this test done .
// MustRun("cp", "fixtures/Pakfile3-for-cross-pkgs-get2", "../../package4/Pakfile") // MustRun("sh", "-c", "cp fixtures/cross-pkgs-Pakfile.lock ../../package4/Pakfile.lock")