<commit_before>
import {expect} from 'chai';

// import RG from '../../../client/src/rg';
// import {Fov3D} from '../../../client/src/fov3d';
import {SentientActor} from '../../../client/src/actor';
import {FactoryLevel} from '../../../client/src/factory.level';
// import {ELEM} from '../../../client/data/elem-constants';

describe('Fov3D', () => {

    it('it computes 3D FOV', () => {
        const factLevel = new FactoryLevel();
        const level = factLevel.createLevel('arena', 10, 10);
        const map = level.getMap();
        const actor = new SentientActor('actor');
        level.addActor(actor, 5, 5);
        actor.setFOVRange(1);

        let cells = map.getCellsInFOV(actor);
        console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(9);

        const cells2 = map.getCellsInFOV(actor);
        // console.log('Seen cells2 are:', cells2.map(c => c.getXY()));
        expect(cells2).to.have.length(cells.length);

        level.moveActorTo(actor, 1, 1);
        cells = map.getCellsInFOV(actor);
        // console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(9);

        actor.setFOVRange(2);
        level.moveActorTo(actor, 2, 2);
        cells = map.getCellsInFOV(actor);
        // console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(25);

        actor.setFOVRange(3);
        level.moveActorTo(actor, 3, 3);
        cells = map.getCellsInFOV(actor);
        cells = cells.sort((a, b) => a.getX() < b.getX() ? -1 : 1);
        console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(45);

        actor.setFOVRange(4);
        level.moveActorTo(actor, 4, 4);
        cells = map.getCellsInFOV(actor);
        expect(cells).to.have.length(69);

    });

});
<commit_msg>timeout removed<commit_after>
import {expect} from 'chai';

// import RG from '../../../client/src/rg';
// import {Fov3D} from '../../../client/src/fov3d';
import {SentientActor} from '../../../client/src/actor';
import {FactoryLevel} from '../../../client/src/factory.level';
// import {Random} from '../../../client/src/random';
// import {ELEM} from '../../../client/data/elem-constants';

describe('Fov3D', function() {
    // this.timeout(5000);

    it('it computes 3D FOV', () => {
        const factLevel = new FactoryLevel();
        const level = factLevel.createLevel('arena', 10, 10);
        const map = level.getMap();
        const actor = new SentientActor('actor');
        level.addActor(actor, 5, 5);
        actor.setFOVRange(1);

        let cells = map.getCellsInFOV(actor);
        console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(9);

        // return;

        const cells2 = map.getCellsInFOV(actor);
        // console.log('Seen cells2 are:', cells2.map(c => c.getXY()));
        expect(cells2).to.have.length(cells.length);

        level.moveActorTo(actor, 1, 1);
        cells = map.getCellsInFOV(actor);
        // console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(9);

        actor.setFOVRange(2);
        level.moveActorTo(actor, 2, 2);
        cells = map.getCellsInFOV(actor);
        // console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(25);

        actor.setFOVRange(3);
        level.moveActorTo(actor, 3, 3);
        cells = map.getCellsInFOV(actor);
        cells = cells.sort((a, b) => a.getX() < b.getX() ? -1 : 1);
        console.log('Seen cells are:', cells.map(c => c.getXY()));
        expect(cells).to.have.length(45);

        actor.setFOVRange(4);
        level.moveActorTo(actor, 4, 4);
        cells = map.getCellsInFOV(actor);
        expect(cells).to.have.length(69);

    });



});

{'fraction_non_alphanumeric': 0.20025974025974025, 'fraction_numerical': 0.019740259740259742, 'mean_word_length': 2.417036379769299, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '4914642', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1291, 'n_words': 242}