mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
@@ -649,9 +649,16 @@ func (s *sitesBuilder) AssertHome(matches ...string) {
|
||||
func (s *sitesBuilder) AssertFileContent(filename string, matches ...string) {
|
||||
s.T.Helper()
|
||||
content := s.FileContent(filename)
|
||||
for _, match := range matches {
|
||||
if !strings.Contains(content, match) {
|
||||
s.Fatalf("No match for %q in content for %s\n%s\n%q", match, filename, content, content)
|
||||
for _, m := range matches {
|
||||
lines := strings.Split(m, "\n")
|
||||
for _, match := range lines {
|
||||
match = strings.TrimSpace(match)
|
||||
if match == "" {
|
||||
continue
|
||||
}
|
||||
if !strings.Contains(content, match) {
|
||||
s.Fatalf("No match for %q in content for %s\n%s\n%q", match, filename, content, content)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user