Skip to content

Commit 4eff2ff

Browse files
committed
Fixing Unit Tests
1 parent 361fa9c commit 4eff2ff

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/core/explain.rkt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
(let loop ([expr expr]
498498
[loc '()])
499499
(match expr
500-
[(== subexpr) (sow (reverse loc))]
500+
[(== subexpr) (sow (reverse loc))]
501501
[(? literal?) (void)]
502502
[(? symbol?) (void)]
503503
[(approx _ impl) (loop impl (cons 2 loc))]
@@ -506,7 +506,6 @@
506506
[i (in-naturals 1)])
507507
(loop arg (cons i loc)))]))))
508508

509-
510509
(define (generate-timelines expr
511510
ctx
512511
pctx
@@ -549,7 +548,7 @@
549548
(define err-count (length val))
550549
(define maybe-count (length (hash-ref maybe-expls->points key '())))
551550
(define flow-list (make-flow-table oflow-hash uflow-hash subexpr expl))
552-
551+
553552
(define locations (get-locations expr subexpr))
554553

555554
(list (~a (car subexpr)) (~a subexpr) (~a expl) err-count maybe-count flow-list locations)))
@@ -626,8 +625,6 @@
626625
oflow-hash
627626
uflow-hash))
628627

629-
630-
631628
(define (flow-list flow-hash expr type)
632629
(for/list ([(k v) (in-dict (hash-ref flow-hash expr))])
633630
(list (~a k) type v)))
@@ -699,4 +696,4 @@
699696
(define true-maybe (hash-ref counts '(#t . maybe) 0))
700697
(define false-maybe (hash-ref counts '(#f . maybe) 0))
701698

702-
(list true-pos true-maybe false-neg false-pos false-maybe true-neg))
699+
(list true-pos true-maybe false-neg false-pos false-maybe true-neg))

src/reports/timeline.rkt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,19 +350,20 @@
350350
(dd (details
351351
(summary "Click to see full explanations table")
352352
(table ((class "times"))
353-
(thead (tr (th "Operator") (th "Subexpression") (th "Explanation") (th "Count")))
353+
(thead (tr (th "Operator") (th "Subexpression") (th "Explanation") (th "Count") (th "Locations")))
354354
,@(append*
355355
(for/list ([rec (in-list (sort explanations > #:key fourth))])
356-
(match-define (list op expr expl cnt mcnt flows) rec)
356+
(match-define (list op expr expl cnt mcnt flows locations) rec)
357357

358358
(append (list `(tr (td (code ,(~a op)))
359359
(td (code ,(~a expr)))
360360
(td (b ,(~a expl)))
361361
(td ,(~a cnt))
362-
(td ,(~a mcnt))))
362+
(td ,(~a mcnt))
363+
(td (code ,(~a locations))))
363364
(for/list ([flow (in-list (or flows '()))])
364365
(match-define (list ex type v) flow)
365-
`(tr (td "") (td (code ,(~a ex))) (td ,type) (td ,(~a v))))))))))))
366+
`(tr (td "") (td (code ,(~a ex))) (td ,type) (td ,(~a v)))))))))))))
366367

367368
(define (render-phase-confusion confusion-matrix)
368369
(match-define (list (list true-pos false-neg false-pos true-neg)) confusion-matrix)

0 commit comments

Comments
 (0)