<commit_before>import test from 'ava';
import { parse } from '../src';

test('parses a full ISO-8601 string in UTC', t => {
  t.is(
    parse('2019-08-16T22:55:00Z').toISOString(),
    new Date(Date.UTC(2019, 7, 16, 22, 55, 0, 0)).toISOString(),
  );
});

test('parses a full ISO-8601 string with offset', t => {
  t.is(
    parse('2019-08-16T22:55:00-0700').toISOString(),
    new Date(2019, 7, 16, 22, 55, 0, 0).toISOString(),
  );
});

test('parses a full ISO-8601 string with offset with colon (:)', t => {
  t.is(
    parse('2019-08-16T22:55:00-07:00').toISOString(),
    new Date(2019, 7, 16, 22, 55, 0, 0).toISOString(),
  );
});

test('parses a full ISO-8601 string with no timezone', t => {
  t.is(
    parse('2019-08-16T22:55:00').toISOString(),
    new Date(2019, 7, 16, 22, 55, 0, 0).toISOString(),
  );
});

test('parses an ISO-8601 string with milliseconds', t => {
  t.is(
    parse('2019-10-23T05:28:41.506245').toISOString(),
    new Date(2019, 9, 23, 5, 28, 41, 506).toISOString(),
  );
});

test('parses a partial ISO-8601', t => {
  t.is(parse('2019-08-16').toISOString(), new Date(2019, 7, 16, 0, 0, 0, 0).toISOString());
});<commit_msg>add rounding up test for parse<commit_after>import test from 'ava';
import { parse } from '../src';

test('parses a full ISO-8601 string in UTC', t => {
  t.is(
    parse('2019-08-16T22:55:00Z').toISOString(),
    new Date(Date.UTC(2019, 7, 16, 22, 55, 0, 0)).toISOString(),
  );
});

test('parses a full ISO-8601 string with offset', t => {
  t.is(
    parse('2019-08-16T22:55:00-0700').toISOString(),
    new Date(2019, 7, 16, 22, 55, 0, 0).toISOString(),
  );
});

test('parses a full ISO-8601 string with offset with colon (:)', t => {
  t.is(
    parse('2019-08-16T22:55:00-07:00').toISOString(),
    new Date(2019, 7, 16, 22, 55, 0, 0).toISOString(),
  );
});

test('parses a full ISO-8601 string with no timezone', t => {
  t.is(
    parse('2019-08-16T22:55:00').toISOString(),
    new Date(2019, 7, 16, 22, 55, 0, 0).toISOString(),
  );
});

test('parses an ISO-8601 string with milliseconds', t => {
  t.is(
    parse('2019-10-23T05:28:41.506245').toISOString(),
    new Date(2019, 9, 23, 5, 28, 41, 506).toISOString(),
  );
});

test('parses an ISO-8601 string with milliseconds (rounding up)', t => {
  t.is(
    parse('2019-10-23T05:28:41.506789').toISOString(),
    new Date(2019, 9, 23, 5, 28, 41, 507).toISOString(),
  );
});

test('parses a partial ISO-8601', t => {
  t.is(parse('2019-08-16').toISOString(), new Date(2019, 7, 16, 0, 0, 0, 0).toISOString());
});
{'fraction_non_alphanumeric': 0.21766561514195584, 'fraction_numerical': 0.16837539432176657, 'mean_word_length': 3.6211293260473587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '3349222', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1014, 'n_words': 252}