diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ce78f8..032bd43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@
+- [`b8cc3db`](https://github.com/stdlib-js/stdlib/commit/b8cc3db63853dc4e9b4b949abc36bac20c3bf305) - **test:** use `Module` constructor directly _(by Athan Reines)_ - [`a510e37`](https://github.com/stdlib-js/stdlib/commit/a510e375b6e6f608c7763997ff4abad7d8941f9d) - **test:** add module `ndarray` method tests _(by Athan Reines)_ - [`f74e989`](https://github.com/stdlib-js/stdlib/commit/f74e9894ad130417d69b9763cf9a9a012ad9c251) - **test:** add tests for the `main` method _(by Athan Reines)_ - [`faeede1`](https://github.com/stdlib-js/stdlib/commit/faeede1c216d14416e8db5441225671e55e5d865) - **test:** add `Module` constructor tests _(by Athan Reines)_ diff --git a/test/test.module.main.js b/test/test.module.main.js index b0198df..c535fcf 100644 --- a/test/test.module.main.js +++ b/test/test.module.main.js @@ -25,14 +25,14 @@ var tape = require( 'tape' ); var Memory = require( '@stdlib/wasm-memory' ); var Float64Array = require( '@stdlib/array-float64' ); -var daxpy = require( './../lib' ); +var Module = require( './../lib' ).Module; // TESTS // -tape( 'main export is an object', function test( t ) { +tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof daxpy, 'object', 'main export is an object' ); + t.strictEqual( typeof Module, 'function', 'main export is a function' ); t.end(); }); @@ -43,7 +43,7 @@ tape( 'a module instance has a `main` method which has an arity of 6', function mem = new Memory({ 'initial': 0 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); t.strictEqual( mod.main.length, 6, 'returns expected value' ); t.end(); }); @@ -59,7 +59,7 @@ tape( 'a module instance has a `main` method which multiplies `x` by a constant mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -105,7 +105,7 @@ tape( 'a module instance has a `main` method which efficiently handles the case mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -137,7 +137,7 @@ tape( 'a module instance has a `main` method which supports an `x` stride', func mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -182,7 +182,7 @@ tape( 'a module instance has a `main` method which supports a `y` stride', funct mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -225,7 +225,7 @@ tape( 'a module instance has a `main` method which returns a pointer to the outp mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -251,7 +251,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, a module instance mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -287,7 +287,7 @@ tape( 'a module instance has a `main` method which supports negative strides', f mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -332,7 +332,7 @@ tape( 'a module instance has a `main` method which supports complex access patte mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; diff --git a/test/test.module.ndarray.js b/test/test.module.ndarray.js index b9cc0d4..8ef60dc 100644 --- a/test/test.module.ndarray.js +++ b/test/test.module.ndarray.js @@ -25,14 +25,14 @@ var tape = require( 'tape' ); var Memory = require( '@stdlib/wasm-memory' ); var Float64Array = require( '@stdlib/array-float64' ); -var daxpy = require( './../lib' ); +var Module = require( './../lib' ).Module; // TESTS // -tape( 'main export is an object', function test( t ) { +tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); - t.strictEqual( typeof daxpy, 'object', 'main export is an object' ); + t.strictEqual( typeof Module, 'function', 'main export is a function' ); t.end(); }); @@ -43,7 +43,7 @@ tape( 'a module instance has an `ndarray` method which has an arity of 8', funct mem = new Memory({ 'initial': 0 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); t.strictEqual( mod.ndarray.length, 8, 'returns expected value' ); t.end(); }); @@ -59,7 +59,7 @@ tape( 'a module instance has an `ndarray` method which multiplies `x` by a const mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -105,7 +105,7 @@ tape( 'a module instance has an `ndarray` method which efficiently handles the c mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -137,7 +137,7 @@ tape( 'a module instance has an `ndarray` method which supports an `x` stride', mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -182,7 +182,7 @@ tape( 'a module instance has an `ndarray` method which supports an `x` offset', mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -227,7 +227,7 @@ tape( 'a module instance has an `ndarray` method which supports a `y` stride', f mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -272,7 +272,7 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -315,7 +315,7 @@ tape( 'a module instance has an `ndarray` method which returns a pointer to the mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -341,7 +341,7 @@ tape( 'if provided an `N` parameter less than or equal to `0`, a module instance mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -377,7 +377,7 @@ tape( 'a module instance has an `ndarray` method which supports negative strides mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0; @@ -422,7 +422,7 @@ tape( 'a module instance has an `ndarray` method which supports complex access p mem = new Memory({ 'initial': 1 }); - mod = new daxpy.Module( mem ); + mod = new Module( mem ); mod.initializeSync(); xp = 0;