Skip to content

Commit 73b92cd

Browse files
committed
Auto-generated commit
1 parent 685bd12 commit 73b92cd

5 files changed

Lines changed: 19 additions & 217 deletions

File tree

.github/.keepalive

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

.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
@@ -40,7 +40,7 @@
4040
},
4141
"dependencies": {
4242
"@stdlib/array-to-json": "^0.1.0",
43-
"@stdlib/array-uint32": "^0.1.0",
43+
"@stdlib/array-uint32": "^0.1.1",
4444
"@stdlib/assert-has-own-property": "^0.1.1",
4545
"@stdlib/assert-is-boolean": "^0.1.1",
4646
"@stdlib/assert-is-collection": "^0.1.0",
@@ -51,7 +51,7 @@
5151
"@stdlib/constants-float64-max-safe-integer": "^0.1.1",
5252
"@stdlib/constants-uint32-max": "^0.1.1",
5353
"@stdlib/math-base-ops-umul": "^0.1.1",
54-
"@stdlib/math-base-special-floor": "^0.1.0",
54+
"@stdlib/math-base-special-floor": "^0.1.1",
5555
"@stdlib/math-base-special-max": "^0.1.1",
5656
"@stdlib/random-base": "^0.1.0",
5757
"@stdlib/string-format": "^0.1.1",
@@ -64,7 +64,7 @@
6464
"devDependencies": {
6565
"@stdlib/bench": "^0.1.0",
6666
"@stdlib/math-base-assert-is-nan": "^0.1.1",
67-
"@stdlib/math-base-assert-is-nonnegative-integer": "^0.1.0",
67+
"@stdlib/math-base-assert-is-nonnegative-integer": "^0.1.1",
6868
"@stdlib/process-env": "^0.1.1",
6969
"@stdlib/random-base-minstd-shuffle": "^0.1.0",
7070
"@stdlib/stats-kstest": "^0.1.0",

test/dist/test.js

Lines changed: 4 additions & 212 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,221 +21,13 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var UINT32_MAX = require( '@stdlib/constants-uint32-max' );
25-
var FLOAT64_MAX_SAFE_INTEGER = require('@stdlib/constants-float64-max-safe-integer');
26-
var isUint32Array = require( '@stdlib/assert-is-uint32array' );
27-
var isNonNegativeInteger = require( '@stdlib/math-base-assert-is-nonnegative-integer' );
28-
var mt19937 = require( './../../dist' );
24+
var main = require( './../../dist' );
2925

3026

3127
// TESTS //
3228

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

0 commit comments

Comments
 (0)