aboutsummaryrefslogtreecommitdiff
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)
downloadguix-90ef692e9b48732ae2e3921ff5d101e186506a85.tar
guix-90ef692e9b48732ae2e3921ff5d101e186506a85.tar.gz
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 94f018dd44..e3f23194af 100644
--- a/tests/read-print.scm
+++ b/tests/read-print.scm
@@ -274,6 +274,7 @@ mnopqrstuvwxyz.\")"
(test-pretty-print/sequence "
;;; Hello!
+;;; Notice that there are three semicolons here.
(define-module (foo bar)
#:use-module (guix)
@@ -286,7 +287,8 @@ mnopqrstuvwxyz.\")"
(locale \"eo_EO.UTF-8\")
(services
- (cons (service mcron-service-type) %base-services)))\n")
+ (cons (service mcron-service-type) %base-services)))\n"
+ #:format-comment canonicalize-comment)
(test-equal "pretty-print-with-comments, canonicalize-comment"
"\