X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=code_ruby%2Ftest%2Fmaasha%2Ftest_seq.rb;h=f966a5fa47b2387c74f1c2a785b6f8e49082f1be;hb=124ad80bd42309d1e6ea7d10dcffb86938c29069;hp=a7145ef009beb5ebf35e4f48eeb7becf5d5ae4d3;hpb=dd12a5077539995f63057a81601380e468922e2d;p=biopieces.git diff --git a/code_ruby/test/maasha/test_seq.rb b/code_ruby/test/maasha/test_seq.rb index a7145ef..f966a5f 100755 --- a/code_ruby/test/maasha/test_seq.rb +++ b/code_ruby/test/maasha/test_seq.rb @@ -9,7 +9,8 @@ class TestSeq < Test::Unit::TestCase @entry = Seq.new end - # def test_Seq# autoremoves whitespace, newlines, and carriage returns + # # autoremoves whitespace, newlines, and carriage returns + # def test_Seq_strip # dna = Seq.new # dna.seq = "A\tT\r\tC\nG " # assert_equal(dna.seq, "ATCG") @@ -277,6 +278,19 @@ class TestSeq < Test::Unit::TestCase end end + def test_Seq_shuffle_returns_correctly + orig = "actgactgactgatcgatcgatcgatcgtactg" + @entry.seq = "actgactgactgatcgatcgatcgatcgtactg" + entry_shuf = @entry.shuffle + assert_equal(orig, @entry.seq) + assert_not_equal(@entry.seq, entry_shuf.seq) + end + + def test_Seq_shuffle_bang_returns_correctly + @entry.seq = "actgactgactgatcgatcgatcgatcgtactg" + assert_not_equal(@entry.seq, @entry.shuffle!.seq) + end + def test_Seq_subseq_with_start_lt_0_raises @entry.seq = "ATCG" assert_raise(SeqError) { @entry.subseq(-1, 1) }