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