<commit_before>'use strict';

var assert = require('assert');
var path = require('path');

var _ = require('lodash');

var extensionsCodegen = require('../../../lib/codegen/extensions');
var generics = require('../../../scripts/_generics');

var extensionMockLocation = path.join(__dirname, "../../../lib/mocks/extensions/");
var extensionLocation = path.join(extensionMockLocation, "demo/commands/test.js");
var extensionContentParsed = "function command(flag, parameters) {\n    console.log(\"Hello world\");\n}\n\nmodule.exports = {\n    exec: command,\n    command: \"test\",\n    native: null, // require('_utils').exec('command');\n    help: 'Description:\\n- Executes Test\\n\\nUsage:\\n- Test',\n};";
var codegen = "function(){\nGame.extensions = AI.extensions = {\ncommands: {\ntest: (function(){\nvar module = {};(function(){\nfunction command(flag, parameters) {\n    console.log(\"Hello world\");\n}\n\nmodule.exports = {\n    exec: command,\n    command: \"test\",\n    native: null, \/\/ require(\'_utils\').exec(\'command\');\n    help: \'Description:\\n- Executes Test\\n\\nUsage:\\n- Test\',\n};\n}());\n\nreturn module.exports;\n}()),\n},\n};\n}";

describe('CodeGen: extensions', function() {
    describe('check', function() {
        it('Should not give warnings if there are no conflicts', function() {
            var errors = [];
            var check = function() {
                return extensionsCodegen.test.check(
                    [
                        {foo: 'bar'},
                        {foobar: 'baz'}
                    ],
                    ['a', 'b']
                );
            };

            assert.deepEqual(generics.bufferConsole(check, errors), []);
            assert.deepEqual(errors, []);
        });<commit_msg>Fix test<commit_after>'use strict';

var assert = require('assert');
var path = require('path');

var _ = require('lodash');

var extensionsCodegen = require('../../../lib/codegen/extensions');
var generics = require('../../../scripts/_generics');

var extensionMockLocation = path.join(__dirname, "../../../lib/mocks/extensions/");
var extensionLocation = path.join(extensionMockLocation, "demo/commands/test.js");
var extensionContentParsed = "function command(flag, parameters) {\n    console.log(\"Hello world\");\n}\n\nmodule.exports = {\n    exec: command,\n    command: \"test\",\n    native: null,\n    help: 'Description:\\n- Executes Test\\n\\nUsage:\\n- Test',\n};";
var codegen = "function(){\nGame.extensions = AI.extensions = {\ncommands: {\ntest: (function(){\nvar module = {};(function(){\nfunction command(flag, parameters) {\n    console.log(\"Hello world\");\n}\n\nmodule.exports = {\n    exec: command,\n    command: \"test\",\n    native: null,\n    help: \'Description:\\n- Executes Test\\n\\nUsage:\\n- Test\',\n};\n}());\n\nreturn module.exports;\n}()),\n},\n};\n}";

describe('CodeGen: extensions', function() {
    describe('check', function() {
        it('Should not give warnings if there are no conflicts', function() {
            var errors = [];
            var check = function() {
                return extensionsCodegen.test.check(
                    [
                        {foo: 'bar'},
                        {foobar: 'baz'}
                    ],
                    ['a', 'b']
                );
            };

            assert.deepEqual(generics.bufferConsole(check, errors), []);
            assert.deepEqual(errors, []);
        });
{'fraction_non_alphanumeric': 0.20260492040520983, 'fraction_numerical': 0.0, 'mean_word_length': 2.4217821782178217, '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': '4645025', 'n_tokens_mistral': 1007, 'n_tokens_neox': 975, 'n_words': 207}