diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-21 05:51:41 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-21 05:51:41 +0000 |
| commit | ffb471c8af755c7a44bce8bf34c9e04b4cd9e2c7 (patch) | |
| tree | b12c0550733bcac2a76b583ff5fd88f60340ea92 /lib/tsort.rb | |
| parent | 0e633168e14a1f6cd7e49d91947a70fad88f7a5a (diff) | |
| download | ruby-ffb471c8af755c7a44bce8bf34c9e04b4cd9e2c7.tar.gz ruby-ffb471c8af755c7a44bce8bf34c9e04b4cd9e2c7.tar.xz ruby-ffb471c8af755c7a44bce8bf34c9e04b4cd9e2c7.zip | |
* lib/pp.rb: Use Test::Unit.
* lib/prettyprint.rb: Ditto
* lib/time.rb: Ditto
* lib/tsort.rb: Ditto
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/tsort.rb')
| -rw-r--r-- | lib/tsort.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/tsort.rb b/lib/tsort.rb index 21adeaabf..783203079 100644 --- a/lib/tsort.rb +++ b/lib/tsort.rb @@ -245,8 +245,7 @@ module TSort end if __FILE__ == $0 - require 'runit/testcase' - require 'runit/cui/testrunner' + require 'test/unit' class Hash include TSort @@ -264,7 +263,7 @@ if __FILE__ == $0 end end - class TSortTest < RUNIT::TestCase + class TSortTest < Test::Unit::TestCase def test_dag h = {1=>[2, 3], 2=>[3], 3=>[]} assert_equal([3, 2, 1], h.tsort) @@ -275,7 +274,7 @@ if __FILE__ == $0 h = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} assert_equal([[4], [2, 3], [1]], h.strongly_connected_components.map {|nodes| nodes.sort}) - assert_exception(TSort::Cyclic) { h.tsort } + assert_raises(TSort::Cyclic) { h.tsort } end def test_array @@ -289,6 +288,5 @@ if __FILE__ == $0 end end - RUNIT::CUI::TestRunner.run(TSortTest.suite) end |
