Sha256: 2c592a1812809012c32af44d4c792dece25846ff769f32a8db1671350aa7c986
Contents?: true
Size: 1008 Bytes
Versions: 141
Compression:
Stored size: 1008 Bytes
Contents
require File.join(File.expand_path(File.dirname(__FILE__)), '../../..', 'test_helper.rb') require 'rbbt/util/misc/bgzf' class TestBgzf < Test::Unit::TestCase def _test_Bgzf content = "1234567890" * 1000000 TmpFile.with_file(content) do |file| compressed = file + '.gz' `bgzip #{file} -c > #{compressed}` stream = Bgzf.setup File.open(compressed) stream.seek 500003 assert_equal "4567", stream.read(4) assert_equal "89", stream.read(2) end end def test_tsv require 'rbbt/tsv' TmpFile.with_file(datafile_test(:identifiers).read) do |file| Misc.benchmark do tsv = TSV.open(Open.open(file)) end compressed = file + '.bgz' `bgzip #{file} -c > #{compressed}` stream = Bgzf.setup File.open(compressed) Misc.benchmark do tsv = TSV.open(stream) end `gzip #{file}` stream = Open.open(file + '.gz') Misc.benchmark do tsv = TSV.open(stream) end end end end
Version data entries
141 entries across 141 versions & 1 rubygems