Uniform.tests.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* global QUnit */
  2. import { Uniform } from '../../../../src/core/Uniform.js';
  3. import { Vector3 } from '../../../../src/math/Vector3.js';
  4. import {
  5. x,
  6. y,
  7. z
  8. } from '../../utils/math-constants.js';
  9. export default QUnit.module( 'Core', () => {
  10. QUnit.module( 'Uniform', () => {
  11. // INSTANCING
  12. QUnit.test( 'Instancing', ( assert ) => {
  13. let a;
  14. const b = new Vector3( x, y, z );
  15. a = new Uniform( 5 );
  16. assert.strictEqual( a.value, 5, 'New constructor works with simple values' );
  17. a = new Uniform( b );
  18. assert.ok( a.value.equals( b ), 'New constructor works with complex values' );
  19. } );
  20. // PROPERTIES
  21. QUnit.todo( 'value', ( assert ) => {
  22. assert.ok( false, 'everything\'s gonna be alright' );
  23. } );
  24. // PUBLIC
  25. QUnit.test( 'clone', ( assert ) => {
  26. let a = new Uniform( 23 );
  27. let b = a.clone();
  28. assert.strictEqual( b.value, a.value, 'clone() with simple values works' );
  29. a = new Uniform( new Vector3( 1, 2, 3 ) );
  30. b = a.clone();
  31. assert.ok( b.value.equals( a.value ), 'clone() with complex values works' );
  32. } );
  33. } );
  34. } );
粤ICP备19079148号