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

var prettierBytes = require('../')

var testData = [
  [2335, '2.3 KB'],
  [23552, '23 KB'],
  [235520, '235 KB'],
  [2355520, '2.4 MB'],
  [23555520, '23 MB'],
  [235555520, '235 MB'],
  [2355555520, '2.4 GB'],
  [23555555520, '23 GB'],
  [235556555520, '235 GB'],
  [2355556655520, '2.4 TB'],
  [23555566655520, '23 TB'],
  [235555566665520, '235 TB']
]

test('pretty bytes', function (t) {
  testData.forEach(function (data) {
    t.equals(prettierBytes(data[0]), data[1], 'bytes: ' + data[0] + ' -> ' + data[1])
  })

  t.end()
})

test('throws on non-number', function (t) {
  t.throws(function () {
    prettierBytes('this is a string')
  })
  t.end()<commit_msg>add failing B tests<commit_after>var test = require('tape')

var prettierBytes = require('../')

var testData = [
  [2, '2 B'],
  [25, '25 B'],
  [235, '235 B'],
  [2335, '2.3 KB'],
  [23552, '23 KB'],
  [235520, '235 KB'],
  [2355520, '2.4 MB'],
  [23555520, '23 MB'],
  [235555520, '235 MB'],
  [2355555520, '2.4 GB'],
  [23555555520, '23 GB'],
  [235556555520, '235 GB'],
  [2355556655520, '2.4 TB'],
  [23555566655520, '23 TB'],
  [235555566665520, '235 TB']
]

test('pretty bytes', function (t) {
  testData.forEach(function (data) {
    t.equals(prettierBytes(data[0]), data[1], 'bytes: ' + data[0] + ' -> ' + data[1])
  })

  t.end()
})

test('throws on non-number', function (t) {
  t.throws(function () {
    prettierBytes('this is a string')
  })
  t.end()
{'fraction_non_alphanumeric': 0.22868741542625168, 'fraction_numerical': 0.20568335588633288, 'mean_word_length': 3.665615141955836, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '5953081', 'n_tokens_mistral': 821, 'n_tokens_neox': 638, 'n_words': 145}