Skip to content

Commit

Permalink
Test subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
gen2brain committed Jun 2, 2023
1 parent e3c91c6 commit d69f9d6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added testdata/test_subdir.zip
Binary file not shown.
23 changes: 23 additions & 0 deletions unarr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,3 +441,26 @@ func TestListCorrupted(t *testing.T) {

a.Close()
}

func TestSubdir(t *testing.T) {
a, err := NewArchive(filepath.Join("testdata", "test_subdir.zip"))
if err != nil {
t.Error(err)
}

err = a.EntryFor("test/test.txt")
if err != nil {
t.Error(err)
}

data, err := a.ReadAll()
if err != nil {
t.Error(err)
}

if strings.TrimSpace(string(data)) != "unarr" {
t.Error("Invalid data")
}

a.Close()
}

0 comments on commit d69f9d6

Please sign in to comment.