web animation updates

This commit is contained in:
Adam Bradley
2015-06-10 15:31:15 -05:00
parent abcd8af221
commit f6a2c29605
191 changed files with 17692 additions and 29 deletions

View File

@ -0,0 +1,16 @@
suite('interpolation', function() {
test('interpolate numbers', function() {
assert.equal(interpolate(4, 2, 0.2), 3.6);
});
test('interpolate bools', function() {
assert.equal(interpolate(false, true, 0.4), false);
assert.equal(interpolate(false, true, 0.5), true);
assert.equal(interpolate(false, true, 0.5), true);
});
test('interpolate lists', function() {
assert.deepEqual(interpolate([1, 2, 3], [4, 5, 6], 0.5), [2.5, 3.5, 4.5]);
assert.deepEqual(interpolate([1], [4], 0.6), [2.8]);
assert.deepEqual(interpolate([false], [true], 0.6), [true]);
assert.deepEqual(interpolate([1, false, [3, 6]], [4, true, [6, 8]], 0.6), [2.8, true, [4.8, 7.2]]);
});
});