23
23
var tape = require ( 'tape' ) ;
24
24
var Memory = require ( '@stdlib/wasm/memory' ) ;
25
25
var ModuleWrapper = require ( '@stdlib/wasm/module-wrapper' ) ;
26
- var daxpy = require ( './../lib' ) ;
26
+ var Module = require ( './../lib' ) . Module ;
27
27
28
28
29
29
// TESTS //
30
30
31
- tape ( 'main export is an object ' , function test ( t ) {
31
+ tape ( 'main export is a function ' , function test ( t ) {
32
32
t . ok ( true , __filename ) ;
33
- t . strictEqual ( typeof daxpy , 'object ' , 'returns expected value' ) ;
33
+ t . strictEqual ( typeof Module , 'function ' , 'returns expected value' ) ;
34
34
t . end ( ) ;
35
35
} ) ;
36
36
37
- tape ( 'the `Module` method is a constructor' , function test ( t ) {
37
+ tape ( 'the function is a constructor' , function test ( t ) {
38
38
var mem ;
39
39
var mod ;
40
40
41
41
mem = new Memory ( {
42
42
'initial' : 0
43
43
} ) ;
44
- mod = new daxpy . Module ( mem ) ;
45
- t . strictEqual ( mod instanceof daxpy . Module , true , 'returns expected value' ) ;
44
+ mod = new Module ( mem ) ;
45
+ t . strictEqual ( mod instanceof Module , true , 'returns expected value' ) ;
46
46
t . end ( ) ;
47
47
} ) ;
48
48
49
- tape ( 'the `Module` method is a constructor which does not require `new`' , function test ( t ) {
49
+ tape ( 'the function is a constructor which does not require `new`' , function test ( t ) {
50
50
var mem ;
51
51
var mod ;
52
52
53
53
mem = new Memory ( {
54
54
'initial' : 0
55
55
} ) ;
56
- mod = daxpy . Module ( mem ) ; // eslint-disable-line new-cap
57
- t . strictEqual ( mod instanceof daxpy . Module , true , 'returns expected value' ) ;
56
+ mod = Module ( mem ) ; // eslint-disable-line new-cap
57
+ t . strictEqual ( mod instanceof Module , true , 'returns expected value' ) ;
58
58
t . end ( ) ;
59
59
} ) ;
60
60
@@ -81,7 +81,7 @@ tape( 'the module constructor throws an error if provided a first argument which
81
81
82
82
function badValue ( value ) {
83
83
return function badValue ( ) {
84
- return new daxpy . Module ( value ) ;
84
+ return new Module ( value ) ;
85
85
} ;
86
86
}
87
87
} ) ;
@@ -109,7 +109,7 @@ tape( 'the module constructor throws an error if provided a first argument which
109
109
110
110
function badValue ( value ) {
111
111
return function badValue ( ) {
112
- return daxpy . Module ( value ) ; // eslint-disable-line new-cap
112
+ return Module ( value ) ; // eslint-disable-line new-cap
113
113
} ;
114
114
}
115
115
} ) ;
@@ -121,7 +121,7 @@ tape( 'the module instance returned by the module constructor inherits from a mo
121
121
mem = new Memory ( {
122
122
'initial' : 0
123
123
} ) ;
124
- mod = new daxpy . Module ( mem ) ;
124
+ mod = new Module ( mem ) ;
125
125
126
126
t . strictEqual ( mod instanceof ModuleWrapper , true , 'returns expected value' ) ;
127
127
t . end ( ) ;
@@ -134,7 +134,7 @@ tape( 'attached to a module instance is a `main` method', function test( t ) {
134
134
mem = new Memory ( {
135
135
'initial' : 0
136
136
} ) ;
137
- mod = new daxpy . Module ( mem ) ;
137
+ mod = new Module ( mem ) ;
138
138
139
139
t . strictEqual ( typeof mod . main , 'function' , 'returns expected value' ) ;
140
140
t . end ( ) ;
@@ -147,7 +147,7 @@ tape( 'attached to a module instance is an `ndarray` method', function test( t )
147
147
mem = new Memory ( {
148
148
'initial' : 0
149
149
} ) ;
150
- mod = new daxpy . Module ( mem ) ;
150
+ mod = new Module ( mem ) ;
151
151
152
152
t . strictEqual ( typeof mod . ndarray , 'function' , 'returns expected value' ) ;
153
153
t . end ( ) ;
0 commit comments