Skip to content

Commit

Permalink
Add file count test when extracting files
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Emerson committed Oct 26, 2020
1 parent eaf98f5 commit 4b41500
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,15 @@ func TestExtractFiles(t *testing.T) {
}
defer os.RemoveAll(tempDir)

_, err = extractFiles(tc.localFilePath, tc.filePathToExtract, tempDir)
fileCount, err := extractFiles(tc.localFilePath, tc.filePathToExtract, tempDir)
if err != nil {
t.Fatalf("Failed to extract files: %s", err)
}

if fileCount != tc.expectedNumFiles {
t.Fatalf("Expected to extract %d files, extracted %d instead", tc.expectedNumFiles, fileCount)
}

// Count the number of files in the directory
var numFiles int
filepath.Walk(tempDir, func(path string, info os.FileInfo, err error) error {
Expand Down

0 comments on commit 4b41500

Please sign in to comment.