@@ -80,6 +80,30 @@ tape( 'the function supports returning a list of array data types (all)', functi
8080 t . end ( ) ;
8181} ) ;
8282
83+ tape ( 'the function supports returning a list of array data types (all, including "generic")' , function test ( t ) {
84+ var expected ;
85+ var actual ;
86+
87+ expected = [
88+ 'complex64' ,
89+ 'complex128' ,
90+ 'float32' ,
91+ 'float64' ,
92+ 'generic' ,
93+ 'int16' ,
94+ 'int32' ,
95+ 'int8' ,
96+ 'uint16' ,
97+ 'uint32' ,
98+ 'uint8' ,
99+ 'uint8c'
100+ ] ;
101+ actual = dtypes ( 'all_and_generic' ) ;
102+
103+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
104+ t . end ( ) ;
105+ } ) ;
106+
83107tape ( 'the function supports returning a list of floating-point array data types' , function test ( t ) {
84108 var expected ;
85109 var actual ;
@@ -96,6 +120,23 @@ tape( 'the function supports returning a list of floating-point array data types
96120 t . end ( ) ;
97121} ) ;
98122
123+ tape ( 'the function supports returning a list of floating-point array data types (including "generic")' , function test ( t ) {
124+ var expected ;
125+ var actual ;
126+
127+ expected = [
128+ 'complex64' ,
129+ 'complex128' ,
130+ 'float32' ,
131+ 'float64' ,
132+ 'generic'
133+ ] ;
134+ actual = dtypes ( 'floating_point_and_generic' ) ;
135+
136+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
137+ t . end ( ) ;
138+ } ) ;
139+
99140tape ( 'the function supports returning a list of real-valued floating-point array data types' , function test ( t ) {
100141 var expected ;
101142 var actual ;
@@ -110,6 +151,21 @@ tape( 'the function supports returning a list of real-valued floating-point arra
110151 t . end ( ) ;
111152} ) ;
112153
154+ tape ( 'the function supports returning a list of real-valued floating-point array data types (including "generic")' , function test ( t ) {
155+ var expected ;
156+ var actual ;
157+
158+ expected = [
159+ 'float32' ,
160+ 'float64' ,
161+ 'generic'
162+ ] ;
163+ actual = dtypes ( 'real_floating_point_and_generic' ) ;
164+
165+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
166+ t . end ( ) ;
167+ } ) ;
168+
113169tape ( 'the function supports returning a list of complex-valued floating-point array data types' , function test ( t ) {
114170 var expected ;
115171 var actual ;
@@ -124,6 +180,21 @@ tape( 'the function supports returning a list of complex-valued floating-point a
124180 t . end ( ) ;
125181} ) ;
126182
183+ tape ( 'the function supports returning a list of complex-valued floating-point array data types (including "generic")' , function test ( t ) {
184+ var expected ;
185+ var actual ;
186+
187+ expected = [
188+ 'complex64' ,
189+ 'complex128' ,
190+ 'generic'
191+ ] ;
192+ actual = dtypes ( 'complex_floating_point_and_generic' ) ;
193+
194+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
195+ t . end ( ) ;
196+ } ) ;
197+
127198tape ( 'the function supports returning a list of integer array data types' , function test ( t ) {
128199 var expected ;
129200 var actual ;
@@ -143,6 +214,26 @@ tape( 'the function supports returning a list of integer array data types', func
143214 t . end ( ) ;
144215} ) ;
145216
217+ tape ( 'the function supports returning a list of integer array data types (including "generic")' , function test ( t ) {
218+ var expected ;
219+ var actual ;
220+
221+ expected = [
222+ 'int16' ,
223+ 'int32' ,
224+ 'int8' ,
225+ 'uint16' ,
226+ 'uint32' ,
227+ 'uint8' ,
228+ 'uint8c' ,
229+ 'generic'
230+ ] ;
231+ actual = dtypes ( 'integer_and_generic' ) ;
232+
233+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
234+ t . end ( ) ;
235+ } ) ;
236+
146237tape ( 'the function supports returning a list of signed integer array data types' , function test ( t ) {
147238 var expected ;
148239 var actual ;
@@ -158,6 +249,22 @@ tape( 'the function supports returning a list of signed integer array data types
158249 t . end ( ) ;
159250} ) ;
160251
252+ tape ( 'the function supports returning a list of signed integer array data types (including "generic")' , function test ( t ) {
253+ var expected ;
254+ var actual ;
255+
256+ expected = [
257+ 'int16' ,
258+ 'int32' ,
259+ 'int8' ,
260+ 'generic'
261+ ] ;
262+ actual = dtypes ( 'signed_integer_and_generic' ) ;
263+
264+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
265+ t . end ( ) ;
266+ } ) ;
267+
161268tape ( 'the function supports returning a list of unsigned integer array data types' , function test ( t ) {
162269 var expected ;
163270 var actual ;
@@ -174,6 +281,23 @@ tape( 'the function supports returning a list of unsigned integer array data typ
174281 t . end ( ) ;
175282} ) ;
176283
284+ tape ( 'the function supports returning a list of unsigned integer array data types (including "generic")' , function test ( t ) {
285+ var expected ;
286+ var actual ;
287+
288+ expected = [
289+ 'uint16' ,
290+ 'uint32' ,
291+ 'uint8' ,
292+ 'uint8c' ,
293+ 'generic'
294+ ] ;
295+ actual = dtypes ( 'unsigned_integer_and_generic' ) ;
296+
297+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
298+ t . end ( ) ;
299+ } ) ;
300+
177301tape ( 'the function supports returning a list of real-valued array data types' , function test ( t ) {
178302 var expected ;
179303 var actual ;
@@ -195,6 +319,28 @@ tape( 'the function supports returning a list of real-valued array data types',
195319 t . end ( ) ;
196320} ) ;
197321
322+ tape ( 'the function supports returning a list of real-valued array data types (including "generic")' , function test ( t ) {
323+ var expected ;
324+ var actual ;
325+
326+ expected = [
327+ 'float32' ,
328+ 'float64' ,
329+ 'int16' ,
330+ 'int32' ,
331+ 'int8' ,
332+ 'uint16' ,
333+ 'uint32' ,
334+ 'uint8' ,
335+ 'uint8c' ,
336+ 'generic'
337+ ] ;
338+ actual = dtypes ( 'real_and_generic' ) ;
339+
340+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
341+ t . end ( ) ;
342+ } ) ;
343+
198344tape ( 'the function supports returning a list of numeric array data types' , function test ( t ) {
199345 var expected ;
200346 var actual ;
@@ -218,7 +364,35 @@ tape( 'the function supports returning a list of numeric array data types', func
218364 t . end ( ) ;
219365} ) ;
220366
367+ tape ( 'the function supports returning a list of numeric array data types (including "generic")' , function test ( t ) {
368+ var expected ;
369+ var actual ;
370+
371+ expected = [
372+ 'complex64' ,
373+ 'complex128' ,
374+ 'float32' ,
375+ 'float64' ,
376+ 'int16' ,
377+ 'int32' ,
378+ 'int8' ,
379+ 'uint16' ,
380+ 'uint32' ,
381+ 'uint8' ,
382+ 'uint8c' ,
383+ 'generic'
384+ ] ;
385+ actual = dtypes ( 'numeric_and_generic' ) ;
386+
387+ t . deepEqual ( actual , expected , 'returns expected value' ) ;
388+ t . end ( ) ;
389+ } ) ;
390+
221391tape ( 'the function returns an empty array if provided an unrecognized data type kind' , function test ( t ) {
222392 t . deepEqual ( dtypes ( 'beep' ) , [ ] , 'returns expected value' ) ;
393+ t . deepEqual ( dtypes ( 'beep_and_generic' ) , [ ] , 'returns expected value' ) ;
394+ t . deepEqual ( dtypes ( 'generic' ) , [ ] , 'returns expected value' ) ;
395+ t . deepEqual ( dtypes ( '_and_generic' ) , [ ] , 'returns expected value' ) ;
396+ t . deepEqual ( dtypes ( '' ) , [ ] , 'returns expected value' ) ;
223397 t . end ( ) ;
224398} ) ;
0 commit comments