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