<commit_before>

/*
 sometimes jsonparse changes numbers slightly.
*/

var r = Math.random()
  , Parser = require('jsonparse')
  , p = new Parser()
  , assert = require('assert')  
  , times = 20
while (times --) {

  assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON')

  p.onValue = function (v) {
    console.error('parsed', v)
    assert.equal(v, r)
  }
  console.error('correct', r)
  p.write (new Buffer(JSON.stringify([r])))



}<commit_msg>ignore trailing floating point rounding errors<commit_after>

/*
 sometimes jsonparse changes numbers slightly.
*/

var r = Math.random()
  , Parser = require('jsonparse')
  , p = new Parser()
  , assert = require('assert')  
  , times = 20
while (times --) {

  assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON')

  p.onValue = function (v) {
    console.error('parsed', v)
    assert.equal(
      String(v).slice(0,12),
      String(r).slice(0,12)
    )
  }
  console.error('correct', r)
  p.write (new Buffer(JSON.stringify([r])))



}
{'fraction_non_alphanumeric': 0.17347956131605186, 'fraction_numerical': 0.009970089730807577, 'mean_word_length': 3.3275862068965516, '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': '7084744', 'n_tokens_mistral': 362, 'n_tokens_neox': 347, 'n_words': 78}