diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-18 14:00:00 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-18 14:00:00 +0200 |
commit | c65263bc5efb09e9134fbce2cba6a550c592068d (patch) | |
tree | 077164c2f20f1e2d6fb7f4ab6bee92c3ab078b8f | |
parent | Add "unreachable". (diff) | |
download | calp-c65263bc5efb09e9134fbce2cba6a550c592068d.tar.gz calp-c65263bc5efb09e9134fbce2cba6a550c592068d.tar.xz |
Finish tests for (vcomponent duration).
-rw-r--r-- | module/vcomponent/duration.scm | 13 | ||||
-rw-r--r-- | tests/unit/coverage-supplement.scm | 6 |
2 files changed, 14 insertions, 5 deletions
diff --git a/module/vcomponent/duration.scm b/module/vcomponent/duration.scm index af1d95d5..7a047544 100644 --- a/module/vcomponent/duration.scm +++ b/module/vcomponent/duration.scm @@ -110,12 +110,15 @@ [(H) `(hour: ,n)] [(M) `(minute: ,n)] [(S) `(second: ,n)] - [else (scm-error 'misc-error "parse-duration" - "Invalid key ~a" type #f)]))] + [else (unreachable + "parse-duration" + "Invalid key ~a" + type)]))] [a - (scm-error 'misc-error "parse-duration" - "~s not on expected form ((number <num>) type)" - (list a) #f)]) + (unreachable + "parse-duration" + "~s not on expected form ((number <num>) type)" + (list a))]) (context-flatten (lambda (x) (and (pair? (car x)) (eq? 'number (caar x)))) (cdr (member "P" tree))) diff --git a/tests/unit/coverage-supplement.scm b/tests/unit/coverage-supplement.scm index 9242a3c1..e9dff8f2 100644 --- a/tests/unit/coverage-supplement.scm +++ b/tests/unit/coverage-supplement.scm @@ -36,4 +36,10 @@ 5 ; (Module declaration 52 ; else "keyword" apparently missed ) + ("module/vcomponent/duration.scm" + "c83a2750964c2362af5043f33b435a792f62007d847f543e78a8f2550757e010" + ;; Unreachable code, but fail faster + 113 114 115 + 118 119 120 121 + ) ) |