<commit_before>jest.autoMockOff();

const thePlugin = require('../../../utils/test-transform')(require('../inline-identity'));
const theUnsafePlugin = require('../../../utils/test-transform')([[require('../inline-identity'), { unsafe: true }]]);

describe('inline-identity', () => {
	describe('succeeds on', () => {
		thePlugin('function declaration', `
			function i(x) {
				return x;
			}
			var x = i(1);
		`, `
			function i(x) {
				return x;
			}
			var x = 1;
		`);
		thePlugin('function expression', `
			var i = function (x) {
				return x;
			};
			var x = i(1);
		`, `
			var i = function (x) {
				return x;
			};
			var x = 1;
		`);
		thePlugin('arrow function expression, expression body', `
			var i = x => x; 
			var x = i(1);
		`, `
			var i = x => x;
			var x = 1;
		`);
		thePlugin('arrow function expression, block body', `
			var i = x => {
				return x;
			}; 
			var x = i(1);
		`, `
			var i = x => {
				return x;
			};
			var x = 1;
		`);
		thePlugin('additional pure arguments', `
			function i(x) {
				return x;
			}
			var x = i(1, i, 42);
		`, `
			function i(x) {
				return x;<commit_msg>ensure that inline-identity doesn't bail out on additional params<commit_after>jest.autoMockOff();

const thePlugin = require('../../../utils/test-transform')(require('../inline-identity'));
const theUnsafePlugin = require('../../../utils/test-transform')([[require('../inline-identity'), { unsafe: true }]]);

describe('inline-identity', () => {
	describe('succeeds on', () => {
		thePlugin('function declaration', `
			function i(x) {
				return x;
			}
			var x = i(1);
		`, `
			function i(x) {
				return x;
			}
			var x = 1;
		`);
		thePlugin('function expression', `
			var i = function (x) {
				return x;
			};
			var x = i(1);
		`, `
			var i = function (x) {
				return x;
			};
			var x = 1;
		`);
		thePlugin('arrow function expression, expression body', `
			var i = x => x; 
			var x = i(1);
		`, `
			var i = x => x;
			var x = 1;
		`);
		thePlugin('arrow function expression, block body', `
			var i = x => {
				return x;
			}; 
			var x = i(1);
		`, `
			var i = x => {
				return x;
			};
			var x = 1;
		`);
		thePlugin('additional params', `
			function i(x, y) {
				return x;
			}
			var x = i(1);
		`, `
			function i(x, y) {
				return x;
			}
			var x = 1;
		`);
		thePlugin('additional pure arguments', `
			function i(x) {
				return x;
			}
			var x = i(1, i, 42);
		`, `
			function i(x) {
				return x;
{'fraction_non_alphanumeric': 0.1973951973951974, 'fraction_numerical': 0.009768009768009768, 'mean_word_length': 2.268617021276596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '355903', 'n_tokens_mistral': 1118, 'n_tokens_neox': 899, 'n_words': 233}