~ chicken-core (chicken-5) 7b2fef6f7c1f66fdf28d0442f9ab5dcc05f628f7
commit 7b2fef6f7c1f66fdf28d0442f9ab5dcc05f628f7 Author: Evan Hanson <evhan@foldling.org> AuthorDate: Wed Aug 6 18:49:19 2014 +1200 Commit: Peter Bex <peter.bex@xs4all.nl> CommitDate: Fri Aug 8 20:30:28 2014 +0200 Strip syntax from identifiers in scrutiny output This resolves identifiers to their real (i.e. non-macro-aliased) names in order to give cleaner scrutiny output messages. Signed-off-by: Peter Bex <peter.bex@xs4all.nl> diff --git a/scrutinizer.scm b/scrutinizer.scm index 2c858dc1..a4edfb72 100644 --- a/scrutinizer.scm +++ b/scrutinizer.scm @@ -274,7 +274,7 @@ (define (fragment x) (let ((x (build-expression-tree x))) (let walk ((x x) (d 0)) - (cond ((atom? x) x) + (cond ((atom? x) (##sys#strip-syntax x)) ((>= d +fragment-max-depth+) '...) ((list? x) (let* ((len (length x)) @@ -282,7 +282,7 @@ (append (take x +fragment-max-length+) '(...)) x))) (map (cute walk <> (add1 d)) xs))) - (else x))))) + (else (##sys#strip-syntax x)))))) (define (pp-fragment x) (string-chomp diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected index 5c072fc6..f9df9f82 100644 --- a/tests/scrutiny.expected +++ b/tests/scrutiny.expected @@ -5,15 +5,15 @@ Note: in local procedure `c', expected value of type boolean in conditional but were given a value of type `number' which is always true: -(if x3 1 2) +(if x 1 2) Warning: in toplevel procedure `foo': branches in conditional expression differ in the number of results: -(if x5 (values 1 2) (values 1 2 (+ (+ ...)))) +(if x (values 1 2) (values 1 2 (+ (+ ...)))) Warning: at toplevel: - (scrutiny-tests.scm:15) in procedure call to `bar6', expected argument #2 of type `number', but was given an argument of type `symbol' + (scrutiny-tests.scm:15) in procedure call to `bar', expected argument #2 of type `number', but was given an argument of type `symbol' Warning: at toplevel: (scrutiny-tests.scm:17) in procedure call to `pp', expected 1 argument, but was given 0 arguments @@ -25,7 +25,7 @@ Warning: at toplevel: expected in argument #1 of procedure call `(print (values))' a single result, but were given zero results Warning: at toplevel: - (scrutiny-tests.scm:23) in procedure call to `x7', expected a value of type `(procedure () *)', but was given a value of type `fixnum' + (scrutiny-tests.scm:23) in procedure call to `x', expected a value of type `(procedure () *)', but was given a value of type `fixnum' Warning: at toplevel: (scrutiny-tests.scm:25) in procedure call to `+', expected argument #1 of type `number', but was given an argument of type `symbol' @@ -40,13 +40,13 @@ Warning: at toplevel: expected in `let' binding of `g8' a single result, but were given 2 results Warning: at toplevel: - in procedure call to `g89', expected a value of type `(procedure () *)', but was given a value of type `fixnum' + in procedure call to `g8', expected a value of type `(procedure () *)', but was given a value of type `fixnum' Note: in toplevel procedure `foo': expected value of type boolean in conditional but were given a value of type `(procedure bar30 () *)' which is always true: -(if bar30 3 (##core#undefined)) +(if bar 3 (##core#undefined)) Warning: in toplevel procedure `foo2': (scrutiny-tests.scm:54) in procedure call to `string-append', expected argument #1 of type `string', but was given an argument of type `number'Trap