Sha256: 0cb714d4ed2e8c5edf793982dbb627f51808abb9d61101aaa6bc29ba268c4802

Contents?: true

Size: 567 Bytes

Versions: 6

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

require "test_helper"
require "stringio"

class SnappyHadoopTest < Test::Unit::TestCase
  T = [*"a".."z", *"A".."Z", *"0".."9"].freeze

  def random_data(length = 1024)
    Array.new(length) { T.sample }.join
  end

  test "well done" do
    s = random_data
    assert_equal s, Snappy::Hadoop.inflate(Snappy::Hadoop.deflate(s))
  end

  test "well done(pair)" do
    s = random_data
    [
      %i[deflate inflate]
    ].each do |(i, o)|
      assert_equal s, Snappy::Hadoop.__send__(o, Snappy::Hadoop.__send__(i, s))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
snappy-0.4.0-java test/snappy_hadoop_test.rb
snappy-0.4.0 test/snappy_hadoop_test.rb
snappy-0.3.0-java test/snappy_hadoop_test.rb
snappy-0.3.0 test/snappy_hadoop_test.rb
snappy-0.2.0-java test/snappy_hadoop_test.rb
snappy-0.2.0 test/snappy_hadoop_test.rb