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/read-print.scm | |
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/read-print.scm')
-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 e3f23194af..004fcff19f 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm @@ -341,4 +341,18 @@ mnopqrstuvwxyz.\")" #:format-vertical-space canonicalize-vertical-space))))) +(test-equal "pretty-print-with-comments, multi-line comment" + "\ +(list abc + ;; This comment spans + ;; two lines. + def)" + (call-with-output-string + (lambda (port) + (pretty-print-with-comments port + `(list abc ,(comment "\ +;; This comment spans\n +;; two lines.\n") + def))))) + (test-end) |