return null;\r
}\r
this.parse(this.string);\r
- return this.isResolved ?\r
- this.begin\r
- : "indefinite";\r
+ return this.isResolved ? this.begin\r
+ : "indefinite";\r
}\r
} ).mix( {\r
/*イベントリスナー用の関数*/\r
this.to.call();\r
return function(t) {\r
/*tは進捗率*/\r
- if (!this.keyTime) {\r
- t = 0;\r
- } \r
+ !this.keyTime && (t = 0);\r
t = t / this.keyTime;\r
- console.log(this.to.from);\r
- return this.to.advance(t);\r
+ return isNaN(t) ? "0"\r
+ : this.to.advance(t);\r
}.bind(this);\r
}\r
} ).to = base("$from").$to;\r
expect(calc.call()(0)).toBe("0");\r
expect(calc.keyTime).toBe(1);\r
expect(calc.call()(1)).toBe("1");\r
+ \r
+ calc.keyTime = 0;\r
+ expect(calc.call()(1)).toBe("0");\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion)", function() {\r
calc.keyTime = 0.5;\r
+ calc.to.degit = 1;\r
expect(calc.call()(0.2)).toBe("0.4");\r
expect(calc.call()(0.3)).toBe("0.6");\r
/*もう一度確かめる*/\r
calc.to.string = "1s";\r
calc.to.degit = 1;\r
expect(calc.call()(0.1)).toBe("0.5s");\r
+\r
+ calc = base("$calcMode").up();\r
+ calc.keyTime = 0.5;\r
+ calc.to = base("$from").up();\r
+ calc.to.from = base("$from").up(); \r
+ calc.to.from.string = "rgb(100, 20, 32)";\r
+ calc.to.string = "rgb(0, 10, 50)";\r
+ expect(calc.call()(0.25)).toBe("rgb(50, 15, 41)");\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion)", function() {\r
+ calc.keyTime = null;\r
+ expect(calc.call()(1)).toEqual("0");\r
+ \r
+ calc.keyTime = 1/0;\r
+ expect(calc.call()(1)).toEqual("0");\r
} );\r
} );\r
} );\r