<commit_before>'use strict';

var test = require('ava');
var mnGen = require('./');
var words = require('./words.json');

test(function (t) {
	t.assert(mnGen.word().length > 0);
	t.assert(mnGen.list().length === 100);
	t.assert(mnGen.list(10).length === 10);
	t.assert(mnGen.list(1644, 2).length === 1644);
	t.assert(mnGen.list(1, 2)[0].indexOf('-') !== -1);
	t.assert(mnGen.word(2).indexOf('-') !== -1);
	t.assert(mnGen.word(4).split('-').length === 4);
	t.end();
});

test(function(t) {
	t.plan(1);

	try {
		mnGen.list(1644);
	} catch (err) {
		t.assert(new RegExp(words.length).test(err.message));
	}

	t.end();
});

test(function(t) {
	t.plan(1);

	try {
		mnGen.list(2665057, 2);
	} catch (err) {
		t.assert(new RegExp(words.length * (words.length - 1)).test(err.message));
	}

	t.end();
});<commit_msg>test: Add tests for custom separator<commit_after>'use strict';

var test = require('ava');
var mnGen = require('./');
var words = require('./words.json');

test(function (t) {
	t.assert(mnGen.word().length > 0);
	t.assert(mnGen.list().length === 100);
	t.assert(mnGen.list(10).length === 10);
	t.assert(mnGen.list(1644, 2).length === 1644);
	t.assert(mnGen.list(1, 2)[0].indexOf('-') !== -1);
	t.assert(mnGen.word(2).indexOf('-') !== -1);
	t.assert(mnGen.word(4).split('-').length === 4);
	t.end();
});

test(function(t) {
	t.plan(1);

	try {
		mnGen.list(1644);
	} catch (err) {
		t.assert(new RegExp(words.length).test(err.message));
	}

	t.end();
});

test(function(t) {
	t.plan(1);

	try {
		mnGen.list(2665057, 2);
	} catch (err) {
		t.assert(new RegExp(words.length * (words.length - 1)).test(err.message));
	}

	t.end();
});

test('custom separator', function (t) {
	const word = mnGen.word(2, '/');
	const list = mnGen.list(1, 2, '/')[0];
	t.assert(word.indexOf('-') === -1);
	t.assert(word.indexOf('/') !== -1);
	t.assert(list.indexOf('-') === -1);
	t.assert(list.indexOf('/') !== -1);
	t.end();
});
{'fraction_non_alphanumeric': 0.2721584984358707, 'fraction_numerical': 0.045881126173096975, 'mean_word_length': 4.010443864229765, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5459075', 'n_tokens_mistral': 871, 'n_tokens_neox': 805, 'n_words': 128}