Uniform.tests.js 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /**
  2. * @author moraxy / https://github.com/moraxy
  3. */
  4. /* global QUnit */
  5. import { Uniform } from '../../../../src/core/Uniform';
  6. import { Vector3 } from '../../../../src/math/Vector3';
  7. import {
  8. x,
  9. y,
  10. z
  11. } from '../math/Constants.tests';
  12. export default QUnit.module( 'Core', () => {
  13. QUnit.module( 'Uniform', () => {
  14. // INSTANCING
  15. QUnit.test( "Instancing", ( assert ) => {
  16. var a;
  17. var b = new Vector3( x, y, z );
  18. a = new Uniform( 5 );
  19. assert.strictEqual( a.value, 5, "New constructor works with simple values" );
  20. a = new Uniform( b );
  21. assert.ok( a.value.equals( b ), "New constructor works with complex values" );
  22. } );
  23. // PUBLIC STUFF
  24. QUnit.test( "clone", ( assert ) => {
  25. var a = new Uniform( 23 );
  26. var b = a.clone();
  27. assert.strictEqual( b.value, a.value, "clone() with simple values works" );
  28. var a = new Uniform( new Vector3( 1, 2, 3 ) );
  29. var b = a.clone();
  30. assert.ok( b.value.equals( a.value ), "clone() with complex values works" );
  31. } );
  32. } );
  33. } );