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

const relativeCoords = require('../lib/relative-coords');

describe("relativeCoords", function() {
  function arraysAreEqual(a, b) {
    for(var i = 0; i < a.length; i++){
      if(a[i] !== b[i]) return false;
    }
    return true;
  }

  it("knows left coords for coords", function() {
    var x = 1, y = 1;

    var result = relativeCoords.left([x, y]);
    assert(arraysAreEqual(result, [x - 1, y]));
  });

  it("knows right coords for coords", function() {
    var x = 1, y = 1;

    var result = relativeCoords.right([x, y]);
    assert(arraysAreEqual(result, [x + 1, y]));
  });

  it("knows coords below given coords", function() {
    var x = 2, y = 0;

    var result = relativeCoords.below([x, y]);
    assert(arraysAreEqual(result, [x, y + 1]));
  });

  it("knows coords above given coords", function() {
    var x = 1, y = 1;

    var result = relativeCoords.above([x, y]);
    assert(arraysAreEqual(result, [x, y - 1]));
  });
});<commit_msg>Repoint references to arraysAreEqual to utils<commit_after>const chai = require('chai');
const assert = chai.assert;

const relativeCoords = require('../lib/relative-coords');
const utils = require('../lib/utils');

describe("relativeCoords", function() {

  it("knows left coords for coords", function() {
    var x = 1, y = 1;

    var result = relativeCoords.left([x, y]);
    assert(utils.arraysAreEqual(result, [x - 1, y]));
  });

  it("knows right coords for coords", function() {
    var x = 1, y = 1;

    var result = relativeCoords.right([x, y]);
    assert(utils.arraysAreEqual(result, [x + 1, y]));
  });

  it("knows coords below given coords", function() {
    var x = 2, y = 0;

    var result = relativeCoords.below([x, y]);
    assert(utils.arraysAreEqual(result, [x, y + 1]));
  });

  it("knows coords above given coords", function() {
    var x = 1, y = 1;

    var result = relativeCoords.above([x, y]);
    assert(utils.arraysAreEqual(result, [x, y - 1]));
  });
});
{'fraction_non_alphanumeric': 0.17961405244928252, 'fraction_numerical': 0.012370113805047007, 'mean_word_length': 3.3577586206896552, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1657242', 'n_tokens_mistral': 747, 'n_tokens_neox': 693, 'n_words': 197}