Add warnidf template function

Also rename config `ignoreErrors` => `ignoreLogs`

But the old still works.

Closes #9189
This commit is contained in:
Bjørn Erik Pedersen 2024-01-30 09:23:21 +01:00
parent f31a6db797
commit 4e84f57efb
11 changed files with 83 additions and 29 deletions

View file

@ -57,6 +57,13 @@ func TestOptDebug() TestOpt {
}
}
// TestOptWarn will enable warn logging in integration tests.
func TestOptWarn() TestOpt {
return func(c *IntegrationTestConfig) {
c.LogLevel = logg.LevelWarn
}
}
// TestOptWithNFDOnDarwin will normalize the Unicode filenames to NFD on Darwin.
func TestOptWithNFDOnDarwin() TestOpt {
return func(c *IntegrationTestConfig) {
@ -181,9 +188,18 @@ func (b *lockingBuffer) Write(p []byte) (n int, err error) {
return
}
func (s *IntegrationTestBuilder) AssertLogContains(text string) {
func (s *IntegrationTestBuilder) AssertLogContains(els ...string) {
s.Helper()
s.Assert(s.logBuff.String(), qt.Contains, text)
for _, el := range els {
s.Assert(s.logBuff.String(), qt.Contains, el)
}
}
func (s *IntegrationTestBuilder) AssertLogNotContains(els ...string) {
s.Helper()
for _, el := range els {
s.Assert(s.logBuff.String(), qt.Not(qt.Contains), el)
}
}
func (s *IntegrationTestBuilder) AssertLogMatches(expression string) {