|
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 isBinaryString = require( './../../dist' ); |
| 24 | +var main = require( './../../dist' ); |
25 | 25 |
|
26 | 26 |
|
27 | 27 | // TESTS // |
28 | 28 |
|
29 | | -tape( 'main export is a function', function test( t ) { |
| 29 | +tape( 'main export is defined', function test( t ) { |
30 | 30 | t.ok( true, __filename ); |
31 | | - t.strictEqual( typeof isBinaryString, 'function', 'main export is a function' ); |
32 | | - t.end(); |
33 | | -}); |
34 | | - |
35 | | -tape( 'the function returns `true` if provided a binary string', function test( t ) { |
36 | | - var values; |
37 | | - var i; |
38 | | - |
39 | | - values = [ |
40 | | - '0', |
41 | | - '1', |
42 | | - '10101', |
43 | | - '000000000000000000000000000000000000000000000000000000000000000000000000000000', |
44 | | - '11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' |
45 | | - ]; |
46 | | - |
47 | | - for ( i = 0; i < values.length; i++ ) { |
48 | | - t.equal( isBinaryString( values[i] ), true, 'returns true' ); |
49 | | - } |
50 | | - t.end(); |
51 | | -}); |
52 | | - |
53 | | -tape( 'the function returns `false` if provided a `String` object, even if the value of the `String` object is a binary string', function test( t ) { |
54 | | - t.equal( isBinaryString( new String( '0101' ) ), false, 'returns false' ); |
55 | | - t.end(); |
56 | | -}); |
57 | | - |
58 | | -tape( 'the function returns `false` if not provided a binary string', function test( t ) { |
59 | | - var values; |
60 | | - var i; |
61 | | - |
62 | | - values = [ |
63 | | - '5', |
64 | | - 'beep', |
65 | | - '', |
66 | | - '1010102', |
67 | | - 5, |
68 | | - null, |
69 | | - NaN, |
70 | | - true, |
71 | | - void 0, |
72 | | - [], |
73 | | - {}, |
74 | | - function noop() {} |
75 | | - ]; |
76 | | - |
77 | | - for ( i = 0; i < values.length; i++ ) { |
78 | | - t.equal( isBinaryString( values[i] ), false, 'returns false when provided ' + values[i] ); |
79 | | - } |
| 31 | + t.strictEqual( main !== void 0, true, 'main export is defined' ); |
80 | 32 | t.end(); |
81 | 33 | }); |
0 commit comments