summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-08-02 17:39:55 +0200
committerLudovic Courtès <ludo@gnu.org>2022-08-08 11:22:32 +0200
commit90ef692e9b48732ae2e3921ff5d101e186506a85 (patch)
tree877464d69241abfe3a7c4b36a637a7224faed785 /tests
parent9b00c97de41165beefe3eff936470f8e081ca600 (diff)
read-print: 'canonicalize-comment' leaves top-level comments unchanged.
This lets users use three leading semicolons, for instance, in top-level comments. * guix/read-print.scm (canonicalize-comment): Add INDENT parameter and honor it. (pretty-print-with-comments): Change default value of #:format-comment. Call FORMAT-COMMENT with INDENT as the second argument. * tests/read-print.scm: Adjust test accordingly.
Diffstat (limited to 'tests')
-rw-r--r--tests/read-print.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/read-print.scm b/tests/read-print.scm
index 94f018dd443..e3f23194af3 100644
--- a/tests/read-print.scm
+++ b/tests/read-print.scm
@@ -274,6 +274,7 @@ mnopqrstuvwxyz.\")"
274 274
275(test-pretty-print/sequence " 275(test-pretty-print/sequence "
276;;; Hello! 276;;; Hello!
277;;; Notice that there are three semicolons here.
277 278
278(define-module (foo bar) 279(define-module (foo bar)
279 #:use-module (guix) 280 #:use-module (guix)
@@ -286,7 +287,8 @@ mnopqrstuvwxyz.\")"
286 (locale \"eo_EO.UTF-8\") 287 (locale \"eo_EO.UTF-8\")
287 288
288 (services 289 (services
289 (cons (service mcron-service-type) %base-services)))\n") 290 (cons (service mcron-service-type) %base-services)))\n"
291 #:format-comment canonicalize-comment)
290 292
291(test-equal "pretty-print-with-comments, canonicalize-comment" 293(test-equal "pretty-print-with-comments, canonicalize-comment"
292 "\ 294 "\