<commit_before>var test = require('tape')

  , common = require('./common')
  , runTest = common.runGetTest

test('get() none existing', function (t) {
  runTest('empty', [], function (err, revisions) {
    t.deepEqual(revisions, [])
    t.end(err)
  })
})

test('get() one revision', function (t) {
  var inputs = [ { body: 'Hello, world', date: new Date(0) } ]

  runTest('one-revision', inputs, function (err, revisions) {
    t.deepEqual(revisions, inputs)
    t.end(err)
  })
})

test('get() multiple compatible revisions', function (t) {
  var inputs = [
          { body: 'Hello', date: new Date(0) }
        , { body: 'Hello, world', date: new Date(1000) }
        , { body: 'Hello, world!', date: new Date(2000) }
      ]

  runTest('multiple-compatible', inputs, function (err, revisions) {
    t.deepEqual(revisions, [ inputs[2] ])
    t.end(err)
  })
})

test('get() more complex, but compatible revisions', function (t) {
  var inputs = [
          { body: 'Hello', date: new Date(0) }
        , { body: 'world!', date: new Date(1000) }
        , { body: 'Hello, world!', date: new Date(2000)}
      ]

  runTest('multiple-compatible-complex', inputs, function (err, revisions) {
    t.deepEqual(revisions, [ inputs[2] ])
    t.end(err)
  })
})

test('get() removing', function (t) {
  var inputs = [
          { body: 'Hello, world!', date: new Date(0) }
        , { body: 'Hello', date: new Date(1000) }
      ]

  runTest('removing', inputs, function (err, revisions) {
    t.deepEqual(revisions, inputs)
    t.end(err)
  })
})

test('get() multiple deletes', function (t) {
  var inputs = [
          { body: 'Hello, world!', date: new Date(0) }
        , { body: 'Hello, world', date: new Date(1000) }
        , { body: 'Hello', date: new Date(2000) }
      ]

  runTest('multiple-deletes', inputs, function (err, revisions) {
    t.deepEqual(revisions, [ inputs[0], inputs[2] ])
    t.end(err)
  })
})

test('get() deletes & inserts', function (t) {
  var inputs = [
          { body: 'beep boop', date: new Date(0)}
        , { body: 'Hello, world!', date: new Date(1000) }
        , { body: 'Hello, world', date: new Date(2000) }
        , { body: 'Hello', date: new Date(3000) }
        , { body: 'Hello2', date: new Date(4000)}
      ]

  runTest('deletes-inserts', inputs, function (err, revisions) {
    t.deepEqual(revisions, [ inputs[0], inputs[1], inputs[4] ])
    t.end(err)
  })
})

test('get() multiple ends with remove', function (t) {
  var inputs = [
          { body: 'Hello', date: new Date(0) }
        , { body: 'Foo', date: new Date(1000) }
        , { body: '', date: new Date(2000) }
      ]

  runTest('end-with-remove', inputs, function (err, revisions) {
    t.deepEqual(revisions, inputs)
    t.end(err)
  })
})

test('get() unchanged', function (t) {
  var inputs = [
          { body: 'Hello', date: new Date(0) }
        , { body: 'Hello', date: new Date(1000) }
      ]

  runTest('unchanged', inputs, function (err, revisions) {
    t.deepEqual(revisions, [ inputs[1] ])
    t.end(err)
  })
})

test('get() string date', function (t) {
  var inputs = [ { body: 'Hello', date: (new Date(0)).toJSON() } ]
<commit_msg>remove tests that now exists in significant-stream<commit_after>var test = require('tape')

  , common = require('./common')
  , runTest = common.runGetTest

test('get() empty', function (t) {
  runTest('empty', [], function (err, revisions) {
    t.deepEqual(revisions, [])
    t.end(err)
  })
})

test('get() one revision', function (t) {
  var inputs = [ { body: 'Hello, world', date: new Date(0) } ]

  runTest('one-revision', inputs, function (err, revisions) {
    t.deepEqual(revisions, inputs)
    t.end(err)
  })
})

test('get() string date', function (t) {
  var inputs = [ { body: 'Hello', date: (new Date(0)).toJSON() } ]

{'fraction_non_alphanumeric': 0.19005001316135825, 'fraction_numerical': 0.020005264543300868, 'mean_word_length': 3.0042149631190727, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4179312', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1312, 'n_words': 332}