mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-13 06:23:18 +00:00
fix: resolve build errors in test files
This commit is contained in:
@@ -108,19 +108,20 @@ func TestRunRollup(t *testing.T) {
|
|||||||
path = tempDir
|
path = tempDir
|
||||||
|
|
||||||
// Run the rollup
|
// Run the rollup
|
||||||
outputFile, err := runRollup()
|
err = runRollup()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("runRollup() failed: %v", err)
|
t.Fatalf("runRollup() failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the output file was created
|
// Check if the output file was created
|
||||||
|
outputFile := filepath.Join(tempDir, "rollup.md")
|
||||||
if _, err := os.Stat(outputFile); os.IsNotExist(err) {
|
if _, err := os.Stat(outputFile); os.IsNotExist(err) {
|
||||||
files, _ := filepath.Glob(filepath.Join(tempDir, "*"))
|
files, _ := filepath.Glob(filepath.Join(tempDir, "*"))
|
||||||
t.Fatalf("Output file %s not found. Files in directory: %v", outputFile, files)
|
t.Fatalf("Output file %s not found. Files in directory: %v", outputFile, files)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read the content of the output file
|
// Read the content of the output file
|
||||||
content, err := os.ReadFile(outputFiles[0])
|
content, err := os.ReadFile(outputFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to read output file: %v", err)
|
t.Fatalf("Failed to read output file: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import (
|
|||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"strings"
|
"strings"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"log"
|
||||||
|
"io/ioutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestIsAllowedURL(t *testing.T) {
|
func TestIsAllowedURL(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user