\r
/*$toオブジェクトにこのオブジェクトを適用させる関数*/\r
call: function() {\r
+ /*advanceメソッドで使うために、stringを保持*/\r
+ this.numList.string = this.string;\r
if (this.numList.length\r
&& (this.additive[0] === 0)\r
&& (this.accumulate[0] === 0)\r
if ( (t < 0) || (1 < t)) {\r
throw new Error("An Invalid Number Error");\r
}\r
- if (!this.string || !this.from.length) {\r
+ if (!this.string) {\r
return "";\r
+ } else if (!this.from.length) {\r
+ /*discreteのために、this.stringに数値が入っていない場合の対処*/\r
+ return this.from.string;\r
}\r
var str = "",\r
numList = this.numList,\r
from.up("$to").mix( function() {\r
this.string = "12cm";\r
this.call();\r
- expect(this.numList).toEqual([]);\r
+ var arr = [];\r
+ arr.string = this.string;\r
+ expect(this.numList).toEqual(arr);\r
expect(this.strList).toBeNull();\r
} );\r
} );\r
from.$to.advance(-0.01);\r
}).toThrow("An Invalid Number Error");\r
\r
- from.string = "0";\r
+ var arr = [];\r
+ \r
+ from = base("$from").up();\r
+ from.up("$to");\r
+ from.$to.from = from;\r
+ arr.string = from.string = "0";\r
from.$to.string = "1";\r
expect(from.$to.call()).toBe(from.$to.numList);\r
expect(from.$to.numList[0]).toBe(1);\r
expect(from.$to.from).toBe(from.numList);\r
expect(from.$to.advance(0)).toBe("0"); \r
expect(from.call()).toBe(from.numList);\r
+ \r
+ from = base("$from").up();\r
+ from.up("$to");\r
+ from.$to.from = from;\r
+ from.string = "inline";\r
+ arr.string = from.$to.string = "block";\r
+ expect(from.$to.call()).toBe(from.$to.numList);\r
+ expect(from.$to.numList).toEqual(arr);\r
+ expect(from.$to.strList).toEqual(["block"]);\r
+ arr.string = from.string;\r
+ expect(from.numList).toEqual(arr);\r
+ expect(from.strList).toEqual(["inline"]);\r
+ expect(from.advance(0)).toBe("");\r
+ expect(from.$to.from).toBe(from.numList);\r
+ expect(from.$to.advance(0)).toBe("inline"); \r
+ expect(from.call()).toBe(from.numList);\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion)", function() {\r
expect(from.setAdditive()).toBe(0);\r
expect(from.setAdditive("")).toBe(0);\r
expect(from.additive).toEqual([0]);\r
- expect(from.setAdditive("1")).toEqual([1]);\r
- expect(from.additive).toEqual([1]);\r
+ var arr = [1];\r
+ arr.string = "1";\r
+ expect(from.setAdditive("1")).toEqual(arr);\r
+ expect(from.additive).toEqual(arr);\r
} );\r
/*同値分割をして、有効同値クラスを調べておく (Equivalence partitioning, the following is the valid partion)*/\r
it("should be this for the value (the valid partion)", function() {\r
- expect(from.setAdditive("1 2, 3")).toEqual([1, 2, 3]);\r
- expect(from.additive).toEqual([1, 2, 3]);\r
+ var arr = [1, 2, 3];\r
+ arr.string = "1 2, 3";\r
+ expect(from.setAdditive("1 2, 3")).toEqual(arr);\r
+ expect(from.additive).toEqual(arr);\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion)", function() {\r
expect(calc.call()(0.3)).toBe("0.5");\r
/*もう一度確かめる*/\r
expect(calc.call()(0.2)).toBe("0.5");\r
+ \r
+ calc.to = base("$from").up();\r
+ calc.to.from = base("$from").up(); \r
+ calc.mode = "discrete";\r
+ calc.keyTime = 0.5;\r
+ calc.to.degit = 1;\r
+ calc.to.string = "block";\r
+ calc.to.from.string = "inline";\r
+ expect(calc.call()(0.2)).toBe("inline");\r
+ expect(calc.call()(0.3)).toBe("inline");\r
} );\r
/*無効同値クラスを調べておく (Equivalence partitioning, the following is the invalid partion)*/\r
it("should be this for the value (the invalid partion)", function() {\r