From 11ecea610617035745e620278a309d98091f527c Mon Sep 17 00:00:00 2001 From: Bjørn Erik Pedersen Date: Sat, 1 Jul 2023 10:37:38 +0200 Subject: Make build.writeStats a struct So you can do ```toml [build.writeStats] tags = true classes = true ids = false ``` Fixes #11191 --- hugolib/integrationtest_builder.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'hugolib/integrationtest_builder.go') 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)) } } -- cgit v1.2.3