|
1 | 1 | /** |
2 | 2 | * @license Apache-2.0 |
3 | 3 | * |
4 | | -* Copyright (c) 2018 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 Int16Array = require( '@stdlib/array-int16' ); |
25 | | -var Int32Array = require( '@stdlib/array-int32' ); |
26 | | -var Uint32Array = require( '@stdlib/array-uint32' ); |
27 | | -var Number = require( '@stdlib/number-ctor' ); |
28 | | -var isPositiveIntegerArray = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
29 | 25 |
|
30 | 26 |
|
31 | 27 | // TESTS // |
32 | 28 |
|
33 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
34 | 30 | t.ok( true, __filename ); |
35 | | - t.strictEqual( typeof isPositiveIntegerArray, 'function', 'main export is a function' ); |
36 | | - t.end(); |
37 | | -}); |
38 | | - |
39 | | -tape( 'the function tests for a generic number array having only positive integer values', function test( t ) { |
40 | | - var arr; |
41 | | - |
42 | | - arr = [ 5.0, new Number( 5 ), 1.0 ]; |
43 | | - t.equal( isPositiveIntegerArray( arr ), true, 'returns true' ); |
44 | | - |
45 | | - arr = [ 5.0, '3', null ]; |
46 | | - t.equal( isPositiveIntegerArray( arr ), false, 'returns false' ); |
47 | | - |
48 | | - arr = { |
49 | | - 'length': 2, |
50 | | - '0': 5, |
51 | | - '1': 1 |
52 | | - }; |
53 | | - t.equal( isPositiveIntegerArray( arr ), true, 'returns true' ); |
54 | | - |
55 | | - arr = new Int32Array( [ 5, 2, 0 ] ); |
56 | | - t.equal( isPositiveIntegerArray( arr ), false, 'returns false' ); |
57 | | - |
58 | | - t.end(); |
59 | | -}); |
60 | | - |
61 | | -tape( 'the function provides a method to test for an array-like object containing only positive integer primitives', function test( t ) { |
62 | | - var arr; |
63 | | - |
64 | | - arr = [ 5.0, 1.0 ]; |
65 | | - t.equal( isPositiveIntegerArray.primitives( arr ), true, 'returns true' ); |
66 | | - |
67 | | - arr = [ new Number( 5 ), 1.0, 1.0 ]; |
68 | | - t.equal( isPositiveIntegerArray.primitives( arr ), false, 'returns false' ); |
69 | | - |
70 | | - arr = { |
71 | | - 'length': 2, |
72 | | - '0': 5, |
73 | | - '1': 1 |
74 | | - }; |
75 | | - t.equal( isPositiveIntegerArray.primitives( arr ), true, 'returns true' ); |
76 | | - |
77 | | - arr = new Int16Array( [ 5, 2, 1 ] ); |
78 | | - t.equal( isPositiveIntegerArray.primitives( arr ), true, 'returns true' ); |
79 | | - |
80 | | - t.end(); |
81 | | -}); |
82 | | - |
83 | | -tape( 'the function provides a method to test for an array-like object containing only number objects with positive integer values', function test( t ) { |
84 | | - var arr; |
85 | | - |
86 | | - arr = [ new Number( 5 ), new Number( 2 ) ]; |
87 | | - t.equal( isPositiveIntegerArray.objects( arr ), true, 'returns true' ); |
88 | | - |
89 | | - arr = [ 5.0, 1.0, 1.0 ]; |
90 | | - t.equal( isPositiveIntegerArray.objects( arr ), false, 'returns false' ); |
91 | | - |
92 | | - arr = { |
93 | | - 'length': 2, |
94 | | - '0': new Number( 5 ), |
95 | | - '1': new Number( 1 ) |
96 | | - }; |
97 | | - t.equal( isPositiveIntegerArray.objects( arr ), true, 'returns true' ); |
98 | | - |
99 | | - arr = new Uint32Array( [ 5, 1 ] ); |
100 | | - t.equal( isPositiveIntegerArray.objects( arr ), false, 'returns false' ); |
101 | | - |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
102 | 32 | t.end(); |
103 | 33 | }); |
0 commit comments