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

var svi = require('./')

function encodeDecode (t, v, bytes) {
  var b = svi.encode(v)
  t.equal(b.length, bytes)
  t.equal(svi.decode(b), v)
  t.equal(svi.encode.bytesWritten, bytes)
  t.equal(svi.decode.bytesRead, bytes)
}

tape('single byte', function (t) {
  encodeDecode(t, 1, 1)
  encodeDecode(t, -1, 1)
  encodeDecode(t, 63, 1)
  encodeDecode(t, -64, 1)
  t.end()
})
tape('double byte', function (t) {
  encodeDecode(t, 64, 2)
  encodeDecode(t, -65, 2)
  encodeDecode(t, 127, 2)
  encodeDecode(t, -128, 2)
  encodeDecode(t, 128, 2)
  encodeDecode(t, -129, 2)
  encodeDecode(t, 255, 2)<commit_msg>fix tests<commit_after>var tape = require('tape')

var svi = require('./')

function encodeDecode (t, v, bytes) {
  var b = svi.encode(v)
  t.equal(b.length, bytes)
  t.equal(svi.decode(b), v)
  t.equal(svi.encode.bytes, bytes)
  t.equal(svi.decode.bytes, bytes)
}

tape('single byte', function (t) {
  encodeDecode(t, 1, 1)
  encodeDecode(t, -1, 1)
  encodeDecode(t, 63, 1)
  encodeDecode(t, -64, 1)
  t.end()
})
tape('double byte', function (t) {
  encodeDecode(t, 64, 2)
  encodeDecode(t, -65, 2)
  encodeDecode(t, 127, 2)
  encodeDecode(t, -128, 2)
  encodeDecode(t, 128, 2)
  encodeDecode(t, -129, 2)
  encodeDecode(t, 255, 2)
{'fraction_non_alphanumeric': 0.18324197337509787, 'fraction_numerical': 0.056382145653876274, 'mean_word_length': 3.9921875, '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': '5535120', 'n_tokens_mistral': 603, 'n_tokens_neox': 538, 'n_words': 128}