test/rbbt/tsv/test_manipulate.rb in rbbt-util-5.19.9 vs test/rbbt/tsv/test_manipulate.rb in rbbt-util-5.19.10

- old
+ new

@@ -18,11 +18,11 @@ 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 @@ -37,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 @@ -59,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 @@ -81,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 @@ -94,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 @@ -132,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 @@ -163,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 @@ -182,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 @@ -200,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 @@ -219,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 @@ -255,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 @@ -273,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