Skip to content

Commit 4d0375d

Browse files
committed
Auto-generated commit
1 parent bc6b854 commit 4d0375d

File tree

4 files changed

+16
-113
lines changed

4 files changed

+16
-113
lines changed

.github/.keepalive

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2023-11-01T03:19:04.364Z

.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 <[email protected]>
3737
Yernar Yergaziyev <[email protected]>
3838
orimiles5 <[email protected]>
3939
40+
Robert Gislason <[email protected]>

test/dist/test.js

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

2323
var tape = require( 'tape' );
24-
var isSingleSegmentCompatible = require( './../../dist' );
24+
var main = require( './../../dist' );
2525

2626

2727
// TESTS //
2828

29-
tape( 'main export is a function', function test( t ) {
29+
tape( 'main export is defined', function test( t ) {
3030
t.ok( true, __filename );
31-
t.strictEqual( typeof isSingleSegmentCompatible, 'function', 'main export is a function' );
32-
t.end();
33-
});
34-
35-
tape( 'the function returns `true` if an array is compatible with a single memory segment', function test( t ) {
36-
var strides;
37-
var offset;
38-
var shape;
39-
var bool;
40-
41-
shape = [ 3, 2 ];
42-
43-
strides = [ 2, 1 ];
44-
offset = 0;
45-
bool = isSingleSegmentCompatible( shape, strides, offset );
46-
t.strictEqual( bool, true, 'returns expected value' );
47-
48-
strides = [ 2, 1 ];
49-
offset = 99999;
50-
bool = isSingleSegmentCompatible( shape, strides, offset );
51-
t.strictEqual( bool, true, 'returns expected value' );
52-
53-
strides = [ -2, 1 ];
54-
offset = 4;
55-
bool = isSingleSegmentCompatible( shape, strides, offset );
56-
t.strictEqual( bool, true, 'returns expected value' );
57-
58-
strides = [ 2, -1 ];
59-
offset = 1;
60-
bool = isSingleSegmentCompatible( shape, strides, offset );
61-
t.strictEqual( bool, true, 'returns expected value' );
62-
63-
strides = [ -2, -1 ];
64-
offset = 5;
65-
bool = isSingleSegmentCompatible( shape, strides, offset );
66-
t.strictEqual( bool, true, 'returns expected value' );
67-
68-
strides = [ 1, 3 ];
69-
offset = 0;
70-
bool = isSingleSegmentCompatible( shape, strides, offset );
71-
t.strictEqual( bool, true, 'returns expected value' );
72-
73-
strides = [ -1, 3 ];
74-
offset = 2;
75-
bool = isSingleSegmentCompatible( shape, strides, offset );
76-
t.strictEqual( bool, true, 'returns expected value' );
77-
78-
strides = [ 1, -3 ];
79-
offset = 3;
80-
bool = isSingleSegmentCompatible( shape, strides, offset );
81-
t.strictEqual( bool, true, 'returns expected value' );
82-
83-
strides = [ -1, -3 ];
84-
offset = 5;
85-
bool = isSingleSegmentCompatible( shape, strides, offset );
86-
t.strictEqual( bool, true, 'returns expected value' );
87-
88-
shape = [ 1, 1, 1, 2 ];
89-
strides = [ 2, 2, 2, 1 ];
90-
offset = 0;
91-
bool = isSingleSegmentCompatible( shape, strides, offset );
92-
t.strictEqual( bool, true, 'returns expected value' );
93-
94-
shape = [ 2, 3, 10 ];
95-
strides = [ 30, 10, 1 ];
96-
offset = 99999;
97-
bool = isSingleSegmentCompatible( shape, strides, offset );
98-
t.strictEqual( bool, true, 'returns expected value' );
99-
100-
shape = [ 2, 3, 10 ];
101-
strides = [ 30, -10, 1 ];
102-
offset = 20;
103-
bool = isSingleSegmentCompatible( shape, strides, offset );
104-
t.strictEqual( bool, true, 'returns expected value' );
105-
106-
t.end();
107-
});
108-
109-
tape( 'the function returns `false` if an array is incompatible with a single memory segment', function test( t ) {
110-
var strides;
111-
var offset;
112-
var shape;
113-
var bool;
114-
115-
shape = [ 1, 1, 1, 2 ];
116-
strides = [ 2, 2, 2, 2 ];
117-
offset = 0;
118-
bool = isSingleSegmentCompatible( shape, strides, offset );
119-
t.strictEqual( bool, false, 'returns expected value' );
120-
121-
shape = [ 10 ];
122-
strides = [ 3 ];
123-
offset = 0;
124-
bool = isSingleSegmentCompatible( shape, strides, offset );
125-
t.strictEqual( bool, false, 'returns expected value' );
126-
127-
shape = [ 2, 2 ];
128-
strides = [ 2, 2 ];
129-
offset = 0;
130-
bool = isSingleSegmentCompatible( shape, strides, offset );
131-
t.strictEqual( bool, false, 'returns expected value' );
132-
133-
t.end();
134-
});
135-
136-
tape( 'the function returns `false` if an array has 0 elements', function test( t ) {
137-
var bool = isSingleSegmentCompatible( [ 2, 0 ], [ 2, 0 ], 0 );
138-
t.strictEqual( bool, false, 'returns expected value' );
31+
t.strictEqual( main !== void 0, true, 'main export is defined' );
13932
t.end();
14033
});

0 commit comments

Comments
 (0)