Skip to content

Commit

Permalink
test: use Module constructor directly
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Sep 20, 2024
1 parent a510e37 commit b8cc3db
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand All @@ -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();
});
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand All @@ -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();
});
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

1 comment on commit b8cc3db

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
blas/base/daxpy-wasm $\color{green}641/641$
$\color{green}+100.00\%$
$\color{green}17/17$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}641/641$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.