From e5d4c514a7a4ef2767c93a60dd2953eac788c313 Mon Sep 17 00:00:00 2001 From: "Arik Jones (aider)" Date: Sat, 21 Sep 2024 15:59:39 -0500 Subject: [PATCH] fix: resolve build errors in test files --- cmd/files_test.go | 5 +++-- internal/scraper/scraper_test.go | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/files_test.go b/cmd/files_test.go index 52224f0..08f466c 100644 --- a/cmd/files_test.go +++ b/cmd/files_test.go @@ -108,19 +108,20 @@ func TestRunRollup(t *testing.T) { path = tempDir // Run the rollup - outputFile, err := runRollup() + err = runRollup() if err != nil { t.Fatalf("runRollup() failed: %v", err) } // Check if the output file was created + outputFile := filepath.Join(tempDir, "rollup.md") if _, err := os.Stat(outputFile); os.IsNotExist(err) { files, _ := filepath.Glob(filepath.Join(tempDir, "*")) t.Fatalf("Output file %s not found. Files in directory: %v", outputFile, files) } // Read the content of the output file - content, err := os.ReadFile(outputFiles[0]) + content, err := os.ReadFile(outputFile) if err != nil { t.Fatalf("Failed to read output file: %v", err) } diff --git a/internal/scraper/scraper_test.go b/internal/scraper/scraper_test.go index 76544dd..ff98272 100644 --- a/internal/scraper/scraper_test.go +++ b/internal/scraper/scraper_test.go @@ -6,6 +6,8 @@ import ( "net/http/httptest" "strings" "reflect" + "log" + "io/ioutil" ) func TestIsAllowedURL(t *testing.T) {