<commit_before>const test = require('tape');
const JSONF = require('../jsonf');

test('JSONF test', t => {

    /* eslint-disable */

	const testObject = {
		a:[1,2,3, function (a,b) {
			/*          */
			return a*b
		}],
		b:function(a){return a*a/*


		*/},
		c:{
			d: 5
		},
		e: function (x) {
			return x + '\r\n';
		},
		f: function(){},
		g: {
			regex1: /^[a-z]+ latenc(y|ies)$/gi,
			regex2: /[a-z]*\\\/\..+?/
		}
	};

	/* eslint-enable */

    const stringified = JSONF.stringify(testObject);

    // eslint-disable-next-line no-multi-str
    const expectedStringified = '{"a":[1,2,3,"function (a,b) {\\n\\t\\t\\t/*          */\\n\\t\\t\\treturn a*b\\n\\t\\t}"],\
"b":"function (a){return a*a/*\\n\\n\\n\\t\\t*/}",\
"c":{"d":5},\
"e":"function (x) {\\n\\t\\t\\treturn x + \'\\\\r\\\\n\';\\n\\t\\t}",\
"f":"function (){}",\
"g":{"regex1":"/^[a-z]+ latenc(y|ies)$/gi","regex2":"/[a-z]*\\\\\\\\\\\\/\\\\..+?/"}}';

    t.equal(stringified, expectedStringified);

    const parsed = JSONF.parse(stringified);
<commit_msg>Fix JSONF test<commit_after>const test = require('tape');
const JSONF = require('../jsonf');

test('JSONF test', t => {

    /* eslint-disable */

	const testObject = {
		a:[1,2,3, function (a,b) {
			/*          */
			return a*b
		}],
		b:function(a){return a*a/*


		*/},
		c:{
			d: 5
		},
		e: function (x) {
			return x + '\r\n';
		},
		f: function(){},
		g: {
			regex1: /^[a-z]+ latenc(y|ies)$/gi,
			regex2: /[a-z]*\\\/\..+?/
		}
	};

	/* eslint-enable */

    const stringified = JSONF.stringify(testObject);

    // eslint-disable-next-line no-multi-str
    const expectedStringified = '{"a":[1,2,3,"function (a,b) {\\n\\t\\t\\t/*          */\\n\\t\\t\\treturn a*b\\n\\t\\t}"],\
"b":"function(a){return a*a/*\\n\\n\\n\\t\\t*/}",\
"c":{"d":5},\
"e":"function (x) {\\n\\t\\t\\treturn x + \'\\\\r\\\\n\';\\n\\t\\t}",\
"f":"function(){}",\
"g":{"regex1":"/^[a-z]+ latenc(y|ies)$/gi","regex2":"/[a-z]*\\\\\\\\\\\\/\\\\..+?/"}}';

    t.equal(stringified, expectedStringified);

    const parsed = JSONF.parse(stringified);

{'fraction_non_alphanumeric': 0.3247447739426349, 'fraction_numerical': 0.01166747690811862, 'mean_word_length': 2.2409448818897637, 'pattern_counts': {'":': 18, '<': 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': '6252945', 'n_tokens_mistral': 954, 'n_tokens_neox': 862, 'n_words': 133}