<commit_before>'use strict';

// MODULES //

var tape = require( 'tape' );
var isFunction = require( '@stdlib/assert/is-function' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var quantile = require( '@stdlib/math/base/dist/betaprime/quantile' );
var logpdf = require( '@stdlib/math/base/dist/betaprime/logpdf' );
var cdf = require( '@stdlib/math/base/dist/betaprime/cdf' );
var pdf = require( '@stdlib/math/base/dist/betaprime/pdf' );
var kurtosis = require( '@stdlib/math/base/dist/betaprime/kurtosis' );
var skewness = require( '@stdlib/math/base/dist/betaprime/skewness' );
var variance = require( '@stdlib/math/base/dist/betaprime/variance' );
var mode = require( '@stdlib/math/base/dist/betaprime/mode' );
var mean = require( '@stdlib/math/base/dist/betaprime/mean' );
var BetaPrime = require( './../lib' );


// TESTS //

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

tape( 'the function throws an error if provided an `alpha` argument which is not a positive number', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		-5.0,
		0.0,
		NaN,
		true,
		false,
		undefined,
		null,
		{},
		[],
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			// eslint-disable-next-line no-new
			new BetaPrime( value, 2.0 );
		};
	}
});

tape( 'the function throws an error if provided a `beta` argument which is not a positive number', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		-5.0,
		0.0,
		NaN,
		true,
		false,
		undefined,
		null,
		{},
		[],
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			// eslint-disable-next-line no-new
			new BetaPrime( 2.0, value );
		};
	}
});

tape( 'if provided arguments, the function requires both `alpha` and `beta`', function test( t ) {
	t.throws( foo, TypeError, 'throws an error' );
	t.end();

	function foo() {
		// eslint-disable-next-line no-new
		new BetaPrime( 2.0 );
	}
});

tape( 'the function returns a new distribution instance (default parameters)', function test( t ) {
	var beta = new BetaPrime();
	t.strictEqual( beta instanceof BetaPrime, true, 'returns an instance');
	t.end();
});

tape( 'the function returns a new distribution instance (custom parameters)', function test( t ) {
	var betaprime = new BetaPrime( 2.0, 4.0 );
	t.strictEqual( betaprime instanceof BetaPrime, true, 'returns an instance');
	t.end();
});<commit_msg>Fix variable name<commit_after>'use strict';

// MODULES //

var tape = require( 'tape' );
var isFunction = require( '@stdlib/assert/is-function' );
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
var quantile = require( '@stdlib/math/base/dist/betaprime/quantile' );
var logpdf = require( '@stdlib/math/base/dist/betaprime/logpdf' );
var cdf = require( '@stdlib/math/base/dist/betaprime/cdf' );
var pdf = require( '@stdlib/math/base/dist/betaprime/pdf' );
var kurtosis = require( '@stdlib/math/base/dist/betaprime/kurtosis' );
var skewness = require( '@stdlib/math/base/dist/betaprime/skewness' );
var variance = require( '@stdlib/math/base/dist/betaprime/variance' );
var mode = require( '@stdlib/math/base/dist/betaprime/mode' );
var mean = require( '@stdlib/math/base/dist/betaprime/mean' );
var BetaPrime = require( './../lib' );


// TESTS //

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

tape( 'the function throws an error if provided an `alpha` argument which is not a positive number', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		-5.0,
		0.0,
		NaN,
		true,
		false,
		undefined,
		null,
		{},
		[],
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			// eslint-disable-next-line no-new
			new BetaPrime( value, 2.0 );
		};
	}
});

tape( 'the function throws an error if provided a `beta` argument which is not a positive number', function test( t ) {
	var values;
	var i;

	values = [
		'5',
		-5.0,
		0.0,
		NaN,
		true,
		false,
		undefined,
		null,
		{},
		[],
		function noop() {}
	];

	for ( i = 0; i < values.length; i++ ) {
		t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
	}
	t.end();

	function badValue( value ) {
		return function badValue() {
			// eslint-disable-next-line no-new
			new BetaPrime( 2.0, value );
		};
	}
});

tape( 'if provided arguments, the function requires both `alpha` and `beta`', function test( t ) {
	t.throws( foo, TypeError, 'throws an error' );
	t.end();

	function foo() {
		// eslint-disable-next-line no-new
		new BetaPrime( 2.0 );
	}
});

tape( 'the function returns a new distribution instance (default parameters)', function test( t ) {
	var betaprime = new BetaPrime();
	t.strictEqual( betaprime instanceof BetaPrime, true, 'returns an instance');
	t.end();
});

tape( 'the function returns a new distribution instance (custom parameters)', function test( t ) {
	var betaprime = new BetaPrime( 2.0, 4.0 );
	t.strictEqual( betaprime instanceof BetaPrime, true, 'returns an instance');
	t.end();
});
{'fraction_non_alphanumeric': 0.16578669482576558, 'fraction_numerical': 0.007743752199929602, 'mean_word_length': 3.6016194331983806, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5832041', 'n_tokens_mistral': 2171, 'n_tokens_neox': 2008, 'n_words': 578}