test/rbbt/tsv/test_manipulate.rb in rbbt-util-5.15.1 vs test/rbbt/tsv/test_manipulate.rb in rbbt-util-5.15.2

- old
+ new

@@ -11,16 +11,18 @@ rowa a|aa b|BB C|CC EOF TmpFile.with_file(content) do |filename| tsv = TSV.open(File.open(filename), :sep => /\s+/, :type => :double) + Log.tsv tsv + Log.tsv tsv.reorder("ValueA", nil, :zipped => true) assert_equal ["A", "AA", "a", "aa"].sort, tsv.reorder("ValueA", nil, :zipped => true).keys.sort end end - def test_through + def _test_through content =<<-EOF #Id ValueA ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -35,11 +37,11 @@ assert_equal "ValueA", new_key end end - def test_reorder_simple + def _test_reorder_simple content =<<-EOF #Id ValueA ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -57,11 +59,11 @@ assert_equal %w(Id ValueB OtherID), tsv1.fields end end - def test_reorder_remove_field + def _test_reorder_remove_field content =<<-EOF #Id ValueA ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -79,11 +81,11 @@ assert_equal ["row1"], tsv1["aa"]["Id"] assert_equal ["row1","row3"], tsv1["a"]["Id"] end end - def test_slice + def _test_slice content =<<-EOF #ID ValueA ValueB Comment row1 a b c row2 A B C EOF @@ -92,11 +94,11 @@ tsv = TSV.open(File.open(filename), :type => :double, :sep => /\s/) assert_equal [["a"],["c"]], tsv.reorder(:key, ["ValueA", "Comment"])["row1"] end end - def test_select + def _test_select content =<<-EOF #Id ValueA ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -130,11 +132,11 @@ tsv = TSV.open(filename, :sep => /\s+/, :type => :flat) assert tsv.type != :double end end - def test_select_invert + def _test_select_invert content =<<-EOF #Id ValueA ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -161,11 +163,11 @@ tsv = TSV.open(filename, :sep => /\s+/, :type => :flat) assert tsv.type != :double end end - def test_process + def _test_process content =<<-EOF #Id ValueA ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -180,11 +182,11 @@ assert_equal ["Pref:A"], tsv["row2"]["ValueA"] end end - def test_add_field + def _test_add_field content =<<-EOF #Id LetterValue:ValueA LetterValue:ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -198,11 +200,11 @@ assert tsv.fields.include?("Str length") end end - def test_add_field_double_with_list_result + def _test_add_field_double_with_list_result content =<<-EOF #Id LetterValue:ValueA LetterValue:ValueB OtherID row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 @@ -217,31 +219,31 @@ assert Array === tsv["row1"]["Test"] end end - def test_through_headless + def _test_through_headless content =<<-EOF row1 a|aa|aaa b Id1|Id2 row2 A B Id3 row3 a C Id4 EOF TmpFile.with_file(content) do |filename| tsv = TSV.open(filename, :sep => /\s+/) - test = false + _test = false tsv.through do - test = true + _test = true end - assert test + assert _test end end - def test_reorder_flat + def _test_reorder_flat content =<<-EOF #Id ValueA row1 a aa aaa row2 A row3 a @@ -253,11 +255,11 @@ assert_equal ["row1", "row3"].sort, tsv.reorder("ValueA")["a"] end end - def test_transpose + def _test_transpose content =<<-EOF #: :type=:list #Row vA vB vID row1 a b Id1 row2 A B Id3 @@ -271,10 +273,10 @@ end end - def test_through_flat + def _test_through_flat content =<<-EOF #: :type=:flat #Row vA row1 a b Id1 row2 A B Id3