Skip to content

Commit

Permalink
Fix stackframe printing in module-lang-tests error
Browse files Browse the repository at this point in the history
  • Loading branch information
shhyou committed Oct 24, 2024
1 parent e0f07ba commit f1521d9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions drracket-test/tests/drracket/private/module-lang-test-utils.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#lang racket/base
(require "drracket-test-util.rkt"
framework
drracket/private/stack-checkpoint
racket/string
(for-syntax racket/base)
racket/class)
Expand Down Expand Up @@ -161,8 +162,19 @@
(for ([stack (in-list stacks)])
(when stack
(eprintf "\n----\n")
(for ([frame (in-list stack)])
(eprintf " ~s\n" frame))
(unless (empty-viewable-stack? stack)
(define stack-iterator (copy-viewable-stack stack))
(let loop ()
(define-values (list-of-srcloc-count has-next?)
(viewable-stack-get-next-items! stack-iterator))
(for ([srcloc-count (in-list list-of-srcloc-count)])
(define frame (srcloc->string (car srcloc-count)))
(define count (+ 1 (cdr srcloc-count)))
(if (> count 1)
(eprintf " ~a [repeated ~a times]\n" frame count)
(eprintf " ~a\n" frame)))
(when has-next?
(loop))))
(eprintf "----\n")))))
(unless ((test-extra-assert test) definitions-text interactions-text)
(eprintf "FAILED line ~a; extra assertion returned #f\n"
Expand Down

0 comments on commit f1521d9

Please sign in to comment.