diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-07-01 10:37:38 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-07-01 15:38:32 +0200 |
commit | 11ecea610617035745e620278a309d98091f527c (patch) | |
tree | 5678f3a089542b80316f3ee1ebdb7bc3aa9197fe /hugolib/integrationtest_builder.go | |
parent | da98724bc8bd28532222fb379af7a3782e2a9480 (diff) |
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.go | 9 |
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)) } } |