diff --git a/file_test.go b/file_test.go index 114ed8d..40e5f78 100644 --- a/file_test.go +++ b/file_test.go @@ -355,12 +355,18 @@ func TestExtractFilesExtractFile(t *testing.T) { zipFilePath := "test-fixtures/fetch-test-public-0.0.4.zip" filePathToExtract := "zzz.txt" localFileName := "/localzzz.txt" + expectedFileCount := 1 localPathName := filepath.Join(tempDir, localFileName) - _, err = extractFiles(zipFilePath, filePathToExtract, localPathName) + fileCount, err := extractFiles(zipFilePath, filePathToExtract, localPathName) + if err != nil { t.Fatalf("Failed to extract files: %s", err) } + if fileCount != expectedFileCount { + t.Fatalf("Expected to extract %d files, extracted %d instead", expectedFileCount, fileCount) + } + filepath.Walk(tempDir, func(path string, info os.FileInfo, err error) error { relativeFilename := strings.TrimPrefix(path, tempDir)