|
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 str2enum = require( '@stdlib/ndarray-base-dtype-str2enum' ); |
25 | | -var resolve = 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 resolve, '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 value', function test( t ) { |
58 | | - var v; |
59 | | - var i; |
60 | | - for ( i = 0; i < DTYPES.length; i++ ) { |
61 | | - v = str2enum( DTYPES[ i ] ); |
62 | | - t.strictEqual( resolve( DTYPES[ i ] ), v, 'returns expected value' ); |
63 | | - t.strictEqual( resolve( v ), v, 'returns expected value' ); |
64 | | - } |
65 | | - t.end(); |
66 | | -}); |
67 | | - |
68 | | -tape( 'the function returns `null` if unable to resolve an enumeration constant', function test( t ) { |
69 | | - var values; |
70 | | - var i; |
71 | | - |
72 | | - values = [ |
73 | | - 'beep', |
74 | | - 'boop', |
75 | | - 'foo', |
76 | | - 'bar', |
77 | | - -99999999, |
78 | | - -9999999999, |
79 | | - -9999999999999 |
80 | | - ]; |
81 | | - for ( i = 0; i < values.length; i++ ) { |
82 | | - t.strictEqual( resolve( values[ i ] ), null, 'returns expected value' ); |
83 | | - } |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
84 | 32 | t.end(); |
85 | 33 | }); |
0 commit comments