'use strict';

// MODULES //

var tape = require( 'tape' );
var isNegativeZero = require( '@stdlib/math/base/utils/is-negative-zero' );
var isPositiveZero = require( '@stdlib/math/base/utils/is-positive-zero' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var PINF = require( '@stdlib/math/constants/float64-pinf' );
var NINF = require( '@stdlib/math/constants/float64-ninf' );
var truncate = require( './../lib' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.true( typeof truncate, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function rounds a numeric value toward 0', function test( t ) {
	t.equal( truncate( -4.2 ), -4.0, 'equals -4' );
	t.equal( truncate( 9.99999 ), 9.0, 'equals 9' );
	t.end();
});

tape( 'if provided `+0`, the function returns `+0`', function test( t ) {
	var v = truncate( 0.0 );
	t.equal( isPositiveZero( v ), true, 'equals +0' );
	t.end();
});

tape( 'if provided `-0`, the function returns `-0`', function test( t ) {
	var v = truncate( -0.0 );
	t.equal( isNegativeZero( v ), true, 'returns -0' );
	t.end();
});

tape( 'the function returns `NaN` if provided `NaN`', function test( t ) {
	var v = truncate( NaN );
	t.equal( isnan( v ), true, 'returns NaN' );
	t.end();
});

tape( 'the function returns `+infinity` if provided a `+infinity`', function test( t ) {
	var v = truncate( PINF );
	t.equal( v, PINF, 'returns +infinity' );
	t.end();
});

tape( 'the function returns `-infinity` if provided a `-infinity`', function test( t ) {
	var v = truncate( NINF );
	t.equal( v, NINF, 'returns -infinity' );
	t.end();
});

@@ -678,25 +678,31 @@
 t( t ) %7B%0A%09t.
-e
+strictE
 qual( trunca
@@ -733,25 +733,31 @@
 s -4' );%0A%09t.
-e
+strictE
 qual( trunca
@@ -900,33 +900,39 @@
 cate( 0.0 );%0A%09t.
-e
+strictE
 qual( isPositive
@@ -1078,25 +1078,31 @@
  -0.0 );%0A%09t.
-e
+strictE
 qual( isNega
@@ -1253,25 +1253,31 @@
 ( NaN );%0A%09t.
-e
+strictE
 qual( isnan(
@@ -1372,18 +1372,16 @@
 rovided 
-a 
 %60+infini
@@ -1429,33 +1429,39 @@
 ate( PINF );%0A%09t.
-e
+strictE
 qual( v, PINF, '
@@ -1549,18 +1549,16 @@
 rovided 
-a 
 %60-infini
@@ -1614,17 +1614,23 @@
 F );%0A%09t.
-e
+strictE
 qual( v,

Use strict equality tests