From ff386d896abc69af24b62390bfe1d5358c688023 Mon Sep 17 00:00:00 2001 From: Tom Schuster Date: Sat, 2 Nov 2024 11:26:48 +0100 Subject: [PATCH] tests: Test XML.prototype.child with attributes and wildcards --- tests/tests/swfs/avm2/xml_child/Test.as | 10 ++++++++++ tests/tests/swfs/avm2/xml_child/output.txt | 8 ++++++++ tests/tests/swfs/avm2/xml_child/test.swf | Bin 1345 -> 1481 bytes 3 files changed, 18 insertions(+) diff --git a/tests/tests/swfs/avm2/xml_child/Test.as b/tests/tests/swfs/avm2/xml_child/Test.as index beaed1ccc248..1b420955c150 100644 --- a/tests/tests/swfs/avm2/xml_child/Test.as +++ b/tests/tests/swfs/avm2/xml_child/Test.as @@ -7,6 +7,7 @@ var xml: XML = new XML("foo1bar1foo2") trace('child("foo") length: ' + xml.child("foo").length()); trace('child("bar") length: ' + xml.child("bar").length()); trace('child("XXXXX") length: ' + xml.child("XXX").length()); +trace('child("*") length: ' + xml.child("*").length()); for each (var child in xml.child("foo")) { trace('child("foo") toString: ' + child.toString()); @@ -14,6 +15,9 @@ for each (var child in xml.child("foo")) { for each (var child in xml.child("bar")) { trace('child("bar") toString: ' + child.toString()); } +for each (var child in xml.child("*")) { + trace('child("*") toString: ' + child.toString()); +} var nested: XML = new XML("bbb") trace('child("a").length: ' + nested.child("a").length()); @@ -45,3 +49,9 @@ trace('xml_list.child("unknown").length():', xml_list.child("unknown").length()) trace('xml_list.child("b"):', xml_list.child("b")); trace('xml_list.child("c"):', xml_list.child("c")); trace('xml_list.child("unknown"):', xml_list.child("unknown")); + +var attrs: XML = ; +trace('attrs.child("@unknown"):', attrs.child("@unknown")) +trace('attrs.child("@hello"):', attrs.child("@hello")) +trace('attrs.child("@foo"):', attrs.child("@foo")) +trace('attrs.child("@*"):', attrs.child("@*")) diff --git a/tests/tests/swfs/avm2/xml_child/output.txt b/tests/tests/swfs/avm2/xml_child/output.txt index 3141c945b414..bc64ff3de03b 100644 --- a/tests/tests/swfs/avm2/xml_child/output.txt +++ b/tests/tests/swfs/avm2/xml_child/output.txt @@ -1,9 +1,13 @@ child("foo") length: 2 child("bar") length: 1 child("XXXXX") length: 0 +child("*") length: 3 child("foo") toString: foo1 child("foo") toString: foo2 child("bar") toString: bar1 +child("*") toString: foo1 +child("*") toString: bar1 +child("*") toString: foo2 child("a").length: 1 child("b").length: 0 child("a").@b: c @@ -15,3 +19,7 @@ xml_list.child("b"): a1-b1 a2-b xml_list.child("c"): a2-c xml_list.child("unknown"): +attrs.child("@unknown"): +attrs.child("@hello"): world +attrs.child("@foo"): bar +attrs.child("@*"): worldbar diff --git a/tests/tests/swfs/avm2/xml_child/test.swf b/tests/tests/swfs/avm2/xml_child/test.swf index a16f522172bc8b6417d485d76d2640858c131aeb..f59becfb7f3d29566ce034227020d99ecaa0ba48 100644 GIT binary patch literal 1481 zcmV;)1vdIaS5qd13IG6j0fkmebK6uH)sIkQG-IggW zQ^U|<#*@)AR-;HBS&rQmGyMtt0#^JDRxH>B80fHp88)zBVSYjQt}NL~xncts_6wbsr=RrHGqYehYNu5Z z$3(0N?7%UV!?vooOrh?Wec^B{56MFY<{D$4N;FFg6h$>uhrU8Zl81HeuIAXCmg&cJ z8lDyOR38d@UDpVmhQcus%XHsV1Mh!DF%3%`)jjU2$EISsN1r#soFgclff|^~Gw)20 z@`6;7wuW{wSP}8cCw3x2U~?5>D$~93?0MnS!$#wa=Pzo+`81q>OII!PH&r1XkQWyh zU#2MtG0^DD$q$=wN(iDM*#CSDz3?Uktq(+|(!bkrcE2C%pO z#E@%Zv@?lukPN9aPu#%tRXwoJ%psD!6o25sfwf)Jr(S;YbgR-=DwgLd(8?7N_bQs| zE6`wwdvR2XqGDf31(4pnuD5K*xRV1-Ze4Ip_c& zfs4B_VOT6iWg#|!(~Z$vc%@W9J6O}<{nQjq(_n$%T&d9dO6)<+trz39Kx&L?NmQGT z{9?AXHR*ho`2f<${Ly1slM9*c2_KfQu_ksSx@bDs@Gb3VKD< zFOfwh4c4K^GTe^fr4E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