[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash 6ffcd89 299/316: Print actual error messages in RE
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash 6ffcd89 299/316: Print actual error messages in README |
Date: |
Mon, 15 Feb 2021 15:58:21 -0500 (EST) |
branch: externals/dash
commit 6ffcd897ce2b05edc18fc46797027c64b3dbb5ad
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Print actual error messages in README
* dev/examples-to-docs.el (example-to-string): Print actual error
message in expected result.
* README.md: Regenerate.
---
README.md | 6 +++---
dev/examples-to-docs.el | 12 ++++++++----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index fc19a5b..f268123 100644
--- a/README.md
+++ b/README.md
@@ -1088,7 +1088,7 @@ Return a list with running sums of items in `list`.
```el
(-running-sum '(1 2 3 4)) ;; => (1 3 6 10)
(-running-sum '(1)) ;; => (1)
-(-running-sum ()) ;; Error
+(-running-sum ()) ;; Wrong type argument: consp, nil
```
#### -product `(list)`
@@ -1109,7 +1109,7 @@ Return a list with running products of items in `list`.
```el
(-running-product '(1 2 3 4)) ;; => (1 2 6 24)
(-running-product '(1)) ;; => (1)
-(-running-product ()) ;; Error
+(-running-product ()) ;; Wrong type argument: consp, nil
```
#### -inits `(list)`
@@ -1807,7 +1807,7 @@ the `apl` language.
```el
(-iota 6) ;; => (0 1 2 3 4 5)
(-iota 4 2.5 -2) ;; => (2.5 0.5 -1.5 -3.5)
-(-iota -1) ;; Error
+(-iota -1) ;; Wrong type argument: natnump, -1
```
#### -zip-with `(fn list1 list2)`
diff --git a/dev/examples-to-docs.el b/dev/examples-to-docs.el
index 8fc4567..983f8fb 100644
--- a/dev/examples-to-docs.el
+++ b/dev/examples-to-docs.el
@@ -44,9 +44,13 @@
(defun example-to-string (example)
(pcase-let ((`(,actual ,sym ,expected) example)
(print-quoted t))
- (and (eq (car-safe expected) 'quote)
- (not (equal expected ''()))
- (setq expected (cadr expected)))
+ (cond ((eq sym '!!>)
+ ;; Print actual error message.
+ (setq expected (error-message-string (-list expected))))
+ ((and (eq (car-safe expected) 'quote)
+ (not (equal expected ''())))
+ ;; Unquote expected result.
+ (setq expected (cadr expected))))
(with-output-to-string
(with-current-buffer standard-output
(dash--print-lisp-as-md actual)
@@ -55,7 +59,7 @@
(princ sym)
(insert ?\s)
(dash--print-lisp-as-md expected))
- ((eq sym '!!>) (insert "Error"))
+ ((eq sym '!!>) (princ expected))
((error "Invalid test case: %S" example)))))))
(defun dash--describe (fn)
- [elpa] externals/dash 8bd2887 269/316: Move pre-commit.sh under dev/, (continued)
- [elpa] externals/dash 8bd2887 269/316: Move pre-commit.sh under dev/, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 8599380 270/316: Optimize -is-prefix? and -is-suffix?, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5362be7 275/316: Use actual advertised function signature in manual, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 926eb0b 280/316: Add forceful Makefile targets, ELPA Syncer, 2021/02/15
- [elpa] externals/dash eedc2af 279/316: Fix docstring Texinfo generation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7ee12ee 283/316: Use buffers for Texinfo generation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash baf9147 285/316: Simplify Texinfo generation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 7ec3975 292/316: Avoid deleting docs in old Emacs versions, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3cfbebf 293/316: Port more Texinfo generation changes to Markdown, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 03748d8 297/316: Prefer '() over () in printed examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6ffcd89 299/316: Print actual error messages in README,
ELPA Syncer <=
- [elpa] externals/dash 4f3238b 300/316: Strip leading zeros from octal escapes in Emacs 26, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2028805 302/316: Don't quote error messages in Texinfo examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 6c41b32 301/316: Move case-fold-search binding to where it's used, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1c711f1 303/316: Unquote results in Texinfo examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 1bf9ddb 304/316: Makefile aesthetics, ELPA Syncer, 2021/02/15
- [elpa] externals/dash da0415b 312/316: * NEWS.md (2.18): Start news for upcoming release., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 5eea156 315/316: Absorb dash-functional into dash, ELPA Syncer, 2021/02/15
- [elpa] externals/dash eaf33b3 226/316: Add info-lookup-symbol support, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 565055e 229/316: * dash.el (---truthy?): Simplify., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 97bd233 231/316: Use lexical binding for -grade-up/down, ELPA Syncer, 2021/02/15