summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-09-01 15:54:08 +0200
committerLudovic Courtès <ludo@gnu.org>2022-09-01 18:31:26 +0200
commitc3b1cfe76b7038f4030d7d207ffc417fed9a7ead (patch)
treedd1e118336d2d1f915c003ac3af46b374fe9c043 /tests
parent8cf7997d7c068eb87eadbd28ac8be4e0aeddbba3 (diff)
read-print: Guess the base to use for integers being printed.
Fixes <https://issues.guix.gnu.org/57090>. Reported by Christopher Rodriguez <yewscion@gmail.com>. * guix/read-print.scm (%symbols-followed-by-octal-integers) (%symbols-followed-by-hexadecimal-integers): New variables. * guix/read-print.scm (integer->string): New procedure. (pretty-print-with-comments): Use it. * tests/read-print.scm: Add test.
Diffstat (limited to 'tests')
-rw-r--r--tests/read-print.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/read-print.scm b/tests/read-print.scm
index 4dabcc1e64c..1b0d8659720 100644
--- a/tests/read-print.scm
+++ b/tests/read-print.scm
@@ -248,6 +248,14 @@ mnopqrstuvwxyz.\")"
248 (list x y z))") 248 (list x y z))")
249 249
250(test-pretty-print "\ 250(test-pretty-print "\
251(begin
252 (chmod \"foo\" #o750)
253 (chmod port
254 (logand #o644
255 (lognot (umask))))
256 (logand #x7f xyz))")
257
258(test-pretty-print "\
251(substitute-keyword-arguments (package-arguments x) 259(substitute-keyword-arguments (package-arguments x)
252 ((#:phases phases) 260 ((#:phases phases)
253 `(modify-phases ,phases 261 `(modify-phases ,phases