Quantcast
Channel: Adobe Community : Popular Discussions - FlexUnit
Viewing all articles
Browse latest Browse all 25673

XML Object Comparison

$
0
0

When comparing two XML objects, it appears that flexunit is reporting their equality when the values of XML elements are not equal.

 

Here's a valid example:

 

var xmlA:XML =

<root>

     <element1>text1</element1>

     <element2>text2</element2>

</root>;

 

var xmlB:XML =

<root>

     <element2>text2</element2>

     <element1>text1</element1>

</root>;

 

Assert.assertTrue(ObjectUtil.compare(xmlA, xmlB) == 0)   => true

 

This is correct: element order does not matter and $xmlA/root/element1 == $xmlB/root/element1

 

Here's an invalid example:

 

var xmlA:XML =

<root>

     <element1>text1</element1>

     <element2>text2</element2>

</root>;

 

var xmlB:XML =

<root>

     <element1>text3</element1>

     <element2>text2</element2>

</root>;

 

Assert.assertTrue(ObjectUtil.compare(xmlA, xmlB) == 0)   => true

 

This is NOT correct: $xmlA/root/element1 != $xmlB/root/element1

 

Can somebody confirm this?  If confirmed, is this by design or am I missing something?

 

Thanks!

 

Sam


Viewing all articles
Browse latest Browse all 25673

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>