text: /**
  * @license Apache-2.0
  *
  * Copyright (c) 2018 The Stdlib Authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *    http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
  
  'use strict';
  
  var invalid = [];
  var test;
  
  test = {
  	'code': [
  		'\'use strict\'',
  		'',
  		'/**',
  		'* Squares a number.',
  		'*',
  		'* @param {number} x - input value',
  		'* @returns {number} x*x',
  		'* @example',
  		'* var y = square( 3.0 );',
  		'* // returns 12.0',
  		'*',
  		'* y = square( 2.0 );',
  		'* // returns 4.0',
  		'*/',
  		'function square( x ) {',
  		'  return x*x;',
  		'}'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Displayed return value is `12.0`, but expected `9` instead',
  			'type': null
  		}
  	],
  	'output': [
  		'\'use strict\'',
  		'',
  		'/**',
  		'* Squares a number.',
  		'*',
  		'* @param {number} x - input value',
  		'* @returns {number} x*x',
  		'* @example',
  		'* var y = square( 3.0 );',
  		'* // returns 9',
  		'*',
  		'* y = square( 2.0 );',
  		'* // returns 4.0',
  		'*/',
  		'function square( x ) {',
  		'  return x*x;',
  		'}'
  	].join( '\n' )
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'/**',
  		'* Squares a number.',
  		'*',
  		'* @param {number} x - input value',
  		'* @returns {number} x*x',
  		'* @example',
  		'* console.log( square( 3.0 ) );',
  		'* // => 12.0',
  		'*',
  		'* console.log( square( 2.0 ) );',
  		'* // => 4.0',
  		'*/',
  		'function square( x ) {',
  		'  return x*x;',
  		'}'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Displayed return value is `12.0`, but expected `9` instead',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'/**',
  		'* Squares a number.',
  		'*',
  		'* @param {number} x - input value',
  		'* @returns {number} x*x',
  		'* @example',
  		'* var y = square( 3.0 );',
  		'* // returns 9.0',
  		'*',
  		'* y = square() );',
  		'* // returns 4.0',
  		'*/',
  		'function square( x ) {',
  		'  return x*x;',
  		'}'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Encountered an error while running code: `Unexpected token )`.Did you mean to include a `// throws <SyntaxError>` annotation instead of `// returns 4.0`?',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'\'use strict\';',
  		'',
  		'// MODULES //',
  		'',
  		'var evil = require( \'@stdlib/utils/eval\' );',
  		'',
  		'',
  		'// MAIN //',
  		'',
  		'/**',
  		'* Tests for native `function*()` support.',
  		'*',
  		'* @returns {boolean} boolean indicating if an environment has native `function*()` support',
  		'*',
  		'* @example',
  		'* var bool = hasGeneratorSupport();',
  		'* // returns <string>',
  		'*/',
  		'function hasGeneratorSupport() {',
  		'	var bool;',
  		'	try {',
  		'		evil( \'"use strict"; (function* () {})\' );',
  		'		bool = true;',
  		'	} catch ( err ) { // eslint-disable-line no-unused-vars',
  		'		bool = false;',
  		'	}',
  		'	return bool;',
  		'}',
  		'',
  		'',
  		'// EXPORTS //',
  		'',
  		'module.exports = hasGeneratorSupport;'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Expected a <string>, but received: `true`',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'\'use strict\';',
  		'',
  		'// MODULES //',
  		'',
  		'var asin = require( \'@stdlib/math/base/special/asin\' );',
  		'var sqrt = require( \'@stdlib/math/base/special/sqrt\' );',
  		'',
  		'',
  		'// MAIN //',
  		'',
  		'/**',
  		'* Computes the inverse half-value versed sine.',
  		'*',
  		'* @param {number} x - input value',
  		'* @returns {number} inverse half-value versed sine',
  		'*',
  		'* @example',
  		'* var v = ahaversin( 0.0 );',
  		'* // returns 0.0',
  		'*',
  		'* @example',
  		'* var v = ahaversin( 1.0 );',
  		'* // returns 3.1416',
  		'*',
  		'* @example',
  		'* var v = ahaversin( 0.5 );',
  		'* // returns ~1.5708',
  		'*',
  		'* @example',
  		'* var v = ahaversin( NaN );',
  		'* // returns null',
  		'*/',
  		'function ahaversin( x ) {',
  		'	return 2.0 * asin( sqrt( x ) );',
  		'}',
  		'',
  		'',
  		'// EXPORTS //',
  		'',
  		'module.exports = ahaversin;'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Displayed return value is `3.1416`, but expected `3.141592653589793` instead',
  			'type': null
  		},
  		{
  			'message': 'Displayed return value is `null`, but expected `NaN` instead',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'\'use strict\';',
  		'',
  		'// MODULES //',
  		'',
  		'var isString = require( \'@stdlib/assert/is-string\' ).isPrimitive;',
  		'',
  		'',
  		'// MAIN //',
  		'',
  		'/**',
  		'* Removes the first character of a string.',
  		'*',
  		'* @param {string} str - input string',
  		'* @throws {TypeError} must provide a string primitive',
  		'* @returns {string} updated string',
  		'*',
  		'* @example',
  		'* var out = removeFirst( \'last man standing\' );',
  		'* // returns \'ast man standing\'',
  		'*',
  		'* @example',
  		'* var out = removeFirst( \'presidential election\' );',
  		'* // returns \'residential election\'',
  		'*',
  		'* @example',
  		'* var out = removeFirst( \'javaScript\' );',
  		'* // returns \'javaScript\'',
  		'*',
  		'* @example',
  		'* var out = removeFirst( \'Hidden Treasures\' );',
  		'* // returns \'idden Treasures\'',
  		'*/',
  		'function removeFirst( str ) {',
  		'	if ( !isString( str ) ) {',
  		'		throw new TypeError( \'invalid argument. First argument must be a string primitive. Value: `\' + str + \'`.\' );',
  		'	}',
  		'	if ( str === \'\' ) {',
  		'		return \'\';',
  		'	}',
  		'	return str.substring( 1 );',
  		'}',
  		'',
  		'',
  		'// EXPORTS //',
  		'',
  		'module.exports = removeFirst;'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Displayed return value is `javaScript`, but expected `avaScript` instead',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'\'use strict\';',
  		'',
  		'// MODULES //',
  		'',
  		'var isFunction = require( \'@stdlib/assert/is-function\' );',
  		'var hasFunctionNameSupport = require( \'@stdlib/assert/has-function-name-support\' );',
  		'var RE = require( \'@stdlib/regexp/function-name\' );',
  		'',
  		'',
  		'// VARIABLES //',
  		'',
  		'var isFunctionNameSupported = hasFunctionNameSupport();',
  		'',
  		'',
  		'// MAIN //',
  		'',
  		'/**',
  		'* Returns the name of a function.',
  		'*',
  		'* @param {Function} fcn - input function',
  		'* @throws {TypeError} must provide a function',
  		'* @returns {string} function name',
  		'*',
  		'* @example',
  		'* var v = functionName( Math.sqrt );',
  		'* // returns \'sqrt\'',
  		'*',
  		'* @example',
  		'* var v = functionName( function foo(){} );',
  		'* // returns \'foo\'',
  		'*',
  		'* @example',
  		'* var v = functionName( function(){} );',
  		'* // returns \'beep\' || \'boop\'',
  		'*',
  		'* @example',
  		'* var v = functionName( String );',
  		'* // returns \'String\'',
  		'*/',
  		'function functionName( fcn ) {',
  		'	if ( isFunction( fcn ) === false ) {',
  		'		throw new TypeError( \'invalid argument. Must provide a function. Value: `\' + fcn + \'`.\' );',
  		'	}',
  		'	if ( isFunctionNameSupported ) {',
  		'		return fcn.name;',
  		'	}',
  		'	return RE.exec( fcn.toString() )[ 1 ];',
  		'}',
  		'',
  		'',
  		'// EXPORTS //',
  		'',
  		'module.exports = functionName;'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Actual value is ``, but expected `\'beep\'` or `\'boop\'`',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'\'use strict\';',
  		'',
  		'// MODULES //',
  		'',
  		'var isCollection = require( \'@stdlib/assert/is-collection\' );',
  		'var isFunction = require( \'@stdlib/assert/is-function\' );',
  		'',
  		'',
  		'// MAIN //',
  		'',
  		'/**',
  		'* Invokes a function once for each element in a collection and updates the collection in-place.',
  		'*',
  		'* ## Notes',
  		'*',
  		'* -   The invoked function\'s return value is cached prior to updating a collection. Before updating the collection, a collection must be inspected to ensure that a collection has not been resized during invocation such that an index no longer has a corresponding element in the collection. Were a return value automatically used to update a collection, an input collection could be converted into a sparse data structure. While some might consider this a feature, here, we take stance that a user should be less clever.',
  		'*',
  		'*',
  		'* @param {Collection} collection - input collection',
  		'* @param {Function} fcn - function to invoke',
  		'* @param {*} [thisArg] - execution context',
  		'* @throws {TypeError} first argument must be a collection',
  		'* @throws {TypeError} second argument must be a function',
  		'* @returns {Collection} input collection',
  		'*',
  		'* @example',
  		'* function scale( value, index, collection ) {',
  		'*     return value * index;',
  		'* }',
  		'*',
  		'* var arr = [ 1, 2, 3, 4 ];',
  		'*',
  		'* var out = inmap( arr, scale );',
  		'* // returns [ 0, 2, 4, 16 ]',
  		'*',
  		'* var bool = ( out === arr );',
  		'* // returns true',
  		'*/',
  		'function inmap( collection, fcn, thisArg ) {',
  		'	var len;',
  		'	var v;',
  		'	var i;',
  		'	if ( !isCollection( collection ) ) {',
  		'		throw new TypeError( \'invalid argument. First argument must be a collection. Value: `\'+collection+\'`.\' );',
  		'	}',
  		'	if ( !isFunction( fcn ) ) {',
  		'		throw new TypeError( \'invalid argument. Second argument must be a function. Value: `\'+fcn+\'`.\' );',
  		'	}',
  		'	len = collection.length;',
  		'	for ( i = 0; i < len; i++ ) {',
  		'		v = fcn.call( thisArg, collection[ i ], i, collection );',
  
  		'		// Account for dynamically resizing a collection...',
  		'		if ( len !== collection.length ) {',
  		'			len = collection.length;',
  		'		}',
  		'		if ( i < len ) {',
  		'			collection[ i ] = v;',
  		'		}',
  		'	}',
  		'	return collection;',
  		'}',
  		'',
  		'',
  		'// EXPORTS //',
  		'',
  		'module.exports = inmap;'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Displayed return value is `[ 0, 2, 4, 16 ]`, but expected `[ 0, 2, 6, 12 ]` instead',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'\'use strict\';',
  		'',
  		'// MODULES //',
  		'',
  		'var isArray = require( \'@stdlib/assert/is-array\' );',
  		'var isTypedArrayLike = require( \'@stdlib/assert/is-typed-array-like\' );',
  		'var isInteger = require( \'@stdlib/assert/is-integer\' );',
  		'',
  		'',
  		'// MAIN //',
  		'',
  		'/**',
  		'* Removes and returns the first element of a collection.',
  		'*',
  		'* @param {Array} arr - collection',
  		'* @throws {TypeError} must provide an array',
  		'* @returns {Array} updated array and the removed element',
  		'*',
  		'* @example',
  		'* var arr = [ 1.0, 2.0, 3.0, 4.0, 5.0 ];',
  		'*',
  		'* var out = shift( arr );',
  		'* // returns [ [ 2.0, 3.0, 8.0, 10.0 ], 3.0 ]',
  		'*/',
  		'function shift( arr ) {',
  		'	var v;',
  		'	if ( isArray( arr ) ) {',
  		'		v = arr.shift();',
  		'		return [ arr, v ];',
  		'	}',
  		'	throw new TypeError( \'invalid argument. Must provide an array. Value: `\'+arr+\'`.\' );',
  		'}',
  		'',
  		'',
  		'// EXPORTS //',
  		'',
  		'module.exports = shift;'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Displayed return value is `[ [ 2.0, 3.0, 8.0, 10.0 ], 3.0 ]`, but expected `[ [ 2, 3, 4, 5 ], 1 ]` instead',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'/**',
  		'* Converts a string to lowercase.',
  		'*',
  		'* @param {string} str - string to convert',
  		'* @throws {TypeError} must provide a primitive string',
  		'* @returns {string} lowercase string',
  		'*',
  		'* @example',
  		'* var str = lowercase( \'bEEp\' );',
  		'* // returns \'beep\'',
  		'* ',
  		'* @example',
  		'* var str = lowercase();',
  		'* // returns <TypeError>',
  		'*/',
  		'function lowercase( str ) {',
  		'  if ( typeof str !== \'string\' ) {',
  		'    throw new TypeError( \'invalid argument. Must provide a primitive string. Value: `\'+str+\'`.\' );',
  		'  }',
  		'  return str.toLowerCase();',
  		'}'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Encountered an error while running code: `invalid argument. Must provide a primitive string. Value: `undefined`.`.Did you mean to include a `// throws <TypeError>` annotation instead of `// returns <TypeError>`?',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'/**',
  		'* Converts a string to lowercase.',
  		'*',
  		'* @param {string} str - string to convert',
  		'* @throws {TypeError} must provide a primitive string',
  		'* @returns {string} lowercase string',
  		'*',
  		'* @example',
  		'* var str = lowercase( \'bEEp\' );',
  		'* // returns \'beep\'',
  		'* ',
  		'* @example',
  		'* var str = lowercase();',
  		'* // throws <RangeError>',
  		'*/',
  		'function lowercase( str ) {',
  		'  if ( typeof str !== \'string\' ) {',
  		'    throw new TypeError( \'invalid argument. Must provide a primitive string. Value: `\'+str+\'`.\' );',
  		'  }',
  		'  return str.toLowerCase();',
  		'}'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Code should have a `// throws <TypeError>` annotation, but received: `// throws <RangeError>`',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  test = {
  	'code': [
  		'/**',
  		'* Pushes elements to an array.',
  		'*',
  		'* @param {Array} arr - input array',
  		'* @param {...any} elements - element(s) to append',
  		'* @returns {integer} array length',
  		'*',
  		'* @example',
  		'* var arr = [];',
  		'* push( arr, 3 );',
  		'* // x => [ 3 ]',
  		'*',
  		'* @example',
  		'* var arr = [];',
  		'* push( arr, 3 );',
  		'* // arr => [ 6 ]',
  		'*/',
  		'function push( arr ) {',
  		'  var items;',
  		'  var i;',
  		'  items = new Array( arguments.length-1 );',
  		'  for ( i = 0; i < arguments.length-1; i++ ) {',
  		'    items[ i ] = arguments[ i+1 ];',
  		'  }',
  		'  return Array.prototype.push.apply( arr, items );',
  		'}'
  	].join( '\n' ),
  	'errors': [
  		{
  			'message': 'Encountered an error: `x is not defined`.',
  			'type': null
  		},
  		{
  			'message': 'Displayed return value is `[ 6 ]`, but expected `[ 3 ]` instead',
  			'type': null
  		}
  	]
  };
  invalid.push( test );
  
  
  // EXPORTS //
  
  module.exports = invalid;
  