Refactor folder structure
This commit is contained in:
parent
7e9a205d53
commit
c7cca02ca7
30 changed files with 610 additions and 933 deletions
30
tests/html_test.go
Normal file
30
tests/html_test.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/TheLovinator1/FeedVault/pkg/html"
|
||||
"github.com/TheLovinator1/FeedVault/pkg/models"
|
||||
)
|
||||
|
||||
// Displays error messages if there are any parse errors
|
||||
func TestErrorMessages(t *testing.T) {
|
||||
// Initialize test data
|
||||
parseResult := []models.ParseResult{
|
||||
{IsError: true, Msg: "Error 1"},
|
||||
{IsError: true, Msg: "Error 2"},
|
||||
}
|
||||
|
||||
h := html.HTMLData{
|
||||
ParseResult: parseResult,
|
||||
}
|
||||
|
||||
// Invoke function under test
|
||||
result := html.FullHTML(h)
|
||||
|
||||
// Assert that the result contains the error messages
|
||||
if !strings.Contains(result, "Error 1") || !strings.Contains(result, "Error 2") {
|
||||
t.Errorf("Expected error messages, but got: %s", result)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue