<commit_before>var self = typeof window !== "undefined" ? window : global;

if (typeof require !== "undefined") {
    var sinon = require("sinon");
    var expect = require("expect.js");
    require("../node_modules/regenerator/runtime.js");

    var Debugger = require("../build/debugger.js");
    var getFunctionBody = require("./test_utils.js").getFunctionBody;
}

/*global describe, it, beforeEach, afterEach */

[false, true].forEach(function (nativeGenerators) {
    var title = nativeGenerators ?
        "Debugger (Native Generators)" :
        "Debugger (Regenerator Generators)";

    var fill, rect, print, image;

    describe(title, function () {

        var _debugger, context;

        beforeEach(function () {
            fill = sinon.stub();
            rect = sinon.stub();
            print = sinon.stub();
            image = sinon.stub();

            context = {
                fill: fill,
                rect: rect,
                x: 0,
                y: 0,
                p: null,
                numbers: [],
                print: print,
                Vector: function (x,y) {
                    this.x = x;
                    this.y = y;
                },
                image: image
            };

            _debugger = new Debugger({
                nativeGenerators: nativeGenerators,
                debug: true
            });
            _debugger.context = context;
        });

        describe("start", function () {
            beforeEach(function () {
                _debugger.load("fill(255,0,0);x=5;console.log('hello');_test_global='apple';var z=23;");
                sinon.stub(console, "log");
                self._test_global = "";
            });

            afterEach(function () {
                console.log.restore();
                delete self._test_global;
            });

            it("should call functions in the context", function () {
                _debugger.start();
                expect(context.fill.calledWith(255,0,0)).to.be(true);
            });

            it("should run again", function () {
                _debugger.start();
                _debugger.start();
                expect(context.fill.callCount).to.be(2);
            });

            it.only("should set variables in the context", function () {
                _debugger.start();
                expect(context.x).to.equal(5);
            });

            it("should call global functions", function () {
                _debugger.start();
                expect(console.log.calledWith("hello")).to.be(true);
            });<commit_msg>enable all tests and disable debug messages<commit_after>var self = typeof window !== "undefined" ? window : global;

if (typeof require !== "undefined") {
    var sinon = require("sinon");
    var expect = require("expect.js");
    require("../node_modules/regenerator/runtime.js");

    var Debugger = require("../build/debugger.js");
    var getFunctionBody = require("./test_utils.js").getFunctionBody;
}

/*global describe, it, beforeEach, afterEach */

[false, true].forEach(function (nativeGenerators) {
    var title = nativeGenerators ?
        "Debugger (Native Generators)" :
        "Debugger (Regenerator Generators)";

    var fill, rect, print, image;

    describe(title, function () {

        var _debugger, context;

        beforeEach(function () {
            fill = sinon.stub();
            rect = sinon.stub();
            print = sinon.stub();
            image = sinon.stub();

            context = {
                fill: fill,
                rect: rect,
                x: 0,
                y: 0,
                p: null,
                numbers: [],
                print: print,
                Vector: function (x,y) {
                    this.x = x;
                    this.y = y;
                },
                image: image
            };

            _debugger = new Debugger({
                nativeGenerators: nativeGenerators,
                debug: false
            });
            _debugger.context = context;
        });

        describe("start", function () {
            beforeEach(function () {
                _debugger.load("fill(255,0,0);x=5;console.log('hello');_test_global='apple';var z=23;");
                sinon.stub(console, "log");
                self._test_global = "";
            });

            afterEach(function () {
                console.log.restore();
                delete self._test_global;
            });

            it("should call functions in the context", function () {
                _debugger.start();
                expect(context.fill.calledWith(255,0,0)).to.be(true);
            });

            it("should run again", function () {
                _debugger.start();
                _debugger.start();
                expect(context.fill.callCount).to.be(2);
            });

            it("should set variables in the context", function () {
                _debugger.start();
                expect(context.x).to.equal(5);
            });

            it("should call global functions", function () {
                _debugger.start();
                expect(console.log.calledWith("hello")).to.be(true);
            });
{'fraction_non_alphanumeric': 0.13257866462010745, 'fraction_numerical': 0.006523407521105142, 'mean_word_length': 1.4729601518026565, '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': '3789229', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1328, 'n_words': 278}