From c3b1cfe76b7038f4030d7d207ffc417fed9a7ead Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 1 Sep 2022 15:54:08 +0200 Subject: read-print: Guess the base to use for integers being printed. Fixes . Reported by Christopher Rodriguez . * 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. --- tests/read-print.scm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/read-print.scm b/tests/read-print.scm index 4dabcc1e64..1b0d865972 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm @@ -247,6 +247,14 @@ mnopqrstuvwxyz.\")" (+ a b)))) (list x y z))") +(test-pretty-print "\ +(begin + (chmod \"foo\" #o750) + (chmod port + (logand #o644 + (lognot (umask)))) + (logand #x7f xyz))") + (test-pretty-print "\ (substitute-keyword-arguments (package-arguments x) ((#:phases phases) -- cgit 1.4.1