'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var isBoolean = require( '@stdlib/assert/is-boolean' ).isPrimitive;
var pkg = require( './../package.json' ).name;
var endsWith = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
	var bool;
	var str;
	var i;

	str = 'To be, or not to be, that is the question.';

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		bool = endsWith( str, String.fromCharCode( i%126 ) );
		if ( !isBoolean( bool ) ) {
			b.fail( 'should return a boolean' );
		}
	}
	b.toc();
	if ( !isBoolean( bool ) ) {
		b.fail( 'should return a boolean' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});

bench( pkg+'::search', function benchmark( b ) {
	var bool;
	var str;
	var i;

	str = 'To be, or not to be, that is the question.';

	b.tic();
	for ( i = 0; i < b.iterations; i++ ) {
		bool = endsWith( str, 'to be', i%42 );
		if ( !isBoolean( bool ) ) {
			b.fail( 'should return a boolean' );
		}
	}
	b.toc();
	if ( !isBoolean( bool ) ) {
		b.fail( 'should return a boolean' );
	}
	b.pass( 'benchmark finished' );
	b.end();
});

@@ -131,16 +131,81 @@
 mitive;%0A
+var fromCodePoint = require( '@stdlib/string/from-code-point' );%0A
 var pkg 
@@ -495,27 +495,21 @@
 tr, 
-String.fromCharCode
+fromCodePoint
 ( i%25

Use string utility