Sha256: a290b1bb06005596eac67b526baa543dcfe5d91e2519f1fdd02d765e112f2d2c

Contents?: true

Size: 989 Bytes

Versions: 10

Compression:

Stored size: 989 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
require 'rbbt/tsv'
require 'rbbt/tsv/parallel'

class TestTSVParallel < Test::Unit::TestCase

  def _test_pthrough
    require 'rbbt/sources/organism'
    tsv = Organism.identifiers("Hsa").tsv :unnamed => true, :persist => false, :fields => ["Associated Gene Name"]

    h = {}
    tsv.monitor = true
    tsv.unnamed = true
    tsv.pthrough do |k,v|
      h[k] = v.first
    end

    assert_equal tsv.size, h.size
    assert_equal tsv.keys.sort, h.keys.sort
  end


  def test_ppthrough
    require 'rbbt/sources/organism'
    tsv = Organism.identifiers("Hsa").tsv :unnamed => true, :persist => false, :fields => ["Associated Gene Name"]

    h = {}

    tsv.ppthrough_callback do |k,v|
      h[k] = v
    end

    tsv.unnamed = true
    tsv.monitor = true
    tsv.ppthrough(3) do |k,v|
      [k,v.first]
    end

    assert_equal tsv.size, h.size
    assert_equal tsv.keys.sort, h.keys.sort
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rbbt-util-5.8.10 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.9 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.8 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.7 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.6 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.4 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.3 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.2 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.1 test/rbbt/tsv/test_parallel.rb
rbbt-util-5.8.0 test/rbbt/tsv/test_parallel.rb