Skip to content

Commit

Permalink
fixup fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
thehowl committed Nov 14, 2024
1 parent 6f90e23 commit 94b2197
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions gnovm/cmd/gno/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ func runTestFiles(
) (errs error) {
defer func() {
if r := recover(); r != nil {
if st := m.ExceptionsStacktrace(); st != "" {
errs = multierr.Append(errors.New(st), errs)
}

Check warning on line 437 in gnovm/cmd/gno/test.go

View check run for this annotation

Codecov / codecov/patch

gnovm/cmd/gno/test.go#L435-L437

Added lines #L435 - L437 were not covered by tests
errs = multierr.Append(fmt.Errorf("panic: %v\nstack:\n%v\ngno machine: %v", r, string(debug.Stack()), m.String()), errs)
}
}()
Expand Down
14 changes: 10 additions & 4 deletions gnovm/pkg/test/filetest.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,16 @@ func (d Directives) FileTest() string {
default:
bld.WriteString("// " + dir.Name + ":\n")
cnt := strings.TrimSuffix(dir.Content, "\n")
cnt = strings.ReplaceAll(cnt, "\n", "\n// ")
bld.WriteString("// ")
bld.WriteString(cnt)
bld.WriteByte('\n')
lines := strings.Split(cnt, "\n")
for _, line := range lines {
if line == "" {
bld.WriteString("//\n")
continue

Check warning on line 385 in gnovm/pkg/test/filetest.go

View check run for this annotation

Codecov / codecov/patch

gnovm/pkg/test/filetest.go#L384-L385

Added lines #L384 - L385 were not covered by tests
}
bld.WriteString("// ")
bld.WriteString(line)
bld.WriteByte('\n')
}
}
}
return bld.String()
Expand Down

0 comments on commit 94b2197

Please sign in to comment.