<commit_before>var should = require('should');

var Quadtree = require('../quadtree');

describe('Quadtree Tests', function () {

    it('does stuff', function () {
        var quadtree = new Quadtree({
            dimension: 10,
            sectorObjectLimit: 1
        });
        quadtree.sectorCount.should.equal(0);

        var obj1 = {x: 5, y: 5, width: 1, height: 1};
        quadtree.add(obj1);
        quadtree.objectCount.should.equal(1);

        var obj2 = {x: 5, y: 5, width: 1, height: 1};
        quadtree.add(obj2);
        quadtree.objectCount.should.equal(2);
        quadtree.sectorCount.should.equal(1);

        var intersections = quadtree.check(obj2);
        intersections.length.should.equal(1);
        intersections[0].object.should.equal(obj1);

        var obj3 = {x: -5, y: -5, width: 1, height: 1};
        quadtree.add(obj3);
        quadtree.objectCount.should.equal(3);
        quadtree.sectorCount.should.equal(2);

        var obj4 = {x: 4, y: 4, width: 1, height: 1};
        quadtree.add(obj4);
        quadtree.objectCount.should.equal(4);
        quadtree.sectorCount.should.equal(3);

        quadtree.remove(obj2);
        quadtree.objectCount.should.equal(3);
        quadtree.sectorCount.should.equal(3);
    })

});<commit_msg>check<commit_after>var should = require('should');

var Quadtree = require('../quadtree');

describe('Quadtree Tests', function () {

    it('does stuff', function () {
        var quadtree = new Quadtree({
            dimension: 10,
            sectorObjectLimit: 1
        });
        quadtree.sectorCount.should.equal(0);

        var obj1 = {x: 5, y: 5, width: 1, height: 1};
        quadtree.add(obj1);
        quadtree.objectCount.should.equal(1);

        var obj2 = {x: 5, y: 5, width: 1, height: 1};
        quadtree.add(obj2);
        quadtree.objectCount.should.equal(2);
        quadtree.sectorCount.should.equal(1);

        var intersections = quadtree.check(obj2);
        intersections.length.should.equal(1);
        intersections[0].should.equal(obj1);

        var obj3 = {x: -5, y: -5, width: 1, height: 1};
        quadtree.add(obj3);
        quadtree.objectCount.should.equal(3);
        quadtree.sectorCount.should.equal(2);

        var obj4 = {x: 4, y: 4, width: 1, height: 1};
        quadtree.add(obj4);
        quadtree.objectCount.should.equal(4);
        quadtree.sectorCount.should.equal(3);

        quadtree.remove(obj2);
        quadtree.objectCount.should.equal(3);
        quadtree.sectorCount.should.equal(3);
    })

});
{'fraction_non_alphanumeric': 0.1505333860134334, 'fraction_numerical': 0.03318846305807981, 'mean_word_length': 2.376, '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': '6402955', 'n_tokens_mistral': 879, 'n_tokens_neox': 812, 'n_words': 160}