A little splice test to demonstrate the bug that the unit test will cover
authorAndy Allan <andy@gravitystorm.co.uk>
Sat, 2 Apr 2011 14:23:29 +0000 (15:23 +0100)
committerAndy Allan <andy@gravitystorm.co.uk>
Sat, 2 Apr 2011 14:23:29 +0000 (15:23 +0100)
tests/src/net/systemeD/halcyon/connection/actions/AddMemberToRelationActionTest.as

index 2704e7a..f99ef9b 100644 (file)
@@ -28,14 +28,15 @@ package net.systemeD.halcyon.connection.actions {
         [Test]
         public function spliceStuff():void {
 
+            // create an array
             var arr:Array = ["a", "b", "c", "d"];
-            Assert.assertEquals(arr.length, 4);
+            Assert.assertEquals(4, arr.length);
 
+            // doesn't actually splice onto the end, inserts at position 4
             arr.splice(-1, 0, "e");
-            Assert.assertEquals(arr.length, 5);
-
-            arr.splice(-1, 1);
-            Assert.assertEquals(arr.length, 4);
+            Assert.assertEquals(5, arr.length);
+            Assert.assertEquals("e", arr[3]);
+            Assert.assertEquals("d", arr[4]);
         }
     }
 }
\ No newline at end of file