diff options
author | Szabolcs Berecz <szabolcs.berecz@gmail.com> | 2012-01-10 23:33:07 +0100 |
---|---|---|
committer | Szabolcs Berecz <szabolcs.berecz@gmail.com> | 2012-01-14 22:28:18 +0100 |
commit | 126469f9224430f09af31afb50bf4f6fa0b4e189 (patch) | |
tree | 3b59fd20574ebe3b5f9647587222e8063a792027 /test/files | |
parent | 066b1a1f5d80e1a314d6e96a9a8c0b4d76a8c7a1 (diff) | |
download | scala-126469f9224430f09af31afb50bf4f6fa0b4e189.tar.gz scala-126469f9224430f09af31afb50bf4f6fa0b4e189.tar.bz2 scala-126469f9224430f09af31afb50bf4f6fa0b4e189.zip |
Preserve attribute order in inline XML
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/jvm/serialization.check | 4 | ||||
-rw-r--r-- | test/files/run/xml-attribute.check | 12 | ||||
-rw-r--r-- | test/files/run/xml-attribute.scala | 24 |
3 files changed, 28 insertions, 12 deletions
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check index bc56387f81..f58f763a76 100644 --- a/test/files/jvm/serialization.check +++ b/test/files/jvm/serialization.check @@ -206,7 +206,7 @@ x equals y: true, y equals x: true x = <html> <body> - <table cellspacing="0" cellpadding="2"> + <table cellpadding="2" cellspacing="0"> <tr> <th>Last Name</th> <th>First Name</th> @@ -226,7 +226,7 @@ x = <html> </html> y = <html> <body> - <table cellspacing="0" cellpadding="2"> + <table cellpadding="2" cellspacing="0"> <tr> <th>Last Name</th> <th>First Name</th> diff --git a/test/files/run/xml-attribute.check b/test/files/run/xml-attribute.check new file mode 100644 index 0000000000..3ae2034684 --- /dev/null +++ b/test/files/run/xml-attribute.check @@ -0,0 +1,12 @@ +<t></t> +<t></t> +<t></t> +<t></t> +<t></t> +<t b="1" d="2"></t> +<t b="1" d="2"></t> +<t b="1" d="2"></t> +<t a="1" d="2"></t> +<t b="1" d="2"></t> +<t a="1" b="2" c="3"></t> +<t g="1" e="2" p:a="3" f:e="4" mgruhu:ji="5"></t>
\ No newline at end of file diff --git a/test/files/run/xml-attribute.scala b/test/files/run/xml-attribute.scala index 8b261acc94..eb3956c41b 100644 --- a/test/files/run/xml-attribute.scala +++ b/test/files/run/xml-attribute.scala @@ -12,12 +12,11 @@ object Test { assert(noAttr == preAttrNull) assert(noAttr == preAttrNone) - val noAttrStr = "<t></t>" - assert(noAttr.toString() == noAttrStr) - assert(attrNull.toString() == noAttrStr) - assert(attrNone.toString() == noAttrStr) - assert(preAttrNull.toString() == noAttrStr) - assert(preAttrNone.toString() == noAttrStr) + println(noAttr) + println(attrNull) + println(attrNone) + println(preAttrNull) + println(preAttrNone) val xml1 = <t b="1" d="2"/> val xml2 = <t a={ null: String } p:a={ null: String } b="1" c={ null: String } d="2"/> @@ -25,9 +24,14 @@ object Test { assert(xml1 == xml2) assert(xml1 == xml3) - val xml1Str = "<t d=\"2\" b=\"1\"></t>" - assert(xml1.toString() == xml1Str) - assert(xml2.toString() == xml1Str) - assert(xml3.toString() == xml1Str) + println(xml1) + println(xml2) + println(xml3) + + // Check if attribute order is retained + println(<t a="1" d="2"/>) + println(<t b="1" d="2"/>) + println(<t a="1" b="2" c="3"/>) + println(<t g="1" e="2" p:a="3" f:e="4" mgruhu:ji="5"/>) } } |