mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
Add warnidf template function
Also rename config `ignoreErrors` => `ignoreLogs` But the old still works. Closes #9189
This commit is contained in:
parent
f31a6db797
commit
4e84f57efb
11 changed files with 83 additions and 29 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue