<commit_before>import { INVALID_DAY, INVALID_MONTH } from '../../Const';
import { Symmetry010Calendar as cal } from '../../calendar/Symmetry010Calendar';

const dates = [
  { jdn: 1507231.5, date: { year: -586, month:  7, day: 21 } },
  { jdn: 1660037.5, date: { year: -168, month: 12, day:  5 } },
  { jdn: 1746893.5, date: { year:   70, month:  9, day: 26 } },
  { jdn: 1770641.5, date: { year:  135, month:  9, day: 30 } },
  { jdn: 1892731.5, date: { year:  470, month:  1, day: 10 } },
  { jdn: 1931579.5, date: { year:  576, month:  5, day: 20 } },
  { jdn: 1974851.5, date: { year:  694, month: 11, day: 11 } },
  { jdn: 2091164.5, date: { year: 1013, month:  4, day: 21 } },
  { jdn: 2121509.5, date: { year: 1096, month:  5, day: 26 } },
  { jdn: 2155779.5, date: { year: 1190, month:  3, day: 21 } },
  { jdn: 2174029.5, date: { year: 1240, month:  3, day:  8 } },
  { jdn: 2191584.5, date: { year: 1288, month:  4, day:  5 } },
  { jdn: 2195261.5, date: { year: 1298, month:  4, day: 28 } },
  { jdn: 2229274.5, date: { year: 1391, month:  6, day:  9 } },
  { jdn: 2245580.5, date: { year: 1436, month:  2, day:  1 } },
  { jdn: 2266100.5, date: { year: 1492, month:  4, day:  6 } },
  { jdn: 2288542.5, date: { year: 1553, month:  9, day: 22 } },
  { jdn: 2290901.5, date: { year: 1560, month:  3, day:  1 } },
  { jdn: 2323140.5, date: { year: 1648, month:  6, day: 12 } },
  { jdn: 2334848.5, date: { year: 1680, month:  6, day: 30 } },
  { jdn: 2348020.5, date: { year: 1716, month:  7, day: 26 } },
  { jdn: 2366978.5, date: { year: 1768, month:  6, day: 16 } },
  { jdn: 2385648.5, date: { year: 1819, month:  7, day: 29 } },
  { jdn: 2392825.5, date: { year: 1839, month:  3, day: 26 } },
  { jdn: 2416223.5, date: { year: 1903, month:  4, day: 14 } },
  { jdn: 2425848.5, date: { year: 1929, month:  8, day: 26 } },
  { jdn: 2430266.5, date: { year: 1941, month: 10, day:  1 } },
  { jdn: 2430833.5, date: { year: 1943, month:  4, day: 15 } },
  { jdn: 2431004.5, date: { year: 1943, month: 10, day:  4 } },
  { jdn: 2448698.5, date: { year: 1992, month:  3, day: 18 } },
  { jdn: 2450138.5, date: { year: 1996, month:  2, day: 26 } },
  { jdn: 2465737.5, date: { year: 2038, month: 11, day:  8 } },
  { jdn: 2486076.5, date: { year: 2094, month:  7, day: 21 } },
];

