OSDN Git Service

getElementByIdメソッドのスペックに対して、同値分割チェックを追加
authordhrname <dhrname@users.sourceforge.jp>
Mon, 18 Feb 2013 14:38:19 +0000 (23:38 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Mon, 18 Feb 2013 14:38:19 +0000 (23:38 +0900)
tool/Spec/spec/SvgDomSpec.js

index 23ef59d..0b7d585 100644 (file)
@@ -1776,6 +1776,7 @@ describe("SVG Spec in JavaScript", function() {
       svg.setAttributeNS(null, "id", "a");\r
       expect(doc.getElementById("a")).toEqual(svg);\r
       svg.setAttributeNS(null, "id", "x");\r
+      expect(doc.getElementById("x")).toEqual(svg);\r
       expect(doc.getElementById("a")).toBeNull();\r
       expect(doc.getElementById("")).toBeNull();\r
     });\r
@@ -1830,7 +1831,15 @@ describe("SVG Spec in JavaScript", function() {
    });\r
     /*getElementByIdメソッドの同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
     it("should be this for the value, when it calls a getElementById method (the valid partion)", function() {\r
-\r
+      expect(doc.getElementById("ax")).toBeNull();\r
+      expect(doc.getElementById("hoge-hoge")).toBeNull();\r
+      expect(doc.getElementById("a102930")).toBeNull();\r
+      svg.setAttributeNS(null, "id", "ax");\r
+      expect(doc.getElementById("ax")).toEqual(svg);\r
+      svg.setAttributeNS(null, "id", "hoge-hoge");\r
+      expect(doc.getElementById("hoge-hoge")).toEqual(svg);\r
+      svg.setAttributeNS(null, "id", "a102930");\r
+      expect(doc.getElementById("a102930")).toEqual(svg);\r
     });\r
     /*getElementsByTagNameNSメソッドの同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
     it("should be this for the value, when it calls a getElementsByTagNameNS method (the valid partion)", function() {\r