'use strict';

// MODULES //

var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var pmf = require( './../lib' );


// TESTS //

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

tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
	var y;

	y = pmf( NaN, 0.0 );
	t.equal( isnan( y ), true, 'returns NaN' );

	y = pmf( 0.0, NaN );
	t.equal( isnan( y ), true, 'returns NaN' );

	t.end();
});

tape( 'the function returns `1.0` if provided `x` equal to `mu`', function test( t ) {
	var y;

	y = pmf( 2.0, 2.0 );
	t.equal( y, 1.0, 'returns 1.0' );

	y = pmf( 0.0, 0.0 );
	t.equal( y, 1.0, 'returns 1.0' );

	y = pmf( -3.0, -3.0 );
	t.equal( y, 1.0, 'returns 1.0' );

	t.end();
});

tape( 'the function returns `0.0` if provided `x` not equal to `mu`', function test( t ) {
	var y;

	y = pmf( 2.0, 3.0 );
	t.equal( y, 0.0, 'returns 0.0' );

	y = pmf( 4.0, 3.0 );
	t.equal( y, 0.0, 'returns 0.0' );

	t.end();
});

'use strict';

// MODULES //

var tape = require( 'tape' );
var isnan = require( '@stdlib/math/base/utils/is-nan' );
var pmf = require( './../lib' );


// TESTS //

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

tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
	var y;

	y = pmf( NaN, 0.0 );
	t.equal( isnan( y ), true, 'returns NaN' );

	y = pmf( 0.0, NaN );
	t.equal( isnan( y ), true, 'returns NaN' );

	y = pmf( NaN, NaN );
	t.equal( isnan( y ), true, 'returns NaN' );

	t.end();
});

tape( 'the function returns `1.0` if provided `x` equal to `mu`', function test( t ) {
	var y;

	y = pmf( 2.0, 2.0 );
	t.equal( y, 1.0, 'returns 1.0' );

	y = pmf( 0.0, 0.0 );
	t.equal( y, 1.0, 'returns 1.0' );

	y = pmf( -3.0, -3.0 );
	t.equal( y, 1.0, 'returns 1.0' );

	t.end();
});

tape( 'the function returns `0.0` if provided `x` not equal to `mu`', function test( t ) {
	var y;

	y = pmf( 2.0, 3.0 );
	t.equal( y, 0.0, 'returns 0.0' );

	y = pmf( 4.0, 3.0 );
	t.equal( y, 0.0, 'returns 0.0' );

	t.end();
});

Add test case