<commit_before>const chai = require('chai');
const assert = chai.assert;

const Bullet = require("../source/scripts/bullet");
const SpaceShip = require('../source/scripts/spaceship');

describe('Spaceship', function() {
  context('with default attributes', function() {
    var ship = new SpaceShip(350, 300, context);

    it('should have a point', function(){
      assert.equal(ship.point.x, 350);
      assert.equal(ship.point.y, 300);
    });

    it('should have rightSide', function(){
      assert.equal(ship.rightSide.x, 356.0905443508238);
      assert.equal(ship.rightSide.y, 319.6952814085163);
    });

    it('should have leftSide', function(){
      assert.equal(ship.leftSide.x, 343.90595075820596);
      assert.equal(ship.leftSide.y, 319.69419721868826);
    });

    it('should have no speed', function(){
      assert.equal(ship.speed, 0);
    });

    it('should be oriented vertically', function(){
      assert.equal(ship.orientation, 4.7123);
    });

    it('calculates slope', function(){
      ship.calculateSlope();
      assert.equal(ship.slope.x, 0.0010677646148451458);
      assert.equal(ship.slope.y, -11.999999952494932);
    });

    it('accelerates properly', function(){
      ship.speed = 1;
      ship.accelerate();
      assert.equal(ship.point.x, 350.0001779607691);
      assert.equal(ship.point.y, 298.0000000079175);
    });

    it('decelerates properly', function(){
      ship.speed = 1;
      ship.decelerate();
      assert.equal(ship.speed, 0.985);
    });

    it('stops decelerating at 0', function(){
      ship.speed = 0;
      ship.decelerate();
      assert.equal(ship.speed, 0);
    });

    it('fires bullets', function(){
      assert.equal(ship.fireBullet().constructor, Bullet);
    });

    it('checks checks position when exiting screen', function(){
      ship.hidden = false;
      ship.point.y = -30;
      ship.checkPosition();
      assert.equal(ship.point.y, 529);

      ship.point.y = 560;
      ship.checkPosition();<commit_msg>Fix test<commit_after>const chai = require('chai');
const assert = chai.assert;

const Bullet = require("../source/scripts/bullet");
const SpaceShip = require('../source/scripts/spaceship');

describe('Spaceship', function() {
  context('with default attributes', function() {
    var ship = new SpaceShip(350, 300, context);

    it('should have a point', function(){
      assert.equal(ship.point.x, 350);
      assert.equal(ship.point.y, 300);
    });

    it('should have rightSide', function(){
      assert.equal(ship.rightSide.x, 356.0905443508238);
      assert.equal(ship.rightSide.y, 319.6952814085163);
    });

    it('should have leftSide', function(){
      assert.equal(ship.leftSide.x, 343.90595075820596);
      assert.equal(ship.leftSide.y, 319.69419721868826);
    });

    it('should have no speed', function(){
      assert.equal(ship.speed, 0);
    });

    it('should be oriented vertically', function(){
      assert.equal(ship.orientation, 4.7123);
    });

    it('calculates slope', function(){
      ship.calculateSlope();
      assert.equal(ship.slope.x, 0.0010677646148451458);
      assert.equal(ship.slope.y, -11.999999952494932);
    });

    it('accelerates properly', function(){
      ship.speed = 1;
      ship.accelerate();
      assert.equal(ship.point.x, 350.0001779607691);
      assert.equal(ship.point.y, 298.0000000079175);
    });

    it('decelerates properly', function(){
      ship.speed = 1;
      ship.decelerate();
      assert.equal(ship.speed, 0.985);
    });

    it('stops decelerating at 0', function(){
      ship.speed = 0;
      ship.decelerate();
      assert.equal(ship.speed, 0);
    });

    it('fires bullets', function(){
      assert.equal(ship.fireBullet()[0].constructor, Bullet);
    });

    it('checks checks position when exiting screen', function(){
      ship.hidden = false;
      ship.point.y = -30;
      ship.checkPosition();
      assert.equal(ship.point.y, 529);

      ship.point.y = 560;
      ship.checkPosition();
{'fraction_non_alphanumeric': 0.16408204102051024, 'fraction_numerical': 0.08529264632316158, 'mean_word_length': 3.023138832997988, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '7104392', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1263, 'n_words': 242}