OSDN Git Service

Add the Spec for a replaceChild method
authordhrname <dhrname@users.sourceforge.jp>
Mon, 20 Aug 2012 10:46:21 +0000 (19:46 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Mon, 20 Aug 2012 10:46:21 +0000 (19:46 +0900)
tool/Spec/spec/SvgDomSpec.js

index 35136cd..0069e22 100644 (file)
@@ -1419,6 +1419,25 @@ describe("SVG Spec in JavaScript", function() {
     });
     /*replaceChildメソッドの境界条件を調べておく (limit value analysis, when it calls a replaceChild method)*/
     it("should be this for the value, when it calls a replaceChild method (limit value analysis)", function() {
+      var u = doc.createElementNS("http://sie.sourceforge.jp/", "ho");
+      s.insertBefore(t, null);
+      s.replaceChild(u, t);
+      expect(s.firstChild).toEqual(u)
+      expect(s.lastChild).toEqual(u)
+      expect(s.childNodes.item(0)).toEqual(u)
+      expect(s.nextSibling).toBeNull();
+      expect(s.previousSibling).toBeNull();
+      expect(s.parentNode).toBeNull();
+      expect(u.parentNode).toEqual(s)
+      expect(u.nextSibling).toBeNull();
+      expect(u.previousSibling).toBeNull();
+      expect(u.firstChild).toBeNull();
+      expect(u.lastChild).toBeNull();
+      expect(t.parentNode).toBeNull();
+      expect(t.nextSibling).toBeNull();
+      expect(t.previousSibling).toBeNull();
+      expect(t.firstChild).toBeNull();
+      expect(t.lastChild).toBeNull();
     });
     /*hasChildNodesメソッドの境界条件を調べておく (limit value analysis, when it calls a hasChildNodes method)*/
     it("should be this for the value, when it calls a hasChildNodes method (limit value analysis)", function() {