mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Add another code coverage test
* test-suite/tests/coverage.test ("line-execution-counts"): Add a test from Taylan Ulrich B, from bug #14849.
This commit is contained in:
parent
e877e1bccb
commit
845c873acf
1 changed files with 19 additions and 1 deletions
|
@ -196,7 +196,25 @@
|
|||
(with-code-coverage
|
||||
(lambda () (proc 451 1884)))))
|
||||
(let ((counts (line-execution-counts data "one-liner.scm")))
|
||||
(equal? counts '((0 . 1))))))))
|
||||
(equal? counts '((0 . 1)))))))
|
||||
|
||||
(pass-if "tail calls"
|
||||
(let ((proc (code "tail-calls.scm"
|
||||
"(begin
|
||||
(define (tail-call-test)
|
||||
(display \"foo\\n\")
|
||||
(tail-call-target))
|
||||
|
||||
(define (tail-call-target)
|
||||
(display \"bar\\n\"))
|
||||
|
||||
tail-call-test)")))
|
||||
(let-values (((data result)
|
||||
(with-code-coverage
|
||||
(lambda () (with-output-to-string proc)))))
|
||||
(let ((counts (line-execution-counts data "tail-calls.scm")))
|
||||
(lset= equal? '((1 . 1) (2 . 1) (3 . 1) (5 . 1) (6 . 1))
|
||||
counts))))))
|
||||
|
||||
|
||||
(with-test-prefix "procedure-execution-count"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue