mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-22 03:30:22 +02:00
deprecate omission of port to ice-9 format
* module/ice-9/format.scm (format): Add port and format-string as formal arguments. Seems also to have triggered a reindent. Formally deprecate omitting the port, as it's usually an error. * test-suite/tests/format.test ("format basic output") ("format basic output", "~{ iteration"): Fix up tests that omitted the destination port.
This commit is contained in:
parent
29d096c8e6
commit
2ce77e6cf6
2 changed files with 72 additions and 53 deletions
|
@ -26,9 +26,9 @@
|
|||
|
||||
(with-test-prefix "format basic output"
|
||||
(pass-if "format ~% produces a new line"
|
||||
(string=? (format "~%") "\n"))
|
||||
(string=? (format #f "~%") "\n"))
|
||||
(pass-if "format ~& starts a fresh line"
|
||||
(string=? (format "~&abc~&~&") "abc\n"))
|
||||
(string=? (format #f "~&abc~&~&") "abc\n"))
|
||||
(pass-if "format ~& is stateless but works properly across outputs via port-column"
|
||||
(string=?
|
||||
(with-output-to-string
|
||||
|
@ -39,7 +39,7 @@
|
|||
(format #t "~&~&")))
|
||||
"xyz\nabc\n"))
|
||||
(pass-if "format ~F (format-out-substr) maintains the column correctly"
|
||||
(= (string-length (format "~@F~20T" 1)) 20)))
|
||||
(= (string-length (format #f "~@F~20T" 1)) 20)))
|
||||
|
||||
;;;
|
||||
;;; misc
|
||||
|
@ -99,4 +99,4 @@
|
|||
;; In Guile 1.6.4 and earlier, the maximum iterations parameter defaulted
|
||||
;; to 100, but it's now like Common Lisp where the default is no limit
|
||||
(pass-if "no arbitrary iteration limit"
|
||||
(= (string-length (format "~{~a~}" (make-list 200 #\b))) 200)))
|
||||
(= (string-length (format #f "~{~a~}" (make-list 200 #\b))) 200)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue