<commit_before><commit_msg>Add tests<commit_after>'use strict';

// MODULES //

var tape = require( 'tape' );
var filter = require( './../lib/filter_literals.js' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof filter, 'function', 'main export is a function' );
	t.end();
});

tape( 'the function bifurcates a list of strings into relative require/import literals and packages', function test( t ) {
	var expected;
	var actual;
	var arr;

	arr = [
		'./beep.js',
		'boop',
		'../boop/foo',
		'fs',
		'net',
		'stream',
		'C:/foo/bar.js',
		'beep',
		'c:\\bar\\bip\\bop.js',
		'os',
		'@stdlib/math/base/special/gamma'
	];

	expected = {
		'relative': [
			'./beep.js',
			'../boop/foo',
			'C:/foo/bar.js',
			'c:\\bar\\bip\\bop.js'
		],
		'packages': [
			'boop',
			'fs',
			'net',
			'stream',
			'beep',
			'os',
			'@stdlib/math/base/special/gamma'
		]
	};

	actual = filter( arr );
	t.deepEqual( actual, expected, 'returns expected results' );

	t.end();
});

tape( 'if provided an empty array, the function returns empty arrays', function test( t ) {
	var expected;
	var actual;

	expected = {
		'relative': [],
		'packages': []
	};
	actual = filter( [] );

	t.deepEqual( actual, expected, 'returns expected results' );
	t.end();
});
{'fraction_non_alphanumeric': 0.20702826585179526, 'fraction_numerical': 0.0, 'mean_word_length': 2.9696969696969697, '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': '6819071', 'n_tokens_mistral': 553, 'n_tokens_neox': 505, 'n_words': 124}