Skip to content

Commit

Permalink
packages: add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredallard committed Mar 24, 2024
1 parent cae3988 commit b6ef9bc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions internal/packages/packages_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package packages_test

import (
"os"
"testing"

"github.com/jaredallard/binhost/internal/packages"
"gotest.tools/v3/assert"
)

func TestCanParseGpkg(t *testing.T) {
f, err := os.Open("testdata/onepassword-cli-0-1.gpkg.tar")
assert.NilError(t, err)

pkg, err := packages.New(f)
assert.NilError(t, err)

// Check that one field is set. Maybe one day check them all (I'm
// lazy)
assert.Equal(t, "onepassword-cli-0", pkg.PF)
}
Binary file not shown.

0 comments on commit b6ef9bc

Please sign in to comment.