},\r
\r
/*parse メソッド\r
- * stringプロパティを解析して、時刻を算出し、結果を$frame::beginプロパティに出力*/\r
+ * stringプロパティを解析して、時刻を算出し、結果を$frame::beginプロパティに出力\r
+ * また、イベントリスナーに登録をしておく*/\r
parse: function() {\r
this.begin = 0;\r
var str = this.trim(),\r
plusminus = str.search(/[\+\-]/),\r
- event = "";\r
+ event = null;\r
if (plusminus > 0) {\r
/*Event-Value +/- Clock-Value の場合*/\r
this.begin = this.offset( str.slice(plusminus) );\r
expect(begin.parse().begin).toEqual(0);\r
begin.string = "-0ms";\r
expect(begin.parse().begin).toEqual(0);\r
- } );\r
+ \r
+ begin.string = "click";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "id.click";\r
+ expect(begin.parse().begin).toEqual(0);\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 = " 1 0 0 m s";\r
begin.isResolved = false;\r
expect(begin.parse().begin).toEqual(1);\r
expect(begin.isResolved).toBeTruthy();\r
+\r
+ begin.string="click+0";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "click+1";\r
+ expect(begin.parse().begin).toEqual(1000);\r
+ begin.string = " click ";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "click+0ms";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "click-0ms";\r
+ expect(begin.parse().begin).toEqual(0);\r
+\r
+ begin.string="click+0";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "click+1";\r
+ expect(begin.parse().begin).toEqual(1000);\r
+ begin.string = " click ";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "click+0ms";\r
+ expect(begin.parse().begin).toEqual(0);\r
+ begin.string = "click-0ms";\r
+ expect(begin.parse().begin).toEqual(0);\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion)", function() {\r