|
@@ -152,6 +152,15 @@ export default QUnit.module( 'Maths', () => {
|
|
|
|
|
|
} );
|
|
|
|
|
|
+
|
|
|
+ QUnit.test( "pingpong", ( assert ) => {
|
|
|
+
|
|
|
+ assert.strictEqual( MathUtils.pingpong( 2.5 ), 0.5, "Value at 2.5 is 0.5" );
|
|
|
+ assert.strictEqual( MathUtils.pingpong( 2.5, 2 ), 1.5, "Value at 2.5 with length of 2 is 1.5" );
|
|
|
+ assert.strictEqual( MathUtils.pingpong( - 1.5 ), 0.5, "Value at -1.5 is 0.5" );
|
|
|
+
|
|
|
+ } );
|
|
|
+
|
|
|
} );
|
|
|
|
|
|
} );
|