Skip to content

Commit 7aa5ef3

Browse files
committed
Auto-generated commit
1 parent 2a33409 commit 7aa5ef3

File tree

5 files changed

+19
-216
lines changed

5 files changed

+19
-216
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T06:22:05.321Z

.github/workflows/publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ jobs:
182182
fi
183183
# Trim leading and trailing whitespace:
184184
dep=$(echo "$dep" | xargs)
185-
version="^$(npm view $dep version)"
185+
version="$(npm view $dep version)"
186+
if [[ -z "$version" ]]; then
187+
continue
188+
fi
189+
version="^$version"
186190
jq -r --arg dep "$dep" --arg version "$version" '.dependencies[$dep] = $version' package.json > package.json.tmp
187191
mv package.json.tmp package.json
188192
done
@@ -192,7 +196,11 @@ jobs:
192196
fi
193197
# Trim leading and trailing whitespace:
194198
dep=$(echo "$dep" | xargs)
195-
version="^$(npm view $dep version)"
199+
version="$(npm view $dep version)"
200+
if [[ -z "$version" ]]; then
201+
continue
202+
fi
203+
version="^$version"
196204
jq -r --arg dep "$dep" --arg version "$version" '.devDependencies[$dep] = $version' package.json > package.json.tmp
197205
mv package.json.tmp package.json
198206
done

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ Stephannie Jiménez Gacha <steff456@hotmail.com>
3737
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
3838
orimiles5 <97595296+orimiles5@users.noreply.github.com>
3939
rei2hu <reimu@reimu.ws>
40+
Robert Gislason <gztown2216@yahoo.com>

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"url": "https://github.com/stdlib-js/stdlib/issues"
4040
},
4141
"dependencies": {
42-
"@stdlib/array-int32": "^0.1.0",
42+
"@stdlib/array-int32": "^0.1.1",
4343
"@stdlib/array-to-json": "^0.1.0",
4444
"@stdlib/assert-has-own-property": "^0.1.1",
4545
"@stdlib/assert-is-boolean": "^0.1.1",
@@ -49,7 +49,7 @@
4949
"@stdlib/assert-is-positive-integer": "^0.1.0",
5050
"@stdlib/blas-base-gcopy": "^0.1.0",
5151
"@stdlib/constants-int32-max": "^0.1.1",
52-
"@stdlib/math-base-special-floor": "^0.1.0",
52+
"@stdlib/math-base-special-floor": "^0.1.1",
5353
"@stdlib/random-base": "^0.1.0",
5454
"@stdlib/string-format": "^0.1.1",
5555
"@stdlib/types": "^0.1.0",
@@ -61,7 +61,7 @@
6161
"devDependencies": {
6262
"@stdlib/bench": "^0.1.0",
6363
"@stdlib/math-base-assert-is-nan": "^0.1.1",
64-
"@stdlib/math-base-assert-is-positive-integer": "^0.1.0",
64+
"@stdlib/math-base-assert-is-positive-integer": "^0.1.1",
6565
"@stdlib/process-env": "^0.1.1",
6666
"@stdlib/stats-kstest": "^0.1.0",
6767
"@stdlib/time-now": "^0.1.1",

test/dist/test.js

Lines changed: 4 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2018 The Stdlib Authors.
4+
* Copyright (c) 2023 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.
@@ -21,220 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var INT32_MAX = require( '@stdlib/constants-int32-max' );
25-
var isPositiveInteger = require( '@stdlib/math-base-assert-is-positive-integer' );
26-
var isInt32Array = require( '@stdlib/assert-is-int32array' );
27-
var minstd = require( './../../dist' );
24+
var main = require( './../../dist' );
2825

2926

3027
// TESTS //
3128

32-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3330
t.ok( true, __filename );
34-
t.strictEqual( typeof minstd, 'function', 'main export is a function' );
35-
t.end();
36-
});
37-
38-
tape( 'attached to the main export is a method to generate normalized pseudorandom numbers', function test( t ) {
39-
t.equal( typeof minstd.normalized, 'function', 'has method' );
40-
t.end();
41-
});
42-
43-
tape( 'attached to the main export is a method to generate linear congruential pseudorandom number generator', function test( t ) {
44-
t.equal( typeof minstd.factory, 'function', 'has method' );
45-
t.end();
46-
});
47-
48-
tape( 'attached to the main export is a method to serialize a pseudorandom number generator as JSON', function test( t ) {
49-
t.equal( typeof minstd.toJSON, 'function', 'has method' );
50-
t.end();
51-
});
52-
53-
tape( 'attached to the main export is the generator name', function test( t ) {
54-
t.equal( minstd.NAME, 'minstd', 'has property' );
55-
t.end();
56-
});
57-
58-
tape( 'attached to the main export is the minimum possible generated number', function test( t ) {
59-
t.equal( minstd.MIN, 1, 'has property' );
60-
t.end();
61-
});
62-
63-
tape( 'attached to the main export is the maximum possible generated number', function test( t ) {
64-
t.equal( minstd.MAX, INT32_MAX-1, 'has property' );
65-
t.end();
66-
});
67-
68-
tape( 'attached to the main export is the generator seed', function test( t ) {
69-
t.equal( isInt32Array( minstd.seed ), true, 'has property' );
70-
t.end();
71-
});
72-
73-
tape( 'attached to the main export is the generator seed length', function test( t ) {
74-
t.equal( typeof minstd.seedLength, 'number', 'has property' );
75-
t.end();
76-
});
77-
78-
tape( 'attached to the main export is the generator state', function test( t ) {
79-
t.equal( isInt32Array( minstd.state ), true, 'has property' );
80-
t.end();
81-
});
82-
83-
tape( 'attached to the main export is the generator state length', function test( t ) {
84-
t.equal( typeof minstd.stateLength, 'number', 'has property' );
85-
t.end();
86-
});
87-
88-
tape( 'attached to the main export is the generator state size', function test( t ) {
89-
t.equal( typeof minstd.byteLength, 'number', 'has property' );
90-
t.end();
91-
});
92-
93-
tape( 'the function returns pseudorandom integers strictly between 0 and 2^31-1 (inclusive)', function test( t ) {
94-
var v;
95-
var i;
96-
for ( i = 0; i < 1e3; i++ ) {
97-
v = minstd();
98-
t.equal( typeof v, 'number', 'returns a number' );
99-
t.equal( isPositiveInteger( v ), true, 'returns a positive integer' );
100-
t.equal( v >= 1 && v <= INT32_MAX-1, true, 'returns an integer between 1 and 2^31-1 (inclusive)' );
101-
}
102-
t.end();
103-
});
104-
105-
tape( 'the `normalized` method returns pseudorandom numbers strictly between 0 (inclusive) and 1 (exclusive)', function test( t ) {
106-
var v;
107-
var i;
108-
for ( i = 0; i < 1e3; i++ ) {
109-
v = minstd.normalized();
110-
t.equal( typeof v, 'number', 'returns a number' );
111-
t.equal( v >= 0.0 && v < 1.0, true, 'returns a number between 0 (inclusive) and 1 (exclusive)' );
112-
}
113-
t.end();
114-
});
115-
116-
tape( 'attached to the `normalized` method is the generator name', function test( t ) {
117-
t.equal( minstd.normalized.NAME, 'minstd', 'has property' );
118-
t.end();
119-
});
120-
121-
tape( 'attached to the `normalized` method is the minimum possible generated number', function test( t ) {
122-
t.equal( minstd.normalized.MIN, 0.0, 'has property' );
123-
t.end();
124-
});
125-
126-
tape( 'attached to the `normalized` method is the maximum possible generated number', function test( t ) {
127-
t.equal( minstd.normalized.MAX, (INT32_MAX-2.0)/(INT32_MAX-1.0), 'has property' );
128-
t.end();
129-
});
130-
131-
tape( 'attached to the `normalized` method is the generator seed', function test( t ) {
132-
t.equal( isInt32Array( minstd.normalized.seed ), true, 'has property' );
133-
t.end();
134-
});
135-
136-
tape( 'attached to the `normalized` method is the generator seed length', function test( t ) {
137-
t.equal( typeof minstd.normalized.seedLength, 'number', 'has property' );
138-
t.end();
139-
});
140-
141-
tape( 'attached to the `normalized` method is the generator state', function test( t ) {
142-
t.equal( isInt32Array( minstd.normalized.state ), true, 'has property' );
143-
t.end();
144-
});
145-
146-
tape( 'attached to the `normalized` method is the generator state length', function test( t ) {
147-
t.equal( typeof minstd.normalized.stateLength, 'number', 'has property' );
148-
t.end();
149-
});
150-
151-
tape( 'attached to the `normalized` method is the generator state size', function test( t ) {
152-
t.equal( typeof minstd.normalized.byteLength, 'number', 'has property' );
153-
t.end();
154-
});
155-
156-
tape( 'attached to the `normalized` method is a method to serialize a pseudorandom number generator as JSON', function test( t ) {
157-
t.equal( typeof minstd.normalized.toJSON, 'function', 'has method' );
158-
t.end();
159-
});
160-
161-
tape( 'the generator supports setting the generator state', function test( t ) {
162-
var state;
163-
var arr;
164-
var i;
165-
166-
// Move to a future state...
167-
for ( i = 0; i < 100; i++ ) {
168-
minstd();
169-
}
170-
// Capture the current state:
171-
state = minstd.state;
172-
173-
// Move to a future state...
174-
arr = [];
175-
for ( i = 0; i < 100; i++ ) {
176-
arr.push( minstd() );
177-
}
178-
// Set the state:
179-
minstd.state = state;
180-
181-
// Replay previously generated values...
182-
for ( i = 0; i < 100; i++ ) {
183-
t.equal( minstd(), arr[ i ], 'returns expected value. i: '+i+'.' );
184-
}
185-
t.end();
186-
});
187-
188-
tape( 'the generator supports setting the generator state (normalized)', function test( t ) {
189-
var state;
190-
var arr;
191-
var i;
192-
193-
// Move to a future state...
194-
for ( i = 0; i < 100; i++ ) {
195-
minstd.normalized();
196-
}
197-
// Capture the current state:
198-
state = minstd.state;
199-
200-
// Move to a future state...
201-
arr = [];
202-
for ( i = 0; i < 100; i++ ) {
203-
arr.push( minstd.normalized() );
204-
}
205-
// Set the state:
206-
minstd.state = state;
207-
208-
// Replay previously generated values...
209-
for ( i = 0; i < 100; i++ ) {
210-
t.equal( minstd.normalized(), arr[ i ], 'returns expected value. i: '+i+'.' );
211-
}
212-
t.end();
213-
});
214-
215-
tape( 'the generator supports setting the generator state (normalized)', function test( t ) {
216-
var state;
217-
var arr;
218-
var i;
219-
220-
// Move to a future state...
221-
for ( i = 0; i < 100; i++ ) {
222-
minstd.normalized();
223-
}
224-
// Capture the current state:
225-
state = minstd.normalized.state;
226-
227-
// Move to a future state...
228-
arr = [];
229-
for ( i = 0; i < 100; i++ ) {
230-
arr.push( minstd.normalized() );
231-
}
232-
// Set the state:
233-
minstd.normalized.state = state;
234-
235-
// Replay previously generated values...
236-
for ( i = 0; i < 100; i++ ) {
237-
t.equal( minstd.normalized(), arr[ i ], 'returns expected value. i: '+i+'.' );
238-
}
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
23932
t.end();
24033
});

0 commit comments

Comments
 (0)