<commit_before>var compareAst = require('..');

suite('compareAst', function() {
	test('whitespace', function() {
		compareAst('\tvar   a=0;\n \t a    +=4;\n\n', 'var a = 0; a += 4;');
	});

	test('dereferencing', function() {
		compareAst('a.b;', 'a["b"];');
	});

	test('IIFE parenthesis placement', function() {
		compareAst('(function() {}());', '(function() {})();');
	});

	test.skip('variable lists', function() {
		compareAst('var a; var b;', 'var a, b;');
	});

	test('variable binding', function() {
		compareAst(
			'(function(a, b) { console.log(a + b); })(1, 3);',
			'(function(__UNBOUND0__, __UNBOUND1__) {' +
				'console.log(__UNBOUND0__ + __UNBOUND1__);' +
			'}) (1,3);',
			{ varPattern: /__UNBOUND\d+__/ }
		);
	});

	test('string binding', function() {
		compareAst(
			'a["something"];"something2";"something";',
			'a["__STR1__"]; "__STR2__"; "__STR1__";',
			{ stringPattern: /__STR\d+__/ }
		);
	});

	test('string binding with object dereferencing', function() {
		compareAst(<commit_msg>Increase test coverage<commit_after>var compareAst = require('..');

suite('compareAst', function() {
	test('whitespace', function() {
		compareAst('\tvar   a=0;\n \t a    +=4;\n\n', 'var a = 0; a += 4;');
	});

	suite('dereferencing', function() {
		test('identifier to literal', function() {
			compareAst('a.b;', 'a["b"];');
		});

		test('literal to identifier', function() {
			compareAst('a["b"];', 'a.b;');
		});
	});

	test('IIFE parenthesis placement', function() {
		compareAst('(function() {}());', '(function() {})();');
	});

	test.skip('variable lists', function() {
		compareAst('var a; var b;', 'var a, b;');
	});

	test('variable binding', function() {
		compareAst(
			'(function(a, b) { console.log(a + b); })(1, 3);',
			'(function(__UNBOUND0__, __UNBOUND1__) {' +
				'console.log(__UNBOUND0__ + __UNBOUND1__);' +
			'}) (1,3);',
			{ varPattern: /__UNBOUND\d+__/ }
		);
	});

	test('string binding', function() {
		compareAst(
			'a["something"];"something2";"something";',
			'a["__STR1__"]; "__STR2__"; "__STR1__";',
			{ stringPattern: /__STR\d+__/ }
		);
	});

	test('string binding with object dereferencing', function() {
		compareAst(
{'fraction_non_alphanumeric': 0.2502295684113866, 'fraction_numerical': 0.014692378328741965, 'mean_word_length': 4.380246913580247, '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': '1150196', 'n_tokens_mistral': 902, 'n_tokens_neox': 806, 'n_words': 153}