<commit_before>/* global describe it: true */

'use strict';

const cal = require ('../../lib/calendar/MayanHaabCalendar.js').MayanHaabCalendar;
const Const = require ('../../lib/Const.js');

const chai = require ('chai');
require ('dirty-chai');
require ('mocha');

const expect = chai.expect;

const data2 = [
  { 'rataDie': -214193, 'mayanHaab': { 'month': 11, 'day': 12 } },
  { 'rataDie':  -61387, 'mayanHaab': { 'month':  5, 'day':  3 } },
  { 'rataDie':   25469, 'mayanHaab': { 'month':  4, 'day':  9 } },
  { 'rataDie':   49217, 'mayanHaab': { 'month':  5, 'day': 12 } },
  { 'rataDie':  171307, 'mayanHaab': { 'month': 14, 'day': 12 } },
  { 'rataDie':  210155, 'mayanHaab': { 'month':  4, 'day':  5 } },
  { 'rataDie':  253427, 'mayanHaab': { 'month': 14, 'day':  7 } },
  { 'rataDie':  369740, 'mayanHaab': { 'month':  8, 'day':  5 } },
  { 'rataDie':  400085, 'mayanHaab': { 'month': 10, 'day': 15 } },
  { 'rataDie':  434355, 'mayanHaab': { 'month':  8, 'day': 15 } },
  { 'rataDie':  452605, 'mayanHaab': { 'month':  8, 'day': 15 } },
  { 'rataDie':  470160, 'mayanHaab': { 'month': 10, 'day': 10 } },
  { 'rataDie':  473837, 'mayanHaab': { 'month': 11, 'day': 17 } },
  { 'rataDie':  507850, 'mayanHaab': { 'month': 15, 'day':  5 } },
  { 'rataDie':  524156, 'mayanHaab': { 'month':  9, 'day':  6 } },
  { 'rataDie':  544676, 'mayanHaab': { 'month': 13, 'day':  6 } },
  { 'rataDie':  567118, 'mayanHaab': { 'month':  3, 'day': 18 } },
  { 'rataDie':  569477, 'mayanHaab': { 'month': 12, 'day':  7 } },
  { 'rataDie':  601716, 'mayanHaab': { 'month': 18, 'day':  6 } },
  { 'rataDie':  613424, 'mayanHaab': { 'month':  1, 'day':  9 } },
  { 'rataDie':  626596, 'mayanHaab': { 'month':  3, 'day':  1 } },
  { 'rataDie':  645554, 'mayanHaab': { 'month':  1, 'day': 19 } },
  { 'rataDie':  664224, 'mayanHaab': { 'month':  4, 'day': 14 } },
  { 'rataDie':  671401, 'mayanHaab': { 'month': 16, 'day': 16 } },
  { 'rataDie':  694799, 'mayanHaab': { 'month': 18, 'day': 14 } },
  { 'rataDie':  704424, 'mayanHaab': { 'month':  7, 'day':  4 } },
  { 'rataDie':  708842, 'mayanHaab': { 'month':  9, 'day':  2 } },
  { 'rataDie':  709409, 'mayanHaab': { 'month': 19, 'day':  4 } },
  { 'rataDie':  709580, 'mayanHaab': { 'month':  9, 'day': 10 } },
  { 'rataDie':  727274, 'mayanHaab': { 'month': 18, 'day':  4 } },
  { 'rataDie':  728714, 'mayanHaab': { 'month': 17, 'day':  4 } },
  { 'rataDie':  744313, 'mayanHaab': { 'month': 12, 'day':  8 } },
  { 'rataDie':  764652, 'mayanHaab': { 'month':  7, 'day':  7 } }
];

describe ('Mayan Haab calendar spec', () => {
  let date, julian, expected, actual;

  it ('should convert a Julian day to a Mayan Haab', () => {
    data2.forEach ((data) => {
      julian   = data.rataDie + Const.J0000;
      date     = data.mayanHaab;
      expected = { month: date.month, day: date.day };
      actual   = cal.fromJdn (julian);

      // expect (expected).to.be.eql (actual);
      expect (expected.month).to.be.equal (actual.month);
      expect (expected.day).to.be.equal (actual.day);
    });
  });
});
<commit_msg>Improve spec tests.<commit_after>/* global describe it: true */

'use strict';

