Chris Blackwell
unread,Jan 20, 2012, 5:33:34 AM1/20/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ColdSpring-Users
Not sure if this is a recent change in mxunit, but
unittests.util.CollectionTest.testSortEmptyArray fails with the
message
from Assert.cfc@416
"Cannot compare array references in ColdFusion
Arrays in ColdFusion are passed by value. To compare instances, you
may wrap the array in a struct and compare those."
Doing as suggested and wrapping the arrays in a struct allows the test
to pass.
diff --git a/unittests/util/CollectionTest.cfc b/unittests/util/
CollectionTest.cfc
index 5046952..342070a 100644
--- a/unittests/util/CollectionTest.cfc
+++ b/unittests/util/CollectionTest.cfc
@@ -209,8 +209,8 @@
assertTrue(arrayIsEmpty(local.sorted.getCollection()));
- assertNotSame(local.collection, local.sorted);
- assertNotSame(local.collection.getCollection(),
local.sorted.getCollection());
+ assertNotSame({value=local.collection}, {value=local.sorted});
+ assertNotSame({value=local.collection.getCollection()},
{value=local.sorted.getCollection()});
</cfscript>
</cffunction>
I ran the tests on railo-express 3.3.1.010, but this doesn't appear to
be engine specific
Cheers, Chris