<commit_before>'use strict';

describe('Index', function () {

	var BaseIndex = require('../src/baseindex');

	var expect = require('chai').expect;
	var assert = require('chai').assert;

	var initIndex = function (values) {
		assert.isArray(values);

		var baseIndex = new BaseIndex();
		
		baseIndex.getName = function () {
			return '==test-index==';
		};

		baseIndex.getValues = function () {
			return values;
		};
		
		return baseIndex;
	};

	it('can skip', function () {

		var index = initIndex([0, 1, 2, 3]);
		expect(index.skip(2).getValues()).to.eql([2, 3]);
	});

	it('can take', function () {

		var index = initIndex([0, 1, 2, 3]);
		expect(index.take(2).getValues()).to.eql([0, 1]);
	});

	it('can get subset of rows', function () {

		var index = initIndex([0, 1, 2, 3]);
		var subset = index .getRowsSubset(1, 2);
		expect(subset.getValues()).to.eql([1, 2]);
	});
});<commit_msg>Added a new test prior to converting BaseIndex to use getEnumerator.<commit_after>'use strict';

describe('Index', function () {

	var BaseIndex = require('../src/baseindex');

	var expect = require('chai').expect;
	var assert = require('chai').assert;

	var initIndex = function (values) {
		assert.isArray(values);

		var baseIndex = new BaseIndex();
		
		baseIndex.getName = function () {
			return '==test-index==';
		};

		baseIndex.getValues = function () {
			return values;
		};
		
		return baseIndex;
	};

	it('can get values from index', function () {

		var index = initIndex([0, 1, 2, 3]);
		expect(index.getValues()).to.eql([0, 1, 2, 3]);
	});

	it('can skip', function () {

		var index = initIndex([0, 1, 2, 3]);
		expect(index.skip(2).getValues()).to.eql([2, 3]);
	});

	it('can take', function () {

		var index = initIndex([0, 1, 2, 3]);
		expect(index.take(2).getValues()).to.eql([0, 1]);
	});

	it('can get subset of rows', function () {

		var index = initIndex([0, 1, 2, 3]);
		var subset = index .getRowsSubset(1, 2);
		expect(subset.getValues()).to.eql([1, 2]);
	});
});
{'fraction_non_alphanumeric': 0.20452261306532662, 'fraction_numerical': 0.02613065326633166, 'mean_word_length': 3.7517899761336517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2322436', 'n_tokens_mistral': 793, 'n_tokens_neox': 686, 'n_words': 172}