xml.writer: don't write arrays to output-stream
parent
3b40334ccd
commit
a4d48a1cd4
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2005, 2009 Daniel Ehrenberg
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: xml.data xml.writer tools.test fry xml kernel multiline
|
||||
USING: xml.data xml.writer tools.test fry xml xml.syntax kernel multiline
|
||||
xml.writer.private io.streams.string xml.traversal sequences
|
||||
io.encodings.utf8 io.files accessors io.directories ;
|
||||
io.encodings.utf8 io.files accessors io.directories math math.parser ;
|
||||
IN: xml.writer.tests
|
||||
|
||||
\ write-xml must-infer
|
||||
|
@ -66,3 +66,11 @@ CONSTANT: test-file "resource:basis/xml/writer/test.xml"
|
|||
[ ] [ "<?xml version='1.0' encoding='UTF-16BE'?><x/>" string>xml test-file utf8 [ write-xml ] with-file-writer ] unit-test
|
||||
[ "x" ] [ test-file file>xml body>> name>> main>> ] unit-test
|
||||
[ ] [ test-file delete-file ] unit-test
|
||||
|
||||
[ ] [
|
||||
{ 1 2 3 4 } [
|
||||
[ number>string ] [ sq number>string ] bi
|
||||
[XML <tr><td><-></td><td><-></td></tr> XML]
|
||||
] map [XML <h2>Timings</h2> <table><-></table> XML]
|
||||
pprint-xml
|
||||
] unit-test
|
|
@ -19,7 +19,7 @@ SYMBOL: indentation
|
|||
|
||||
: indent-string ( -- string )
|
||||
xml-pprint? get
|
||||
[ indentation get indenter get <repetition> concat ]
|
||||
[ indentation get indenter get <repetition> "" join ]
|
||||
[ "" ] if ;
|
||||
|
||||
: ?indent ( -- )
|
||||
|
|
Loading…
Reference in New Issue