|
1 | 1 | /** |
2 | 2 | * @license Apache-2.0 |
3 | 3 | * |
4 | | -* Copyright (c) 2022 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 constructorName = require( '@stdlib/utils-constructor-name' ); |
25 | | -var Int8Array = require( '@stdlib/array-int8' ); |
26 | | -var Uint8Array = require( '@stdlib/array-uint8' ); |
27 | | -var Uint8ClampedArray = require( '@stdlib/array-uint8c' ); |
28 | | -var Int16Array = require( '@stdlib/array-int16' ); |
29 | | -var Uint16Array = require( '@stdlib/array-uint16' ); |
30 | | -var Int32Array = require( '@stdlib/array-int32' ); |
31 | | -var Uint32Array = require( '@stdlib/array-uint32' ); |
32 | | -var Float32Array = require( '@stdlib/array-float32' ); |
33 | | -var Float64Array = require( '@stdlib/array-float64' ); |
34 | | -var Complex128Array = require( '@stdlib/array-complex128' ); |
35 | | -var Complex64Array = require( '@stdlib/array-complex64' ); |
36 | | -var allocUnsafe = require( '@stdlib/buffer-alloc-unsafe' ); |
37 | | -var isAccessorArray = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
38 | 25 |
|
39 | 26 |
|
40 | 27 | // TESTS // |
41 | 28 |
|
42 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
43 | 30 | t.ok( true, __filename ); |
44 | | - t.strictEqual( typeof isAccessorArray, 'function', 'main export is a function' ); |
45 | | - t.end(); |
46 | | -}); |
47 | | - |
48 | | -tape( 'the function returns `true` if provided an array-like object which supports the accessor protocol', function test( t ) { |
49 | | - var values; |
50 | | - var i; |
51 | | - |
52 | | - values = [ |
53 | | - new Complex128Array( 10 ), |
54 | | - new Complex64Array( 10 ) |
55 | | - ]; |
56 | | - |
57 | | - for ( i = 0; i < values.length; i++ ) { |
58 | | - t.strictEqual( isAccessorArray( values[i] ), true, 'returns true when provided '+constructorName( values[i] ) ); |
59 | | - } |
60 | | - t.end(); |
61 | | -}); |
62 | | - |
63 | | -tape( 'the function returns `false` if provided an array-like object which does not support the accessor protocol', function test( t ) { |
64 | | - var values; |
65 | | - var i; |
66 | | - |
67 | | - values = [ |
68 | | - [], |
69 | | - { 'length': 10 }, // eslint-disable-line object-curly-newline |
70 | | - new Float64Array( 10 ), |
71 | | - new Float32Array( 10 ), |
72 | | - new Int32Array( 10 ), |
73 | | - new Uint32Array( 10 ), |
74 | | - new Int16Array( 10 ), |
75 | | - new Uint16Array( 10 ), |
76 | | - new Int8Array( 10 ), |
77 | | - new Uint8Array( 10 ), |
78 | | - new Uint8ClampedArray( 10 ), |
79 | | - allocUnsafe( 10 ) |
80 | | - ]; |
81 | | - |
82 | | - for ( i = 0; i < values.length; i++ ) { |
83 | | - t.strictEqual( isAccessorArray( values[i] ), false, 'returns false when provided '+constructorName( values[i] ) ); |
84 | | - } |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
85 | 32 | t.end(); |
86 | 33 | }); |
0 commit comments