|
1 | 1 | /** |
2 | 2 | * @license Apache-2.0 |
3 | 3 | * |
4 | | -* Copyright (c) 2021 The Stdlib Authors. |
| 4 | +* Copyright (c) 2023 The Stdlib Authors. |
5 | 5 | * |
6 | 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
7 | 7 | * you may not use this file except in compliance with the License. |
|
21 | 21 | // MODULES // |
22 | 22 |
|
23 | 23 | var tape = require( 'tape' ); |
24 | | -var enum2str = require( '@stdlib/ndarray-base-dtype-enum2str' ); |
25 | | -var str2enum = require( './../../dist' ); |
26 | | - |
27 | | - |
28 | | -// VARIABLES // |
29 | | - |
30 | | -// List of native C types which should be supported... |
31 | | -var DTYPES = [ |
32 | | - 'int8', |
33 | | - 'uint8', |
34 | | - 'int16', |
35 | | - 'uint16', |
36 | | - 'int32', |
37 | | - 'uint32', |
38 | | - 'int64', |
39 | | - 'uint64', |
40 | | - |
41 | | - 'float32', |
42 | | - 'float64', |
43 | | - |
44 | | - 'complex64', |
45 | | - 'complex128' |
46 | | -]; |
| 24 | +var main = require( './../../dist' ); |
47 | 25 |
|
48 | 26 |
|
49 | 27 | // TESTS // |
50 | 28 |
|
51 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
52 | 30 | t.ok( true, __filename ); |
53 | | - t.strictEqual( typeof str2enum, 'function', 'main export is a function' ); |
54 | | - t.end(); |
55 | | -}); |
56 | | - |
57 | | -tape( 'the function returns the enumeration constant associated with an ndarray data type string', function test( t ) { |
58 | | - var i; |
59 | | - for ( i = 0; i < DTYPES.length; i++ ) { |
60 | | - t.strictEqual( enum2str( str2enum( DTYPES[ i ] ) ), DTYPES[ i ], 'returns expected value' ); |
61 | | - } |
62 | | - t.end(); |
63 | | -}); |
64 | | - |
65 | | -tape( 'the function returns `null` if unable to resolve an enumeration constant', function test( t ) { |
66 | | - var values; |
67 | | - var i; |
68 | | - |
69 | | - values = [ |
70 | | - 'beep', |
71 | | - 'boop', |
72 | | - 'foo', |
73 | | - 'bar' |
74 | | - ]; |
75 | | - for ( i = 0; i < values.length; i++ ) { |
76 | | - t.strictEqual( str2enum( values[ i ] ), null, 'returns expected value' ); |
77 | | - } |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
78 | 32 | t.end(); |
79 | 33 | }); |
0 commit comments