diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/marshaltestlib.rb | 4 | ||||
| -rw-r--r-- | test/ruby/test_array.rb | 34 | ||||
| -rw-r--r-- | test/ruby/test_file_exhaustive.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_hash.rb | 4 | ||||
| -rw-r--r-- | test/ruby/test_queue.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_string.rb | 4 | ||||
| -rw-r--r-- | test/ruby/test_symbol.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_trace.rb | 6 | ||||
| -rw-r--r-- | test/ruby/test_variable.rb | 2 | ||||
| -rw-r--r-- | test/ruby/test_whileuntil.rb | 2 |
10 files changed, 31 insertions, 31 deletions
diff --git a/test/ruby/marshaltestlib.rb b/test/ruby/marshaltestlib.rb index ae60cd8479..596d2d8450 100644 --- a/test/ruby/marshaltestlib.rb +++ b/test/ruby/marshaltestlib.rb @@ -296,7 +296,7 @@ module MarshalTestLib class MyStruct def ==(rhs) return true if __id__ == rhs.__id__ - return false unless rhs.is_a?(::Struct) + return false unless rhs.is_a?(::Struct) return false if self.class != rhs.class members.each do |member| return false if self.__send__(member) != rhs.__send__(member) @@ -484,7 +484,7 @@ module MarshalTestLib class MyStruct2 def ==(rhs) return true if __id__ == rhs.__id__ - return false unless rhs.is_a?(::Struct) + return false unless rhs.is_a?(::Struct) return false if self.class != rhs.class members.each do |member| return false if self.__send__(member) != rhs.__send__(member) diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 8ddb2d5a45..d5f1594548 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -122,27 +122,27 @@ class TestArray < Test::Unit::TestCase def test_beg_end_0 x = [1, 2, 3, 4, 5] - + assert_equal(1, x.first) assert_equal([1], x.first(1)) assert_equal([1, 2, 3], x.first(3)) - + assert_equal(5, x.last) assert_equal([5], x.last(1)) assert_equal([3, 4, 5], x.last(3)) - + assert_equal(1, x.shift) assert_equal([2, 3, 4], x.shift(3)) assert_equal([5], x) - + assert_equal([2, 3, 4, 5], x.unshift(2, 3, 4)) assert_equal([1, 2, 3, 4, 5], x.unshift(1)) assert_equal([1, 2, 3, 4, 5], x) - + assert_equal(5, x.pop) assert_equal([3, 4], x.pop(2)) assert_equal([1, 2], x) - + assert_equal([1, 2, 3, 4], x.push(3, 4)) assert_equal([1, 2, 3, 4, 5], x.push(5)) assert_equal([1, 2, 3, 4, 5], x) @@ -319,7 +319,7 @@ class TestArray < Test::Unit::TestCase assert_equal(@cls[10, 11, 12], a[9..11]) assert_equal(@cls[10, 11, 12], a[-91..-89]) - + assert_nil(a[10, -3]) # Ruby 1.8 feature change: # Array#[size..x] returns [] instead of nil. @@ -481,7 +481,7 @@ class TestArray < Test::Unit::TestCase a = @cls[ 1, 'cat', 1..1 ] assert_equal([ Fixnum, String, Range], a.collect! {|e| e.class} ) assert_equal([ Fixnum, String, Range], a) - + a = @cls[ 1, 'cat', 1..1 ] assert_equal([ 99, 99, 99], a.collect! { 99 } ) assert_equal([ 99, 99, 99], a) @@ -529,7 +529,7 @@ class TestArray < Test::Unit::TestCase assert_equal(@cls[1, 2, 3, 4], @cls[1, 2, 3, 4].concat(@cls[])) assert_equal(@cls[], @cls[].concat(@cls[])) assert_equal(@cls[@cls[1, 2], @cls[3, 4]], @cls[@cls[1, 2]].concat(@cls[@cls[3, 4]])) - + a = @cls[1, 2, 3] a.concat(a) assert_equal([1, 2, 3, 1, 2, 3], a) @@ -702,7 +702,7 @@ class TestArray < Test::Unit::TestCase a5 = @cls[ a1, @cls[], a3 ] assert_equal(@cls[1, 2, 3, 4, 5, 6], a5.flatten) assert_equal(@cls[], @cls[].flatten) - assert_equal(@cls[], + assert_equal(@cls[], @cls[@cls[@cls[@cls[],@cls[]],@cls[@cls[]],@cls[]],@cls[@cls[@cls[]]]].flatten) assert_raise(TypeError, "[ruby-dev:31197]") { [[]].flatten("") } @@ -721,7 +721,7 @@ class TestArray < Test::Unit::TestCase assert_equal(@cls[1, 2, 3, 4, 5, 6], a5) assert_equal(@cls[], @cls[].flatten) - assert_equal(@cls[], + assert_equal(@cls[], @cls[@cls[@cls[@cls[],@cls[]],@cls[@cls[]],@cls[]],@cls[@cls[@cls[]]]].flatten) end @@ -816,7 +816,7 @@ class TestArray < Test::Unit::TestCase a = @cls[ 1, 'cat', 1..1 ] assert_equal(@cls[ Fixnum, String, Range], a.map! {|e| e.class} ) assert_equal(@cls[ Fixnum, String, Range], a) - + a = @cls[ 1, 'cat', 1..1 ] assert_equal(@cls[ 99, 99, 99], a.map! { 99 } ) assert_equal(@cls[ 99, 99, 99], a) @@ -865,11 +865,11 @@ class TestArray < Test::Unit::TestCase assert_equal("ABC", @cls[ 65, 66, 67 ].pack("c3")) assert_equal("\377BC", @cls[ -1, 66, 67 ].pack("c*")) - + assert_equal("AB\n\x10", @cls["4142", "0a", "12"].pack("H4H2H1")) assert_equal("AB\n\x02", @cls["1424", "a0", "21"].pack("h4h2h1")) - assert_equal("abc=02def=\ncat=\n=01=\n", + assert_equal("abc=02def=\ncat=\n=01=\n", @cls["abc\002def", "cat", "\001"].pack("M9M3M4")) assert_equal("aGVsbG8K\n", @cls["hello\n"].pack("m")) @@ -1069,7 +1069,7 @@ class TestArray < Test::Unit::TestCase assert_equal(@cls[10, 11, 12], a.slice(9..11)) assert_equal(@cls[10, 11, 12], a.slice(-91..-89)) - + assert_nil(a.slice(-101..-1)) assert_nil(a.slice(10, -3)) @@ -1127,7 +1127,7 @@ class TestArray < Test::Unit::TestCase a.fill(1) assert_equal(@cls[1, 1, 1, 1], a.sort) - + assert_equal(@cls[], @cls[].sort) end @@ -1235,7 +1235,7 @@ class TestArray < Test::Unit::TestCase assert_equal(@cls[[1,1],[1,2],[2,1],[2,2]], @cls[1,2].product([1,2])) assert_equal(@cls[[1,3,5],[1,3,6],[1,4,5],[1,4,6], - [2,3,5],[2,3,6],[2,4,5],[2,4,6]], + [2,3,5],[2,3,6],[2,4,5],[2,4,6]], @cls[1,2].product([3,4],[5,6])) assert_equal(@cls[[1],[2]], @cls[1,2].product) assert_equal(@cls[], @cls[1,2].product([])) diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb index ca3227d832..7824b6e85f 100644 --- a/test/ruby/test_file_exhaustive.rb +++ b/test/ruby/test_file_exhaustive.rb @@ -34,7 +34,7 @@ class TestFileExhaustive < Test::Unit::TestCase def make_file(content, file = @file) open(file, "w") {|fh| fh << content } end - + def make_tmp_filename(prefix) @hardlinkfile = @dir + "/" + prefix + File.basename(__FILE__) + ".#{$$}.test" end diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 71cf8dab93..ef990735fc 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -106,7 +106,7 @@ class TestHash < Test::Unit::TestCase assert_instance_of(@cls, h) assert_equal('default', h.default) assert_equal('default', h['spurious']) - + end def test_AREF # '[]' @@ -516,7 +516,7 @@ class TestHash < Test::Unit::TestCase def test_shift h = @h.dup - + @h.length.times { k, v = h.shift assert(@h.key?(k)) diff --git a/test/ruby/test_queue.rb b/test/ruby/test_queue.rb index 16e7548d1a..f3dedd230d 100644 --- a/test/ruby/test_queue.rb +++ b/test/ruby/test_queue.rb @@ -28,7 +28,7 @@ class TestQueue < Test::Unit::TestCase num_objects.times { from_workers.pop } } }.join - + num_threads.times { to_workers.push nil } workers.each { |t| t.join } diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index e6399b1f2c..7510bb9cb7 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -159,7 +159,7 @@ class TestString < Test::Unit::TestCase assert_equal("now's", result[0]) assert_equal("the", result[1]) assert_equal("time", result[2]) - + result = " now's the time".split(' ') assert_equal("now's", result[0]) assert_equal("the", result[1]) @@ -209,7 +209,7 @@ class TestString < Test::Unit::TestCase assert_equal("m", result[2]) assert_equal("o", result[3]) assert_equal("m", result[4]) - + result = "mellow yellow".split("ello") assert_equal("m", result[0]) assert_equal("w y", result[1]) diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index a19a78e605..f402da3907 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -69,7 +69,7 @@ class TestSymbol < Test::Unit::TestCase end def test_inspect_number - # 5) Inconsistency between :$0 and :$1? The first one is valid, but the + # 5) Inconsistency between :$0 and :$1? The first one is valid, but the # latter isn't. assert_inspect_evaled(':$0') assert_inspect_evaled(':$1') diff --git a/test/ruby/test_trace.rb b/test/ruby/test_trace.rb index 6adfe0bf64..4694790cfb 100644 --- a/test/ruby/test_trace.rb +++ b/test/ruby/test_trace.rb @@ -7,15 +7,15 @@ class TestTrace < Test::Unit::TestCase trace_var :$x, proc{$y = $x} $x = 40414 assert_equal($x, $y) - + untrace_var :$x $x = 19660208 assert_not_equal($x, $y) - + trace_var :$x, proc{$x *= 2} $x = 5 assert_equal(10, $x) - + untrace_var :$x end end diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb index 8726160826..124ef6f2ed 100644 --- a/test/ruby/test_variable.rb +++ b/test/ruby/test_variable.rb @@ -31,7 +31,7 @@ class TestVariable < Test::Unit::TestCase def test_variable assert_instance_of(Fixnum, $$) - + # read-only variable assert_raises(NameError) do $$ = 5 diff --git a/test/ruby/test_whileuntil.rb b/test/ruby/test_whileuntil.rb index 6faed31160..676827484d 100644 --- a/test/ruby/test_whileuntil.rb +++ b/test/ruby/test_whileuntil.rb @@ -12,7 +12,7 @@ class TestWhileuntil < Test::Unit::TestCase tmp = open("while_tmp", "r") assert_instance_of(File, tmp) - + while line = tmp.gets() break if /vt100/ =~ line end |
