tests: configuration: Add a test to cover 'unset regression.
[jackhill/guix/guix.git] / tests / read-print.scm
index e3f2319..b484e28 100644 (file)
@@ -141,6 +141,21 @@ expressions."
   (let ((z (+ x y)))
     (* z z)))")
 
+(test-pretty-print "\
+(case x
+  ((1)
+   'one)
+  ((2)
+   'two))")
+
+(test-pretty-print "\
+(cond
+  ((zero? x)
+   'zero)
+  ((odd? x)
+   'odd)
+  (else #f))")
+
 (test-pretty-print "\
 #~(string-append #$coreutils \"/bin/uname\")")
 
@@ -341,4 +356,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)