describe ('Symmetry010 calendar spec', () => {
  it ('should convert a Symmetry010 date to Julian day', () => {
    dates.forEach (({ jdn, date }) => {
      const actual = cal.toJdn (date.year, date.month, date.day);

      expect (actual).toBe (jdn);
    });
  });

  it ('should convert a Julian day to a Symmetry010 date', () => {
    dates.forEach (({ jdn, date }) => {
      const actual   = cal.fromJdn (jdn);
      const yearLeap =  cal.isLeapYear (date.year);
      const expected = { jdn, ...date, yearLeap };

      expect (expected).toEqual (actual);
      expect (expected.year).toBe (actual.getYear());
      expect (expected.month).toBe (actual.getMonth());
      expect (expected.day).toBe (actual.getDay());
      expect (expected.yearLeap).toBe (actual.isYearLeap());
    });
  });

  it ('should determine whether a Symmetry010 year is leap year', () => {<commit_msg>Cleaned up Symmetry010 calendar spec.<commit_after>import { INVALID_DAY, INVALID_MONTH } from '../../Const';
import { Symmetry010Calendar as cal } from '../../calendar/Symmetry010Calendar';

const dates = [
  { jdn: 1507231.5, date: { year: -586, month:  7, day: 21 } },
  { jdn: 1660037.5, date: { year: -168, month: 12, day:  5 } },
  { jdn: 1746893.5, date: { year:   70, month:  9, day: 26 } },
  { jdn: 1770641.5, date: { year:  135, month:  9, day: 30 } },
  { jdn: 1892731.5, date: { year:  470, month:  1, day: 10 } },
  { jdn: 1931579.5, date: { year:  576, month:  5, day: 20 } },
  { jdn: 1974851.5, date: { year:  694, month: 11, day: 11 } },
  { jdn: 2091164.5, date: { year: 1013, month:  4, day: 21 } },
  { jdn: 2121509.5, date: { year: 1096, month:  5, day: 26 } },
  { jdn: 2155779.5, date: { year: 1190, month:  3, day: 21 } },
  { jdn: 2174029.5, date: { year: 1240, month:  3, day:  8 } },
  { jdn: 2191584.5, date: { year: 1288, month:  4, day:  5 } },
  { jdn: 2195261.5, date: { year: 1298, month:  4, day: 28 } },
  { jdn: 2229274.5, date: { year: 1391, month:  6, day:  9 } },
  { jdn: 2245580.5, date: { year: 1436, month:  2, day:  1 } },
  { jdn: 2266100.5, date: { year: 1492, month:  4, day:  6 } },
  { jdn: 2288542.5, date: { year: 1553, month:  9, day: 22 } },
  { jdn: 2290901.5, date: { year: 1560, month:  3, day:  1 } },
  { jdn: 2323140.5, date: { year: 1648, month:  6, day: 12 } },
  { jdn: 2334848.5, date: { year: 1680, month:  6, day: 30 } },
  { jdn: 2348020.5, date: { year: 1716, month:  7, day: 26 } },
  { jdn: 2366978.5, date: { year: 1768, month:  6, day: 16 } },
  { jdn: 2385648.5, date: { year: 1819, month:  7, day: 29 } },
  { jdn: 2392825.5, date: { year: 1839, month:  3, day: 26 } },
  { jdn: 2416223.5, date: { year: 1903, month:  4, day: 14 } },
  { jdn: 2425848.5, date: { year: 1929, month:  8, day: 26 } },
  { jdn: 2430266.5, date: { year: 1941, month: 10, day:  1 } },
  { jdn: 2430833.5, date: { year: 1943, month:  4, day: 15 } },
  { jdn: 2431004.5, date: { year: 1943, month: 10, day:  4 } },
  { jdn: 2448698.5, date: { year: 1992, month:  3, day: 18 } },
  { jdn: 2450138.5, date: { year: 1996, month:  2, day: 26 } },
  { jdn: 2465737.5, date: { year: 2038, month: 11, day:  8 } },
  { jdn: 2486076.5, date: { year: 2094, month:  7, day: 21 } },
];

describe ('Symmetry010 calendar spec', () => {
  it ('should convert a Symmetry010 date to Julian day', () => {
    dates.forEach (({ jdn, date }) => {
      const actual = cal.toJdn (date.year, date.month, date.day);

      expect (actual).toBe (jdn);
    });
  });

  it ('should convert a Julian day to a Symmetry010 date', () => {
    dates.forEach (({ jdn, date }) => {
      const actual   = cal.fromJdn (jdn);
      const yearLeap = cal.isLeapYear (date.year);
      const expected = { jdn, ...date, yearLeap };

      expect (expected).toEqual (actual);
      expect (expected.year).toBe (actual.getYear());
      expect (expected.month).toBe (actual.getMonth());
      expect (expected.day).toBe (actual.getDay());
      expect (expected.yearLeap).toBe (actual.isYearLeap());
    });
  });

  it ('should determine whether a Symmetry010 year is leap year', () => {
{'fraction_non_alphanumeric': 0.2027005809389229, 'fraction_numerical': 0.15748155126393468, 'mean_word_length': 2.8120885697187314, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '1672883', 'n_tokens_mistral': 3295, 'n_tokens_neox': 2622, 'n_words': 776}