Skip to content

Commit

Permalink
Fix package_test
Browse files Browse the repository at this point in the history
  • Loading branch information
ret2libc committed Jul 3, 2023
1 parent cf3897e commit 22699f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func main() {
app := cli.NewApp()
app.Name = "rz-pm"
app.Usage = "Rizin package manager"
app.Version = "v0.3.0"
app.Version = "v0.3.1"

cli.AppHelpTemplate = fmt.Sprintf(`%s
RZ_PM_SITE:
Expand Down
9 changes: 6 additions & 3 deletions pkg/package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func (s FakeSite) IsPackageInstalled(pkg Package) bool {
func (s FakeSite) GetPackage(name string) (Package, error) {
return RizinPackage{}, nil
}
func (s FakeSite) GetInstalledPackage(name string) (InstalledPackage, error) {
return InstalledPackage{}, nil
}
func (s FakeSite) GetPackageFromFile(filename string) (Package, error) {
return RizinPackage{}, nil
}
Expand Down Expand Up @@ -208,10 +211,10 @@ func TestDownloadGitPackage(t *testing.T) {

err = p.Download(tmpPath)
assert.NoError(t, err, "simple package should be downloaded")
_, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "simple-git"))
_, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "jsdec"))
assert.NoError(t, err, "simple-git(jsdec) dir should be there")
_, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "simple-git", ".git"))
_, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "jsdec", ".git"))
assert.NoError(t, err, "simple-git(jsdec) master branch should have been git cloned")
_, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "simple-git", "p"))
_, err = os.Stat(filepath.Join(tmpPath, "simple-git", "dev", "jsdec", "p"))
assert.NoError(t, err, "simple-git(jsdec)/p should be there")
}

0 comments on commit 22699f8

Please sign in to comment.