diff options
| author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2023-04-24 10:10:00 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-04-24 10:27:13 +0200 |
| commit | 7931ac810b8feaadcbbfa3a31786087da2d5ee73 (patch) | |
| tree | b9a45254cf47354eb8e48a43e26ba042ff645cb3 /tests/read-print.scm | |
| parent | 74e96c4cb171b17949f638d8b452d047a8f2dc6f (diff) | |
read-print: 'pretty-print-with-comments' keeps newlines on long strings.
* guix/read-print.scm (printed-string)[preserve-newlines?]: New
procedure.
Use it to preserve newlines on long strings.
* tests/read-print.scm: Add test.
Diffstat (limited to 'tests/read-print.scm')
| -rw-r--r-- | tests/read-print.scm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/read-print.scm b/tests/read-print.scm index f4627e076a4..c2b236b1721 100644 --- a/tests/read-print.scm +++ b/tests/read-print.scm | |||
| @@ -195,6 +195,11 @@ expressions." | |||
| 195 | (string-append \"a\\tb\" \"\\n\")") | 195 | (string-append \"a\\tb\" \"\\n\")") |
| 196 | 196 | ||
| 197 | (test-pretty-print "\ | 197 | (test-pretty-print "\ |
| 198 | (display \"This is a very long string. | ||
| 199 | It contains line breaks, which are preserved, | ||
| 200 | because it's a long string.\")") | ||
| 201 | |||
| 202 | (test-pretty-print "\ | ||
| 198 | (description \"abcdefghijkl | 203 | (description \"abcdefghijkl |
| 199 | mnopqrstuvwxyz.\")" | 204 | mnopqrstuvwxyz.\")" |
| 200 | #:max-width 30) | 205 | #:max-width 30) |
