<commit_before># encoding: utf-8
ROOT_DIR = File.dirname(File.dirname(__FILE__))
$LOAD_PATH.unshift "#{ROOT_DIR}/lib"

require 'test/unit'
require 'mochilo'
require 'msgpack'
require 'pp'
require 'benchmark'
require 'stringio'

class CrossPlatformTest < Test::Unit::TestCase
  CASES = [
    false, true, nil,
    0,0,0,0,0,0,0,0,0,
    -1,-1,-1,-1,-1,
    127,127,255,65535,4294967295,
    -32,-32,-128,-32768,-2147483648,
    0.0,-0.0,1.0,-1.0,
    "a","a","a",
    "","","",
    [0],[0],[0],
    [],[],[],
    {},{},{},
    {"a" => 97}, {"a" => 97}, {"a" => 97},
    [[]], [["a"]]
  ]

  def test_cross_plat
    binary = IO.read("#{ROOT_DIR}/test/assets/cases.mpac")


    unpacker = Mochilo::Unpacker.new(stream)

    unpacker.each { |obj|
      pp obj
    }
  end

end


class MochiloPackTest < Test::Unit::TestCase

  OBJECTS = [<commit_msg>fix syntax error in test<commit_after># encoding: utf-8
ROOT_DIR = File.dirname(File.dirname(__FILE__))
$LOAD_PATH.unshift "#{ROOT_DIR}/lib"

require 'test/unit'
require 'mochilo'
require 'msgpack'
require 'pp'
require 'benchmark'
require 'stringio'

class CrossPlatformTest < Test::Unit::TestCase
  CASES = [
    false, true, nil,
    0,0,0,0,0,0,0,0,0,
    -1,-1,-1,-1,-1,
    127,127,255,65535,4294967295,
    -32,-32,-128,-32768,-2147483648,
    0.0,-0.0,1.0,-1.0,
    "a","a","a",
    "","","",
    [0],[0],[0],
    [],[],[],
    {},{},{},
    {"a" => 97}, {"a" => 97}, {"a" => 97},
    [[]], [["a"]]
  ]

  def test_cross_plat
    stream = File.new("#{ROOT_DIR}/test/assets/cases.mpac")

    unpacker = Mochilo::Unpacker.new(stream)

    unpacker.each { |obj|
      pp obj
    }
  end

end


class MochiloPackTest < Test::Unit::TestCase

  OBJECTS = [
{'fraction_non_alphanumeric': 0.23135642982971227, 'fraction_numerical': 0.0916030534351145, 'mean_word_length': 3.2814070351758793, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '5245043', 'n_tokens_mistral': 800, 'n_tokens_neox': 717, 'n_words': 116}