1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 03:30:27 +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:
Andy Wingo 2016-06-21 09:07:26 +02:00
parent e877e1bccb
commit 845c873acf

View file

@ -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"