Skip to content

Commit 95eb45b

Browse files
committed
test: add tests to ensure full test coverage
1 parent 705c20b commit 95eb45b

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

lib/node_modules/@stdlib/blas/base/idamax/test/test.idamax.js

+18
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,24 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', f
9090
t.end();
9191
});
9292

93+
tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) {
94+
var expected;
95+
var idx;
96+
var x;
97+
98+
x = new Float64Array( [
99+
1.0,
100+
2.0,
101+
3.0
102+
] );
103+
expected = 0;
104+
105+
idx = idamax( 1, x, 1 );
106+
t.strictEqual( idx, expected, 'returns expected value' );
107+
108+
t.end();
109+
});
110+
93111
tape( 'if provided a `strideX` parameter less than or equal to `0`, the function returns `-1`', function test( t ) {
94112
var expected;
95113
var idx;

lib/node_modules/@stdlib/blas/base/idamax/test/test.idamax.native.js

+18
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,24 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', o
9999
t.end();
100100
});
101101

102+
tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', opts, function test( t ) {
103+
var expected;
104+
var idx;
105+
var x;
106+
107+
x = new Float64Array( [
108+
1.0,
109+
2.0,
110+
3.0
111+
] );
112+
expected = 0;
113+
114+
idx = idamax( 1, x, 1 );
115+
t.strictEqual( idx, expected, 'returns expected value' );
116+
117+
t.end();
118+
});
119+
102120
tape( 'if provided a `strideX` parameter less than or equal to `0`, the function returns `-1`', opts, function test( t ) {
103121
var expected;
104122
var idx;

lib/node_modules/@stdlib/blas/base/idamax/test/test.ndarray.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ tape( 'the function finds the index of the element with the maximum absolute val
7272
t.end();
7373
});
7474

75-
tape( 'if provided an `N` parameter less than `1`, the function returns `0`', function test( t ) {
75+
tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', function test( t ) {
7676
var expected;
7777
var idx;
7878
var x;
@@ -90,6 +90,24 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `0`', fu
9090
t.end();
9191
});
9292

93+
tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', function test( t ) {
94+
var expected;
95+
var idx;
96+
var x;
97+
98+
x = new Float64Array( [
99+
1.0,
100+
2.0,
101+
3.0
102+
] );
103+
expected = 0;
104+
105+
idx = idamax( 1, x, 1, 1 );
106+
t.strictEqual( idx, expected, 'returns expected value' );
107+
108+
t.end();
109+
});
110+
93111
tape( 'if provided a `strideX` parameter less than or equal to `0`, the function returns `0`', function test( t ) {
94112
var expected;
95113
var idx;

lib/node_modules/@stdlib/blas/base/idamax/test/test.ndarray.native.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ tape( 'the function finds the index of the element with the maximum absolute val
8181
t.end();
8282
});
8383

84-
tape( 'if provided an `N` parameter less than `1`, the function returns `0`', opts, function test( t ) {
84+
tape( 'if provided an `N` parameter less than `1`, the function returns `-1`', opts, function test( t ) {
8585
var expected;
8686
var idx;
8787
var x;
@@ -99,6 +99,24 @@ tape( 'if provided an `N` parameter less than `1`, the function returns `0`', op
9999
t.end();
100100
});
101101

102+
tape( 'if provided an `N` parameter equal to `1`, the function returns `0`', opts, function test( t ) {
103+
var expected;
104+
var idx;
105+
var x;
106+
107+
x = new Float64Array( [
108+
1.0,
109+
2.0,
110+
3.0
111+
] );
112+
expected = 0;
113+
114+
idx = idamax( 1, x, 1, 1 );
115+
t.strictEqual( idx, expected, 'returns expected value' );
116+
117+
t.end();
118+
});
119+
102120
tape( 'if provided a `strideX` parameter less than or equal to `0`, the function returns `0`', opts, function test( t ) {
103121
var expected;
104122
var idx;

0 commit comments

Comments
 (0)