aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/integrationtest_builder.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-07-01 10:37:38 +0200
committerBjørn Erik Pedersen <[email protected]>2023-07-01 15:38:32 +0200
commit11ecea610617035745e620278a309d98091f527c (patch)
tree5678f3a089542b80316f3ee1ebdb7bc3aa9197fe /hugolib/integrationtest_builder.go
parentda98724bc8bd28532222fb379af7a3782e2a9480 (diff)
downloadhugo-11ecea610617035745e620278a309d98091f527c.tar.gz
hugo-11ecea610617035745e620278a309d98091f527c.zip
Make build.writeStats a struct
So you can do ```toml [build.writeStats] tags = true classes = true ids = false ``` Fixes #11191
Diffstat (limited to 'hugolib/integrationtest_builder.go')
-rw-r--r--hugolib/integrationtest_builder.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/hugolib/integrationtest_builder.go b/hugolib/integrationtest_builder.go
index 3910e2b97..ada01b6ee 100644
--- a/hugolib/integrationtest_builder.go
+++ b/hugolib/integrationtest_builder.go
@@ -147,6 +147,15 @@ func (s *IntegrationTestBuilder) AssertFileContent(filename string, matches ...s
if match == "" || strings.HasPrefix(match, "#") {
continue
}
+ var negate bool
+ if strings.HasPrefix(match, "! ") {
+ negate = true
+ match = strings.TrimPrefix(match, "! ")
+ }
+ if negate {
+ s.Assert(content, qt.Not(qt.Contains), match, qt.Commentf(m))
+ continue
+ }
s.Assert(content, qt.Contains, match, qt.Commentf(m))
}
}