Skip to content

Commit 41a5c49

Browse files
Jaysukh-409kgryte
andauthored
test: update tests in ndarray/base/* to support boolean dtypes
PR-URL: #2505 Ref: #2500 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]>
1 parent ca687d6 commit 41a5c49

File tree

12 files changed

+42
-67
lines changed

12 files changed

+42
-67
lines changed

lib/node_modules/@stdlib/ndarray/base/char2dtype/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,7 @@ var out = char2dtype();
9090
var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' );
9191
var char2dtype = require( '@stdlib/ndarray/base/char2dtype' );
9292

93-
var chars;
94-
var out;
95-
var i;
96-
97-
chars = [
93+
var chars = [
9894
dtypeChar( 'float64' ),
9995
dtypeChar( 'float32' ),
10096
dtypeChar( 'int8' ),
@@ -109,9 +105,9 @@ chars = [
109105
'('
110106
];
111107

108+
var i;
112109
for ( i = 0; i < chars.length; i++ ) {
113-
out = char2dtype( chars[ i ] );
114-
console.log( '%s => %s', chars[ i ], out );
110+
console.log( '%s => %s', chars[ i ], char2dtype( chars[ i ] ) );
115111
}
116112
```
117113

lib/node_modules/@stdlib/ndarray/base/char2dtype/examples/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121
var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' );
2222
var char2dtype = require( './../lib' );
2323

24-
var chars;
25-
var out;
26-
var i;
27-
28-
chars = [
24+
var chars = [
2925
dtypeChar( 'float64' ),
3026
dtypeChar( 'float32' ),
3127
dtypeChar( 'int8' ),
@@ -40,7 +36,7 @@ chars = [
4036
'('
4137
];
4238

39+
var i;
4340
for ( i = 0; i < chars.length; i++ ) {
44-
out = char2dtype( chars[ i ] );
45-
console.log( '%s => %s', chars[ i ], out );
41+
console.log( '%s => %s', chars[ i ], char2dtype( chars[ i ] ) );
4642
}

lib/node_modules/@stdlib/ndarray/base/char2dtype/test/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2021 The Stdlib Authors.
4+
* Copyright (c) 2024 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.
@@ -61,7 +61,8 @@ tape( 'the function returns the data type string associated with a provided sing
6161
'binary',
6262
'generic',
6363
'complex64',
64-
'complex128'
64+
'complex128',
65+
'bool'
6566
];
6667
for ( i = 0; i < expected.length; i++ ) {
6768
ch = dtypeChar( expected[ i ] );

lib/node_modules/@stdlib/ndarray/base/dtype-char/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ var obj = dtypeChar();
8989
```javascript
9090
var dtypeChar = require( '@stdlib/ndarray/base/dtype-char' );
9191

92-
var dtypes;
93-
var ch;
94-
var i;
95-
96-
dtypes = [
92+
var dtypes = [
9793
'float64',
9894
'float32',
9995
'int8',
@@ -108,9 +104,9 @@ dtypes = [
108104
'foobar'
109105
];
110106

107+
var i;
111108
for ( i = 0; i < dtypes.length; i++ ) {
112-
ch = dtypeChar( dtypes[ i ] );
113-
console.log( '%s => %s', dtypes[ i ], ch );
109+
console.log( '%s => %s', dtypes[ i ], dtypeChar( dtypes[ i ] ) );
114110
}
115111
```
116112

lib/node_modules/@stdlib/ndarray/base/dtype-char/examples/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020

2121
var dtypeChar = require( './../lib' );
2222

23-
var dtypes;
24-
var ch;
25-
var i;
26-
27-
dtypes = [
23+
var dtypes = [
2824
'float64',
2925
'float32',
3026
'int8',
@@ -39,7 +35,7 @@ dtypes = [
3935
'foobar'
4036
];
4137

38+
var i;
4239
for ( i = 0; i < dtypes.length; i++ ) {
43-
ch = dtypeChar( dtypes[ i ] );
44-
console.log( '%s => %s', dtypes[ i ], ch );
40+
console.log( '%s => %s', dtypes[ i ], dtypeChar( dtypes[ i ] ) );
4541
}

lib/node_modules/@stdlib/ndarray/base/dtype-char/test/test.js

Lines changed: 7 additions & 4 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) 2024 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.
@@ -41,7 +41,8 @@ var DTYPES = [
4141
'binary',
4242
'generic',
4343
'complex64',
44-
'complex128'
44+
'complex128',
45+
'bool'
4546
];
4647

4748

@@ -74,7 +75,8 @@ tape( 'the function returns an object mapping data type strings to single letter
7475
'r',
7576
'o',
7677
'c',
77-
'z'
78+
'z',
79+
'x'
7880
];
7981

8082
obj = dtypeChar();
@@ -105,7 +107,8 @@ tape( 'the function returns the single letter character abbreviation for an unde
105107
'r',
106108
'o',
107109
'c',
108-
'z'
110+
'z',
111+
'x'
109112
];
110113
for ( i = 0; i < DTYPES.length; i++ ) {
111114
ch = dtypeChar( DTYPES[ i ] );

lib/node_modules/@stdlib/ndarray/base/dtype-desc/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ var obj = dtypeDesc();
8989
```javascript
9090
var dtypeDesc = require( '@stdlib/ndarray/base/dtype-desc' );
9191

92-
var dtypes;
93-
var desc;
94-
var i;
95-
96-
dtypes = [
92+
var dtypes = [
9793
'float64',
9894
'float32',
9995
'int8',
@@ -108,9 +104,9 @@ dtypes = [
108104
'foobar'
109105
];
110106

107+
var i;
111108
for ( i = 0; i < dtypes.length; i++ ) {
112-
desc = dtypeDesc( dtypes[ i ] );
113-
console.log( '%s: %s', dtypes[ i ], desc );
109+
console.log( '%s: %s', dtypes[ i ], dtypeDesc( dtypes[ i ] ) );
114110
}
115111
```
116112

lib/node_modules/@stdlib/ndarray/base/dtype-desc/examples/index.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020

2121
var dtypeDesc = require( './../lib' );
2222

23-
var dtypes;
24-
var desc;
25-
var i;
26-
27-
dtypes = [
23+
var dtypes = [
2824
'float64',
2925
'float32',
3026
'int8',
@@ -39,7 +35,7 @@ dtypes = [
3935
'foobar'
4036
];
4137

38+
var i;
4239
for ( i = 0; i < dtypes.length; i++ ) {
43-
desc = dtypeDesc( dtypes[ i ] );
44-
console.log( '%s: %s', dtypes[ i ], desc );
40+
console.log( '%s: %s', dtypes[ i ], dtypeDesc( dtypes[ i ] ) );
4541
}

lib/node_modules/@stdlib/ndarray/base/dtype-desc/test/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2021 The Stdlib Authors.
4+
* Copyright (c) 2024 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.
@@ -42,7 +42,8 @@ var DTYPES = [
4242
'binary',
4343
'generic',
4444
'complex64',
45-
'complex128'
45+
'complex128',
46+
'bool'
4647
];
4748
var DESC = table();
4849

lib/node_modules/@stdlib/ndarray/base/dtype2c/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,7 @@ var out = dtype2c( 'foobar' );
8282
```javascript
8383
var dtype2c = require( '@stdlib/ndarray/base/dtype2c' );
8484

85-
var dtypes;
86-
var out;
87-
var i;
88-
89-
dtypes = [
85+
var dtypes = [
9086
'float64',
9187
'float32',
9288
'int8',
@@ -101,9 +97,9 @@ dtypes = [
10197
'foobar'
10298
];
10399

100+
var i;
104101
for ( i = 0; i < dtypes.length; i++ ) {
105-
out = dtype2c( dtypes[ i ] );
106-
console.log( '%s => %s', dtypes[ i ], out );
102+
console.log( '%s => %s', dtypes[ i ], dtype2c( dtypes[ i ] ) );
107103
}
108104
```
109105

0 commit comments

Comments
 (0)