old_contents: 'use strict';
  
  // MODULES //
  
  var tape = require( 'tape' );
  var incrmsum = require( './../lib' );
  
  
  // TESTS //
  
  tape( 'main export is a function', function test( t ) {
  	t.ok( true, __filename );
  	t.equal( typeof incrmsum, 'function', 'main export is a function' );
  	t.end();
  });
  
  tape( 'the function throws an error if not provided a positive integer', function test( t ) {
  	var values;
  	var i;
  
  	values = [
  		'5',
  		-5.0,
  		0.0,
  		Math.PI,
  		true,
  		null,
  		undefined,
  		NaN,
  		[],
  		{},
  		function(){}
  	];
  
  	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() {
  			incrmsum( value );
  		};
  	}
  });
  
  tape( 'the function returns an accumulator function', function test( t ) {
  	t.equal( typeof incrmsum( 3 ), 'function', 'returns a function' );
  	t.end();
  });
  
  tape( 'the accumulator function computes a moving sum incrementally', function test( t ) {
  	var expected;
  	var actual;
  	var data;
  	var acc;
  	var N;
  	var i;
  
  	data = [ 2.0, 3.0, 2.0, 4.0, 3.0, 4.0 ];
  	N = data.length;
  
  	acc = incrmsum( 3 );
  
  	actual = new Array( N );
  	for ( i = 0; i < N; i++ ) {
  		actual[ i ] = acc( data[ i ] );
  	}
  	expected = [ 2.0, 5.0, 7.0, 9.0, 9.0, 11.0 ];
  
  	t.deepEqual( actual, expected, 'returns expected incremental results' );
  	t.end();
  });
  
  tape( 'if not provided an input value, the accumulator function returns the current sum', function test( t ) {
  	var data;
  	var acc;
  	var i;
  
  	data = [ 2.0, 3.0, 5.0 ];
  	acc = incrmsum( 2 );
  	for ( i = 0; i < data.length; i++ ) {
  		acc( data[ i ] );
  	}
  	t.equal( acc(), 10.0 );
  	t.end();
  });
  
  tape( 'if data has yet to be provided, the accumulator function returns `null`', function test( t ) {
  	var acc = incrmsum( 3 );
  	t.equal( acc(), null, 'returns null' );
  	t.end();
  });
  
new_contents: 'use strict';
  
  // MODULES //
  
  var tape = require( 'tape' );
  var isnan = require( '@stdlib/math/base/utils/is-nan' );
  var incrmsum = require( './../lib' );
  
  
  // TESTS //
  
  tape( 'main export is a function', function test( t ) {
  	t.ok( true, __filename );
  	t.equal( typeof incrmsum, 'function', 'main export is a function' );
  	t.end();
  });
  
  tape( 'the function throws an error if not provided a positive integer', function test( t ) {
  	var values;
  	var i;
  
  	values = [
  		'5',
  		-5.0,
  		0.0,
  		Math.PI,
  		true,
  		null,
  		undefined,
  		NaN,
  		[],
  		{},
  		function(){}
  	];
  
  	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() {
  			incrmsum( value );
  		};
  	}
  });
  
  tape( 'the function returns an accumulator function', function test( t ) {
  	t.equal( typeof incrmsum( 3 ), 'function', 'returns a function' );
  	t.end();
  });
  
  tape( 'the accumulator function computes a moving sum incrementally', function test( t ) {
  	var expected;
  	var actual;
  	var data;
  	var acc;
  	var N;
  	var i;
  
  	data = [ 2.0, 3.0, 2.0, 4.0, 3.0, 4.0 ];
  	N = data.length;
  
  	acc = incrmsum( 3 );
  
  	actual = new Array( N );
  	for ( i = 0; i < N; i++ ) {
  		actual[ i ] = acc( data[ i ] );
  	}
  	expected = [ 2.0, 5.0, 7.0, 9.0, 9.0, 11.0 ];
  
  	t.deepEqual( actual, expected, 'returns expected incremental results' );
  	t.end();
  });
  
  tape( 'if not provided an input value, the accumulator function returns the current sum', function test( t ) {
  	var data;
  	var acc;
  	var i;
  
  	data = [ 2.0, 3.0, 5.0 ];
  	acc = incrmsum( 2 );
  	for ( i = 0; i < data.length; i++ ) {
  		acc( data[ i ] );
  	}
  	t.equal( acc(), 8.0 );
  	t.end();
  });
  
  tape( 'if data has yet to be provided, the accumulator function returns `null`', function test( t ) {
  	var acc = incrmsum( 3 );
  	t.equal( acc(), null, 'returns null' );
  	t.end();
  });
  
  tape( 'if provided a `NaN` or a value which when computed evaluates to `NaN`, the accumulator returns `NaN` for all future invocations', function test( t ) {
  	var acc;
  	var sum;
  	var i;
  
  	acc = incrmsum( 5 );
  
  	acc( 2.0 );
  	acc( 3.0 );
  	acc( -4.0 );
  	acc( NaN );
  
  	for ( i = 0; i < 1000; i++ ) {
  		sum = acc( Math.random() );
  		t.equal( isnan( sum ), true, 'returns NaN' );
  	}
  	t.end();
  });
  
subject: Add NaN test and fix broken test