<commit_before>fs = require 'fs'
path = require 'path'
expect = require 'expect.js'
isUtf8 = require '..'

describe 'Empty buffer', ->
  it 'is valid', ->
    expect isUtf8.isValidUTF8 new Buffer 0
    .to.be.ok()

describe 'ASCII', ->
  it 'is valid', ->
    for i in [0..0x7F]
      expect isUtf8.isValidUTF8 new Buffer [i]
      .to.be.ok()

    expect isUtf8.isValidUTF8 new Buffer [0x7F..0]
    .to.be.ok()

describe 'Cyrillic', ->
  it 'is valid', ->

    expect isUtf8.isValidUTF8 new Buffer 'Однажды в студёную зимнюю пору'
    .to.be.ok()<commit_msg>Test UTF-8 files<commit_after>fs = require 'fs'
path = require 'path'
expect = require 'expect.js'
isUtf8 = require '..'

describe 'Empty buffer', ->
  it 'is valid', ->
    expect isUtf8.isValidUTF8 new Buffer 0
    .to.be.ok()

describe 'ASCII', ->
  it 'is valid', ->
    for i in [0..0x7F]
      expect isUtf8.isValidUTF8 new Buffer [i]
      .to.be.ok()

    expect isUtf8.isValidUTF8 new Buffer [0x7F..0]
    .to.be.ok()

describe 'Cyrillic', ->
  it 'is valid', ->

    expect isUtf8.isValidUTF8 new Buffer 'Однажды в студёную зимнюю пору'
    .to.be.ok()

describe 'Glass', ->
  it 'is eatable', ->

    expect isUtf8.isValidUTF8 fs.readFileSync path.join __dirname, 'glass.html'
    .to.be.ok()

describe 'Coffee', ->
  it 'is drinkable', ->

    expect isUtf8.isValidUTF8 fs.readFileSync __filename
    .to.be.ok()
{'fraction_non_alphanumeric': 0.15039768618944324, 'fraction_numerical': 0.02675343456254519, 'mean_word_length': 2.760869565217391, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '7619390', 'n_tokens_mistral': 560, 'n_tokens_neox': 561, 'n_words': 141}