Skip to content

Commit c8640c4

Browse files
committed
Fix printing of contracts.
Closes #6.
1 parent 3a3f857 commit c8640c4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

boundary-view.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
#:exists 'replace
118118
(lambda ()
119119
(for ([contract+key (in-list contracts->keys)])
120-
(printf "[~a] = ~a\n"
120+
(printf "[~a] = ~s\n"
121121
(cdr contract+key)
122122
(car contract+key)))))))
123123

main.rkt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
(make-srcloc-shortener all-blames blame-source))
115115
(define (format-contract/loc c s)
116116
(string-append
117-
(~a (blame-contract c) #:limit-marker limit-dots #:width location-width)
117+
(~s (blame-contract c) #:limit-marker limit-dots #:width location-width)
118118
(~a (format-samples-time s) "\n")
119119
(~a (srcloc->string (shorten-source c))
120120
#:limit-marker limit-dots
@@ -146,8 +146,12 @@
146146
(blame-value (contract-sample-blame x)))
147147
g)
148148
> #:key length)])
149-
(display (~a " " (blame-value (contract-sample-blame (car x)))
150-
#:limit-marker limit-dots #:width location-width))
149+
(define indent " ")
150+
(display (string-append
151+
indent
152+
(~s (blame-value (contract-sample-blame (car x)))
153+
#:limit-marker limit-dots
154+
#:width (- location-width (string-length indent)))))
151155
(displayln (format-samples-time x)))
152156
(newline))
153157

utils.rkt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
" value=~a\n"
3636
" source=~a>\n")
3737
(blame-positive b) (blame-negative b)
38-
(blame-contract b) (blame-value b) (blame-source b)))
38+
(contract-name (blame-contract b))
39+
(blame-value b) (blame-source b)))
3940

4041
;; (listof (U path-string? submodule-path #f)) -> same
4142
(define (shorten-paths ps*)

0 commit comments

Comments
 (0)