Skip to content

Commit

Permalink
xz: add test for check-ID None
Browse files Browse the repository at this point in the history
Issue #27 reported the problem that an xz file didn't have a checksum.
This commit adds a test.
  • Loading branch information
ulikunitz committed Feb 24, 2020
1 parent f0ae4d0 commit 7dfc1fc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Binary file added fox-check-none.xz
Binary file not shown.
16 changes: 16 additions & 0 deletions reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,19 @@ func TestReaderMultipleStreams(t *testing.T) {
t.Fatalf("io.Copy error %s", err)
}
}

func TestCheckNone(t *testing.T) {
const file = "fox-check-none.xz"
xz, err := os.Open(file)
if err != nil {
t.Fatalf("os.Open(%q) error %s", file, err)
}
r, err := NewReader(xz)
if err != nil {
t.Fatalf("NewReader error %s", err)
}
var buf bytes.Buffer
if _, err = io.Copy(&buf, r); err != nil {
t.Fatalf("io.Copy error %s", err)
}
}

0 comments on commit 7dfc1fc

Please sign in to comment.