@@ -10,12 +10,12 @@ suite.addBatch({
1010
1111 "when b is a number" : {
1212 "interpolates numbers" : function ( d3 ) {
13- assert . strictEqual ( d3 . interpolate ( 2 , 12 ) ( .4 ) , 6 ) ;
13+ assert . strictEqual ( d3 . interpolate ( 2 , 12 ) ( .25 ) , 4.5 ) ;
1414 } ,
1515 "coerces a to a number" : function ( d3 ) {
1616 assert . strictEqual ( d3 . interpolate ( "" , 1 ) ( .5 ) , .5 ) ;
17- assert . strictEqual ( d3 . interpolate ( "2" , 12 ) ( .4 ) , 6 ) ;
18- assert . strictEqual ( d3 . interpolate ( [ 2 ] , 12 ) ( .4 ) , 6 ) ;
17+ assert . strictEqual ( d3 . interpolate ( "2" , 12 ) ( .25 ) , 4.5 ) ;
18+ assert . strictEqual ( d3 . interpolate ( [ 2 ] , 12 ) ( .25 ) , 4.5 ) ;
1919 }
2020 } ,
2121
@@ -79,11 +79,11 @@ suite.addBatch({
7979
8080 "when b is an array" : {
8181 "interpolates each element in b" : function ( d3 ) {
82- assert . strictEqual ( JSON . stringify ( d3 . interpolate ( [ 2 , 4 ] , [ 12 , 24 ] ) ( .4 ) ) , "[6,12 ]" ) ;
82+ assert . strictEqual ( JSON . stringify ( d3 . interpolate ( [ 2 , 4 ] , [ 12 , 24 ] ) ( .25 ) ) , "[4.5,9 ]" ) ;
8383 } ,
8484 "interpolates arrays, even when both a and b are coercible to numbers" : function ( d3 ) {
85- assert . strictEqual ( JSON . stringify ( d3 . interpolate ( [ 2 ] , [ 12 ] ) ( .4 ) ) , "[6 ]" ) ;
86- assert . strictEqual ( JSON . stringify ( d3 . interpolate ( [ [ 2 ] ] , [ [ 12 ] ] ) ( .4 ) ) , "[[6 ]]" ) ;
85+ assert . strictEqual ( JSON . stringify ( d3 . interpolate ( [ 2 ] , [ 12 ] ) ( .25 ) ) , "[4.5 ]" ) ;
86+ assert . strictEqual ( JSON . stringify ( d3 . interpolate ( [ [ 2 ] ] , [ [ 12 ] ] ) ( .25 ) ) , "[[4.5 ]]" ) ;
8787 } ,
8888 "reuses the returned array during interpolation" : function ( d3 ) {
8989 var i = d3 . interpolate ( [ 2 ] , [ 12 ] ) ;
@@ -93,10 +93,10 @@ suite.addBatch({
9393
9494 "when b is an object" : {
9595 "interpolates each property in b" : function ( d3 ) {
96- assert . deepEqual ( d3 . interpolate ( { foo : 2 , bar : 4 } , { foo : 12 , bar : 24 } ) ( .4 ) , { foo : 6 , bar : 12 } ) ;
96+ assert . deepEqual ( d3 . interpolate ( { foo : 2 , bar : 4 } , { foo : 12 , bar : 24 } ) ( .25 ) , { foo : 4.5 , bar : 9 } ) ;
9797 } ,
9898 "interpolates numbers if b is coercible to a number (!isNaN(+b))" : function ( d3 ) {
99- assert . strictEqual ( d3 . interpolate ( new Number ( 2 ) , new Number ( 12 ) ) ( .4 ) , 6 ) ;
99+ assert . strictEqual ( d3 . interpolate ( new Number ( 2 ) , new Number ( 12 ) ) ( .25 ) , 4.5 ) ;
100100 assert . strictEqual ( d3 . interpolate ( new Date ( 2012 , 0 , 1 ) , new Date ( 2013 , 0 , 1 ) ) ( .5 ) , + new Date ( 2012 , 6 , 2 , 1 ) ) ;
101101 assert . strictEqual ( d3 . interpolate ( 1 , null ) ( .4 ) , .6 ) ; // +null = 0
102102 assert . isNaN ( d3 . interpolate ( "blue" , null ) ( .4 ) ) ;
0 commit comments