Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/github.com/stretchr/te…
Browse files Browse the repository at this point in the history
…stify-1.8.4
  • Loading branch information
xorcare authored Jan 26, 2024
2 parents 9e3867b + 42e518b commit 75fe8e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (t *T) Logf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
// Removed the trace, it contains line numbers and changes dynamically,
// it is not convenient to see in the examples.
re := regexp.MustCompile(`(?im)Error Trace:([\w\s:.]+)Error:`)
msg = re.ReplaceAllString(msg, "Error Trace:\n\tError:")
re := regexp.MustCompile(`(?im)^\t?Error\ Trace\:([\S\s\n]+)^\t?Error\:`)
msg = re.ReplaceAllString(msg, "\tError Trace:\n\tError:")

msg = strings.Replace(msg, "\t", "", -1)

Expand Down
4 changes: 2 additions & 2 deletions testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func (m *bufferTB) Helper() {

func (m *bufferTB) Logf(format string, args ...interface{}) {
msg := fmt.Sprintf(format, args...)
re := regexp.MustCompile(`(?im)Error Trace:([\w\s:.]+)Error:`)
msg = re.ReplaceAllString(msg, "Error Trace:\n\tError:")
re := regexp.MustCompile(`(?im)^\t?Error\ Trace\:([\S\s\n]+)^\t?Error\:`)
msg = re.ReplaceAllString(msg, "\tError Trace:\n\tError:")
m.logs = append(m.logs, msg)
}

Expand Down

0 comments on commit 75fe8e4

Please sign in to comment.