'use strict';

// MODULES //

var tape = require( 'tape' );
var kstest = require( '@stdlib/math/generics/statistics/kstest' );
var randn = require( './../lib' );


// VARIABLES //

var opts = {
	'skip': ( process.env.TEST_MODE === 'coverage' )
};


// TESTS //

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

tape( 'attached to the main export is a method to generate pseudorandom number generators', function test( t ) {
	t.equal( typeof randn.factory, 'function', 'has `factory` method' );
	t.end();
});

tape( 'attached to the main export is the generator name', function test( t ) {
	t.equal( randn.NAME, 'improved-ziggurat', 'has `NAME` property' );
	t.end();
});

tape( 'attached to the returned function is the underlying PRNG', function test( t ) {
	t.equal( typeof randn.PRNG, 'function', 'has `PRNG` property' );
	t.end();
});

tape( 'attached to the main export is the generator seed', function test( t ) {
	t.equal( typeof randn.SEED, 'number', 'has `SEED` property' );
	t.end();
});

tape( 'the function returns pseudorandom numbers', function test( t ) {
	var r;
	var i;
	for ( i = 0; i < 1e4; i++ ) {
		r = randn();
		t.equal( typeof r, 'number', 'returns a number' );
	}
	t.end();
});

tape( 'the function returns pseudorandom numbers from a standard normal distribution', opts, function test( t ) {
	var rejected;
	var pValue;
	var N;
	var i;
	var j;
	var x;

	rejected = 0;
	x = new Array( 1e3 );
	N = 300;
	for ( i = 0; i < N; i++ ) {
		for ( j = 0; j < x.length; j++ ) {
			x[ j ] = randn();
		}
		// Test using Kolmogorov-Smirnov goodness-of-fit test:
		pValue = kstest( x, 'normal', 0.0, 1.0 ).pValue;
		t.equal( typeof pValue, 'number', 'returns a p-value' );
		if ( pValue < 0.05 ) {
			rejected += 1;
		}
	}
	// Account for small sample sizes and few repeats...
	t.ok( rejected / N < 0.1, 'null hypothesis (i.e., that numbers are drawn from Normal(0,1)) is rejected in less than 10% of cases ('+rejected+' of '+N+')' );
	t.end();
});

@@ -808,25 +808,19 @@
 the 
-returned function
+main export
  is 

Fix test description