test/tc/each_break.rb in rio-0.3.6 vs test/tc/each_break.rb in rio-0.3.7
- old
+ new
@@ -3,13 +3,10 @@
Dir.chdir File.dirname(__FILE__)+'/../'
$:.unshift File.expand_path('../lib/')
end
require 'rio'
-require 'test/unit'
-require 'test/unit/testsuite'
-require 'extensions/symbol'
require 'tc/testcase'
class TC_each_break < Test::Unit::TestCase
@@once = false
include RIO_TestCase
@@ -69,11 +66,11 @@
ans = []
@dir.dirs.each { |ent| ans << ent }
assert_array_equal(@dirs,ans)
end
- def broken_test_dir_sel
+ def test_dir_sel
ans = []
@dir.entries.each { |ent| ans << ent; break }
assert_array_equal(@ents[0..0],ans)
ans = []
@@ -129,51 +126,43 @@
@d2.each { |ent| ans << ent; break }
assert(@d2.open?)
assert_equal(@e2[0..0],ans)
end
- def broken_test_dir_readmore
+ def test_dir_readmore
ans = []
### LOOK INTO THIS
### Something changed in ruby 1.8.3
### See the file q/dir_readmore.q for a simple example
- @d1.each { |ent|
- p ent
+ dir1 = rio(@d1)
+ dir1.each { |ent|
ans << ent;
break
}
- assert(@d1.open?)
+ assert(dir1.open?)
assert_equal(@e1[0..0],ans)
-# #$trace_states = true
-# ans = []
-# @d1.each { |ent|
-# p ent
-# ans << ent;
-# break
-# }
-# assert(@d1.closed?)
-# assert_equal([],ans)
-# $trace_states = false
-
ans = []
- @d1.each { |ent| ans << ent; break }
- assert(@d1.open?)
- assert_equal(@e1[0..0],ans)
+ #$trace_states = true
+ dir1.each { |ent| ans << ent; break }
+ assert(dir1.closed?)
+ assert_equal([],ans)
+ dir2 = rio(@d2)
+
ans = []
- @d2.each { |ent| ans << ent; break }
- assert(@d2.open?)
+ dir2.each { |ent| ans << ent; break }
+ assert(dir2.open?)
assert_equal(@e2[0..0],ans)
ans = []
- @d2.each { |ent| ans << ent; break }
- assert(@d2.open?)
+ dir2.each { |ent| ans << ent; break }
+ assert(dir2.open?)
assert_equal(@e2[1..1],ans)
ans = []
- @d2.each { |ent| ans << ent; break }
- assert(@d2.closed?)
+ dir2.each { |ent| ans << ent; break }
+ assert(dir2.closed?)
assert_equal([],ans)
end
def test_nobreak_lines
ans = []