Skip to content

Commit eff537d

Browse files
authored
Update test.nanminabs.js
Signed-off-by: Kaushikgtm <[email protected]>
1 parent 454fa59 commit eff537d

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed
Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2020 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -33,62 +33,62 @@ tape('main export is a function', function test(t) {
3333
t.ok(true, __filename);
3434
t.strictEqual(typeof nanminabs, 'function', 'main export is a function');
3535
t.end();
36-
});
37-
38-
tape('the function calculates the minimum absolute value of a strided array (with accessor support)', function test(t) {
36+
});
37+
38+
tape('the function calculates the minimum absolute value of a strided array (with accessor support)', function test(t) {
3939
var x, v;
40-
40+
4141
x = toAccessorArray([1.0, -2.0, -4.0, 5.0, 0.0, 3.0, NaN, NaN]);
42-
v = nanminabs(x.data.length, x, 1, 0);
42+
v = nanminabs(x.length, x, 1, 0);
4343
t.strictEqual(v, 0.0, 'returns expected value');
44-
44+
4545
x = toAccessorArray([-4.0, NaN, -5.0]);
46-
v = nanminabs(x.data.length, x, 1, 0);
46+
v = nanminabs(x.length, x, 1, 0);
4747
t.strictEqual(v, 4.0, 'returns expected value');
48-
48+
4949
x = toAccessorArray([0.0, NaN, -0.0, 0.0]);
50-
v = nanminabs(x.data.length, x, 1, 0);
50+
v = nanminabs(x.length, x, 1, 0);
5151
t.strictEqual(isPositiveZero(v), true, 'returns expected value');
52-
52+
5353
x = toAccessorArray([NaN]);
54-
v = nanminabs(x.data.length, x, 1, 0);
54+
v = nanminabs(x.length, x, 1, 0);
5555
t.strictEqual(isnan(v), true, 'returns expected value');
56-
56+
5757
x = toAccessorArray([NaN, NaN]);
58-
v = nanminabs(x.data.length, x, 1, 0);
58+
v = nanminabs(x.length, x, 1, 0);
5959
t.strictEqual(isnan(v), true, 'returns expected value');
60-
60+
6161
t.end();
62-
});
63-
64-
tape('if provided an `N` parameter less than or equal to `0`, the function returns `NaN`', function test(t) {
62+
});
63+
64+
tape('if provided an `N` parameter less than or equal to `0`, the function returns `NaN`', function test(t) {
6565
var x, v;
66-
66+
6767
x = toAccessorArray([1.0, -2.0, -4.0, 5.0, 3.0]);
68-
68+
6969
v = nanminabs(0, x, 1, 0);
7070
t.strictEqual(isnan(v), true, 'returns expected value');
71-
71+
7272
v = nanminabs(-1, x, 1, 0);
7373
t.strictEqual(isnan(v), true, 'returns expected value');
74-
74+
7575
t.end();
76-
});
77-
78-
tape('if provided an `N` parameter equal to `1`, the function returns the first element', function test(t) {
76+
});
77+
78+
tape('if provided an `N` parameter equal to `1`, the function returns the first element', function test(t) {
7979
var x, v;
80-
80+
8181
x = toAccessorArray([1.0, -2.0, -4.0, 5.0, 3.0]);
82-
82+
8383
v = nanminabs(1, x, 1, 0);
8484
t.strictEqual(v, 1.0, 'returns expected value');
85-
85+
8686
t.end();
87-
});
88-
89-
tape('the function supports a `stride` parameter', function test(t) {
87+
});
88+
89+
tape('the function supports a `stride` parameter', function test(t) {
9090
var N, x, v;
91-
91+
9292
x = toAccessorArray([
9393
1.0,
9494
2.0,
@@ -101,17 +101,17 @@ tape('main export is a function', function test(t) {
101101
NaN,
102102
NaN
103103
]);
104-
105-
N = Math.floor(x.data.length / 2);
104+
105+
N = Math.floor(x.length / 2);
106106
v = nanminabs(N, x, 2, 0);
107-
107+
108108
t.strictEqual(v, 1.0, 'returns expected value');
109109
t.end();
110-
});
111-
112-
tape('the function supports a negative `stride` parameter', function test(t) {
110+
});
111+
112+
tape('the function supports a negative `stride` parameter', function test(t) {
113113
var N, x, v;
114-
114+
115115
x = toAccessorArray([
116116
NaN,
117117
NaN,
@@ -124,28 +124,28 @@ tape('main export is a function', function test(t) {
124124
4.0,
125125
2.0
126126
]);
127-
128-
N = Math.floor(x.data.length / 2);
129-
v = nanminabs(N, x, -2, x.data.length - 1);
130-
127+
128+
N = Math.floor(x.length / 2);
129+
v = nanminabs(N, x, -2, x.length - 1);
130+
131131
t.strictEqual(v, 1.0, 'returns expected value');
132132
t.end();
133-
});
134-
135-
tape('if provided a `stride` parameter equal to `0`, the function returns the first element', function test(t) {
133+
});
134+
135+
tape('if provided a `stride` parameter equal to `0`, the function returns the first element', function test(t) {
136136
var x, v;
137-
137+
138138
x = toAccessorArray([1.0, -2.0, -4.0, 5.0, 3.0]);
139-
140-
v = nanminabs(x.data.length, x, 0, 0);
139+
140+
v = nanminabs(x.length, x, 0, 0);
141141
t.strictEqual(v, 1.0, 'returns expected value');
142-
142+
143143
t.end();
144-
});
145-
146-
tape('the function supports view offsets', function test(t) {
144+
});
145+
146+
tape('the function supports view offsets', function test(t) {
147147
var x0, x1, N, v;
148-
148+
149149
x0 = new Float64Array([
150150
2.0,
151151
1.0,
@@ -159,13 +159,13 @@ tape('main export is a function', function test(t) {
159159
NaN,
160160
NaN
161161
]);
162-
162+
163163
x1 = new Float64Array(x0.buffer, x0.BYTES_PER_ELEMENT * 1); // start at 2nd element
164164
N = Math.floor(x1.length / 2);
165-
165+
166166
x1 = toAccessorArray(x1);
167167
v = nanminabs(N, x1, 2, 0);
168168
t.strictEqual(v, 1.0, 'returns expected value');
169-
169+
170170
t.end();
171-
});
171+
});

0 commit comments

Comments
 (0)