diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2022-08-02 22:52:10 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2022-08-08 11:54:24 +0200 |
| commit | 445a0d134ce735577d1e22f210c2e5ceafc56762 (patch) | |
| tree | ef4d0a5c97465ad1e0ef50f8b7dcf620b988294a /tests | |
| parent | a109ee90486981242beb4272142d429cd0d2e3c3 (diff) | |
read-print: Support printing multi-line comments.
* guix/read-print.scm (%not-newline): New variable.
(print-multi-line-comment): New procedure.
(pretty-print-with-comments): Use it.
* tests/read-print.scm ("pretty-print-with-comments, multi-line
comment"): New test.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/read-print.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/read-print.scm b/tests/read-print.scm index e3f23194af3..004fcff19f1 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm | |||
| @@ -341,4 +341,18 @@ mnopqrstuvwxyz.\")" | |||
| 341 | #:format-vertical-space | 341 | #:format-vertical-space |
| 342 | canonicalize-vertical-space))))) | 342 | canonicalize-vertical-space))))) |
| 343 | 343 | ||
| 344 | (test-equal "pretty-print-with-comments, multi-line comment" | ||
| 345 | "\ | ||
| 346 | (list abc | ||
| 347 | ;; This comment spans | ||
| 348 | ;; two lines. | ||
| 349 | def)" | ||
| 350 | (call-with-output-string | ||
| 351 | (lambda (port) | ||
| 352 | (pretty-print-with-comments port | ||
| 353 | `(list abc ,(comment "\ | ||
| 354 | ;; This comment spans\n | ||
| 355 | ;; two lines.\n") | ||
| 356 | def))))) | ||
| 357 | |||
| 344 | (test-end) | 358 | (test-end) |