const cal = require ('../../lib/calendar/MayanHaabCalendar.js').MayanHaabCalendar;
const Const = require ('../../lib/Const.js');

const chai = require ('chai');
require ('dirty-chai');
require ('mocha');

const expect = chai.expect;

const data2 = [
  { 'rataDie': -214193, 'mayanHaab': { 'month': 11, 'day': 12 } },
  { 'rataDie':  -61387, 'mayanHaab': { 'month':  5, 'day':  3 } },
  { 'rataDie':   25469, 'mayanHaab': { 'month':  4, 'day':  9 } },
  { 'rataDie':   49217, 'mayanHaab': { 'month':  5, 'day': 12 } },
  { 'rataDie':  171307, 'mayanHaab': { 'month': 14, 'day': 12 } },
  { 'rataDie':  210155, 'mayanHaab': { 'month':  4, 'day':  5 } },
  { 'rataDie':  253427, 'mayanHaab': { 'month': 14, 'day':  7 } },
  { 'rataDie':  369740, 'mayanHaab': { 'month':  8, 'day':  5 } },
  { 'rataDie':  400085, 'mayanHaab': { 'month': 10, 'day': 15 } },
  { 'rataDie':  434355, 'mayanHaab': { 'month':  8, 'day': 15 } },
  { 'rataDie':  452605, 'mayanHaab': { 'month':  8, 'day': 15 } },
  { 'rataDie':  470160, 'mayanHaab': { 'month': 10, 'day': 10 } },
  { 'rataDie':  473837, 'mayanHaab': { 'month': 11, 'day': 17 } },
  { 'rataDie':  507850, 'mayanHaab': { 'month': 15, 'day':  5 } },
  { 'rataDie':  524156, 'mayanHaab': { 'month':  9, 'day':  6 } },
  { 'rataDie':  544676, 'mayanHaab': { 'month': 13, 'day':  6 } },
  { 'rataDie':  567118, 'mayanHaab': { 'month':  3, 'day': 18 } },
  { 'rataDie':  569477, 'mayanHaab': { 'month': 12, 'day':  7 } },
  { 'rataDie':  601716, 'mayanHaab': { 'month': 18, 'day':  6 } },
  { 'rataDie':  613424, 'mayanHaab': { 'month':  1, 'day':  9 } },
  { 'rataDie':  626596, 'mayanHaab': { 'month':  3, 'day':  1 } },
  { 'rataDie':  645554, 'mayanHaab': { 'month':  1, 'day': 19 } },
  { 'rataDie':  664224, 'mayanHaab': { 'month':  4, 'day': 14 } },
  { 'rataDie':  671401, 'mayanHaab': { 'month': 16, 'day': 16 } },
  { 'rataDie':  694799, 'mayanHaab': { 'month': 18, 'day': 14 } },
  { 'rataDie':  704424, 'mayanHaab': { 'month':  7, 'day':  4 } },
  { 'rataDie':  708842, 'mayanHaab': { 'month':  9, 'day':  2 } },
  { 'rataDie':  709409, 'mayanHaab': { 'month': 19, 'day':  4 } },
  { 'rataDie':  709580, 'mayanHaab': { 'month':  9, 'day': 10 } },
  { 'rataDie':  727274, 'mayanHaab': { 'month': 18, 'day':  4 } },
  { 'rataDie':  728714, 'mayanHaab': { 'month': 17, 'day':  4 } },
  { 'rataDie':  744313, 'mayanHaab': { 'month': 12, 'day':  8 } },
  { 'rataDie':  764652, 'mayanHaab': { 'month':  7, 'day':  7 } }
];

describe ('Mayan Haab calendar spec', () => {
  it ('should convert a Julian day to a Mayan Haab', () => {
    data2.forEach (dt => {
      const julian   = dt.rataDie + Const.J0000;
      const date     = dt.mayanHaab;
      const expected = { 'jdn': julian, 'month': date.month, 'day': date.day };
      const actual   = cal.fromJdn (julian);

      expect (expected).to.be.eql (actual);
      // expect (expected.month).to.be.equal (actual.month);
      // expect (expected.day).to.be.equal (actual.day);
    });
  });
});

{'fraction_non_alphanumeric': 0.2560717196414018, 'fraction_numerical': 0.09682151589242054, 'mean_word_length': 3.2700069589422407, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3496212', 'n_tokens_mistral': 3015, 'n_tokens_neox': 2663, 'n_words': 609}