Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9fb3056

Browse files
committed
Auto-generated commit
1 parent352cbb5 commit9fb3056

File tree

3 files changed

+11
-161
lines changed

3 files changed

+11
-161
lines changed

‎.github/.keepalive‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,18 @@
3737
"url":"https://github.com/stdlib-js/stdlib/issues"
3838
},
3939
"dependencies": {
40-
"@stdlib/assert-has-sharedarraybuffer-support":"^0.1.0"
40+
"@stdlib/assert-has-sharedarraybuffer-support":"^0.1.1"
4141
},
4242
"devDependencies": {
4343
"@stdlib/array-float64":"^0.1.0",
4444
"@stdlib/array-uint8":"^0.1.0",
45-
"@stdlib/assert-has-own-property":"^0.1.0",
46-
"@stdlib/assert-has-property":"^0.1.0",
47-
"@stdlib/assert-instance-of":"^0.1.0",
48-
"@stdlib/assert-is-function":"^0.1.0",
49-
"@stdlib/assert-is-sharedarraybuffer":"^0.1.0",
45+
"@stdlib/assert-has-own-property":"^0.1.1",
46+
"@stdlib/assert-has-property":"^0.1.1",
47+
"@stdlib/assert-instance-of":"^0.1.1",
48+
"@stdlib/assert-is-function":"^0.1.1",
49+
"@stdlib/assert-is-sharedarraybuffer":"^0.1.1",
5050
"@stdlib/bench":"^0.1.0",
51-
"@stdlib/constants-float64-max-safe-integer":"^0.1.0",
51+
"@stdlib/constants-float64-max-safe-integer":"^0.1.1",
5252
"@stdlib/math-base-special-pow":"^0.1.0",
5353
"@stdlib/number-uint8-base-to-binary-string":"^0.1.0",
5454
"@stdlib/random-base-randu":"^0.1.0",

‎test/dist/test.js‎

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

2323
vartape=require('tape');
24-
varproxyquire=require('proxyquire');
25-
varhasSharedArrayBufferSupport=require('@stdlib/assert-has-sharedarraybuffer-support');// eslint-disable-line id-length
26-
varisFunction=require('@stdlib/assert-is-function');
27-
varinstanceOf=require('@stdlib/assert-instance-of');
28-
varMAX_SAFE_INTEGER=require('@stdlib/constants-float64-max-safe-integer');
29-
varhasOwnProp=require('@stdlib/assert-has-own-property');
30-
varhasProp=require('@stdlib/assert-has-property');
31-
varpolyfill=require('./../../dist/polyfill.js');
32-
varCtor=require('./../../dist');
33-
34-
35-
// VARIABLES //
36-
37-
varopts={
38-
'skip':!hasSharedArrayBufferSupport()
39-
};
24+
varmain=require('./../../dist');
4025

4126

4227
// TESTS //
4328

44-
tape('main export isa function',functiontest(t){
29+
tape('main export isdefined',functiontest(t){
4530
t.ok(true,__filename);
46-
t.strictEqual(typeofCtor,'function','main export is a function');
47-
t.end();
48-
});
49-
50-
tape('if an environment supports `SharedArrayBuffer`, the export is an alias for `SharedArrayBuffer`',functiontest(t){
51-
varFoo=proxyquire('./../dist',{
52-
'@stdlib/assert-has-sharedarraybuffer-support':isTrue,
53-
'./main.js':Mock
54-
});
55-
t.strictEqual(Foo,Mock,'returns built-in');
56-
57-
if(!opts.skip){
58-
t.strictEqual(Ctor,SharedArrayBuffer,'is alias');// eslint-disable-line stdlib/require-globals, no-undef
59-
}
60-
61-
t.end();
62-
63-
functionMock(){
64-
returnthis;
65-
}
66-
67-
functionisTrue(){
68-
returntrue;
69-
}
70-
});
71-
72-
tape('if an environment does not support `SharedArrayBuffer`, the export is a polyfill',functiontest(t){
73-
varFoo=proxyquire('./../dist',{
74-
'@stdlib/assert-has-sharedarraybuffer-support':isFalse
75-
});
76-
77-
t.strictEqual(Foo,polyfill,'returns polyfill');
78-
t.end();
79-
80-
functionisFalse(){
81-
returnfalse;
82-
}
83-
});
84-
85-
tape('the main export is a constructor',opts,functiontest(t){
86-
varbuf=newCtor(10);
87-
t.strictEqual(instanceOf(buf,Ctor),true,'returns an instance');
88-
t.end();
89-
});
90-
91-
tape('the constructor length is equal to `1`',opts,functiontest(t){
92-
t.strictEqual(Ctor.length,1,'returns expected value');
93-
t.end();
94-
});
95-
96-
tape('the constructor throws an error if provided a value exceeding `2^53-1`',opts,functiontest(t){
97-
t.throws(badValue,RangeError,'throws an error');
98-
t.end();
99-
100-
functionbadValue(){
101-
returnnewCtor(MAX_SAFE_INTEGER+1);
102-
}
103-
});
104-
105-
tape('the constructor returns a `SharedArrayBuffer` instance having a `byteLength` property, which returns the number of bytes in a `SharedArrayBuffer`',opts,functiontest(t){
106-
varbuf;
107-
108-
t.strictEqual(hasOwnProp(Ctor.prototype,'byteLength'),true,'has prototype property');
109-
110-
buf=newCtor(10);
111-
t.strictEqual(hasOwnProp(buf,'byteLength'),false,'does not have own property');
112-
t.strictEqual(hasProp(buf,'byteLength'),true,'has property');
113-
t.strictEqual(buf.byteLength,10,'returns expected value');
114-
115-
t.end();
116-
});
117-
118-
tape('the constructor returns a `SharedArrayBuffer` instance having a `slice` method, which copies the bytes of a `SharedArrayBuffer` to a new `SharedArrayBuffer`',opts,functiontest(t){
119-
varb1;
120-
varb2;
121-
122-
t.strictEqual(hasOwnProp(Ctor.prototype,'slice'),true,'has prototype property');
123-
t.strictEqual(isFunction(Ctor.prototype.slice),true,'has method');
124-
125-
b1=newCtor(10);
126-
t.strictEqual(hasOwnProp(b1,'slice'),false,'does not have own property');
127-
t.strictEqual(hasProp(b1,'slice'),true,'has property');
128-
129-
b2=b1.slice();
130-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
131-
t.notEqual(b2,b1,'returns a new reference');
132-
t.strictEqual(b2.byteLength,b1.byteLength,'has same number of bytes');
133-
134-
b2=b1.slice(2);
135-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
136-
t.notEqual(b2,b1,'returns a new reference');
137-
t.strictEqual(b2.byteLength,8,'has expected number of bytes');
138-
139-
b2=b1.slice(b1.byteLength+10);
140-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
141-
t.notEqual(b2,b1,'returns a new reference');
142-
t.strictEqual(b2.byteLength,0,'has expected number of bytes');
143-
144-
b2=b1.slice(-2);
145-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
146-
t.notEqual(b2,b1,'returns a new reference');
147-
t.strictEqual(b2.byteLength,2,'has expected number of bytes');
148-
149-
b2=b1.slice(-100);
150-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
151-
t.notEqual(b2,b1,'returns a new reference');
152-
t.strictEqual(b2.byteLength,10,'has expected number of bytes');
153-
154-
b2=b1.slice(0,6);
155-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
156-
t.notEqual(b2,b1,'returns a new reference');
157-
t.strictEqual(b2.byteLength,6,'has expected number of bytes');
158-
159-
b2=b1.slice(2,6);
160-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
161-
t.notEqual(b2,b1,'returns a new reference');
162-
t.strictEqual(b2.byteLength,4,'has expected number of bytes');
163-
164-
b2=b1.slice(0,-2);
165-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
166-
t.notEqual(b2,b1,'returns a new reference');
167-
t.strictEqual(b2.byteLength,8,'has expected number of bytes');
168-
169-
b2=b1.slice(0,-100);
170-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
171-
t.notEqual(b2,b1,'returns a new reference');
172-
t.strictEqual(b2.byteLength,0,'has expected number of bytes');
173-
174-
b2=b1.slice(-4,-2);
175-
t.strictEqual(instanceOf(b2,Ctor),true,'returns an instance');
176-
t.notEqual(b2,b1,'returns a new reference');
177-
t.strictEqual(b2.byteLength,2,'has expected number of bytes');
178-
31+
t.strictEqual(main!==void0,true,'main export is defined');
17932
t.end();
18033
});
181-
182-
// TODO: add tests testing shared memory semantics/behavior

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp