OSDN Git Service

Modify the Spec about base.js
authordhrname <dhrname@users.sourceforge.jp>
Sun, 25 Jan 2015 14:25:37 +0000 (23:25 +0900)
committerdhrname <dhrname@users.sourceforge.jp>
Sun, 25 Jan 2015 14:25:37 +0000 (23:25 +0900)
org/w3c/dom/smil.js
tool/Spec/spec/BaseJSSpec.js
tool/Spec/spec/SvgDomSpec.js

index 7bdef68..6212299 100644 (file)
@@ -188,10 +188,20 @@ base("$frame").mix ( {
     }\r
   }\r
 } ).mix( function($frame) {  \r
-  /*$beginオブジェクト\r
+  /*$begin オブジェクト\r
    * 開始のタイミングを計算する*/\r
-  $frame.up("$begin").mix(\r
-  );\r
+  $frame.up("$begin").mix( {\r
+    /*開始時刻やタイミングが書かれた文字列*/\r
+    string: "",\r
+    trim: function() {\r
+      return ( this.string = this.string.replace(/\s\n/g, "") );\r
+    },\r
+    offset: function() {\r
+      return parseFloat(this.trim().match(/[\+\-]?\d+$/));\r
+    },\r
+    event: function() {\r
+    }\r
+  } );\r
 } );\r
 /*$presentvalue オブジェクト\r
  * 呈示値 (presentation value)の計算をする。値そのものを返すためのオブジェクト*/\r
index 0684fdc..2ad9b5a 100644 (file)
@@ -349,8 +349,8 @@ describe("base.js", function() {
         base("$fp").$1.mix( function(_) {\r
           expect(_.a).toEqual(0);\r
           expect(_.b).toEqual(1);\r
-          expect(_.c).toBeTrue();\r
-          expect(_.d).toBeFalse();\r
+          expect(_.c).toBeTruthy();\r
+          expect(_.d).toBeFalsy();\r
           expect(typeof _.e).toBe("object");\r
           expect(typeof _.f).toBe("function");\r
           expect(_.g.length).toEqual(0);\r
@@ -435,8 +435,8 @@ describe("base.js", function() {
       base("$bfp").$1.mix( function(_) {\r
         expect(_.a).toEqual(0);\r
         expect(_.b).toEqual(1);\r
-        expect(_.c).toBeTrue();\r
-        expect(_.d).toBeFalse();\r
+        expect(_.c).toBeTruthy();\r
+        expect(_.d).toBeFalsy();\r
         expect(typeof _.e).toBe("object");\r
         expect(_.f).toBeUndefined();\r
         expect(_.g.length).toEqual(0);\r
@@ -507,7 +507,7 @@ describe("base.js", function() {
           return this.lazy.a;\r
         }\r
       } );\r
-      expect(base("$bfp").$s.call())toBe(base("$cfp"));\r
+      expect(base("$bfp").$s.call()).toBe(base("$cfp"));\r
     });\r
     \r
     /*無効同値を調べる*/\r
index 1f17659..2777445 100644 (file)
@@ -2113,4 +2113,22 @@ describe("SMIL Animation Spec", function() {
     });\r
   } );\r
   \r
+  describe("$begin object", function() {\r
+    var begin = base("$frame").$begin;\r
+    /*境界条件を調べておく (limit value analysis)*/\r
+    it("should be this for the value  (limit value analysis)", function() {\r
+      expect(begin.trim()).toBe("");\r
+      begin.string = " ";\r
+      expect(begin.trim()).toBe("");\r
+    } );\r
+    /*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
+    it("should be this for the value (the valid partion)", function() {\r
+      begin.string = " hoge ";\r
+      expect(begin.trim()).toBe("w");\r
+    } );\r
+    /*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
+    it("should be this for the value (the invalid partion)", function() {\r
+      \r
+    } );\r
+  } );\r
 } )\r