function generateExpectedPage( text, pageHeight, pageWidth, index ) {
	var lines;
	var page;
	var out;

	// Generate the page text:
	lines = text.split( '\\n' );
	index = min( index, lines.length - pageHeight );
	page = slice( lines, index, pageHeight + index ).join( '\n' );

	// Construct the expected output:
	out = '\n';
	if ( index > 0 ) {
		out += repeat( '_', pageWidth ) + '\n';
	}
	out += page;
	out += '\n';
	if ( index < lines.length - pageHeight ) {
		out += repeat( '_', pageWidth );
	}
	out += '\n';
	out += '\x1B[1mUse UP/DOWN arrow keys to scroll. Press q to exit...\x1B[22m';

	return out;
}
Generates expected paged output based on the given page height and text.

@private
@param {string} text - text to be paged
@param {number} pageHeight - height of the page (excluding reserved UI rows)
@param {number} pageWidth - width of the page
@param {number} index - scroll index of the page
@returns {string} expected paged output