text: /* global describe, it, require */
  'use strict';
  
  // MODULES //
  
  var // Expectation library:
  	chai = require( 'chai' ),
  
  	// Check whether an element is a finite number
  	isFiniteNumber = require( 'validate.io-finite' ),
  
  	// Check whether an element is `NaN`
  	isnan = require( 'validate.io-nan' ),
  
  	// Module to be tested:
  	partial = require( './../lib/partial.js' );
  
  
  // VARIABLES //
  
  var expect = chai.expect,
  	assert = chai.assert;
  
  
  // TESTS //
  
  describe( 'partial cdf', function tests() {
  
  	var	validationData = require( './fixtures/partial.json' ),
  		data = validationData.data,
  		expected = validationData.expected.map( function( d ) {
  			return d === 'Inf' ? Infinity : d;
  		}),
  		gamma = validationData.gamma,
  		x0 = validationData.x0;
  
  	it( 'should export a function', function test() {
  		expect( partial ).to.be.a( 'function' );
  	});
  
  	it( 'should partially apply the Cauchy cdf for given parameter values', function test() {
  		var cdf;
  		cdf = partial( gamma, x0 );
  		expect( cdf ).to.be.a( 'function' );
  	});
  
  	it( 'should return a function which evaluates the probability density function', function test() {
  		var cdf, actual;
  		cdf = partial(  gamma, x0 );
  		for ( var i = 0; i < data.length; i++ ) {
  			actual = cdf( data[ i ] );
  			if ( isFiniteNumber( actual ) && isFiniteNumber( expected[ i ] ) ) {
  				assert.closeTo( actual, expected[ i ] , 1e-14 );
  			}
  		}
  	});
  
  	it( 'should return `NaN` if provided `NaN` as input', function test() {
  		var cdf = partial(  gamma, x0 );
  		assert.isTrue( isnan( cdf( NaN ) ) );
  	});
  
  });
  