Created
May 5, 2012 09:45
-
-
Save k-tsj/2601217 to your computer and use it in GitHub Desktop.
run boostraptest on mruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2012-05-05 18:36:59 +0900 | |
Driver is ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] | |
Target is ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] | |
test_attr.rb syntax error, unexpected tLSHFT, expecting ')' | |
syntax error, unexpected '\n', expecting '{' | |
FF | |
test_autoload.rb FFFFFFFFFFFF.F | |
test_block.rb ..........FF...............F............FF.FFF.F.FFFFF. | |
test_class.rb F.F.F.F.F.F.F.F..F...F.....FFFEE.FF..FF..`&' interpreted as argument prefix | |
FFF. | |
test_eval.rb FFsyntax error, unexpected '}', expecting keyword_end | |
FFFFFFFFFFFFFFFFFFFFFF.FFFFFFF.FF. | |
test_exception.rb ....E.FFFF.EEEEFEEE..FF.FF..FFFFE | |
test_finalizer.rb . | |
test_flip.rb . | |
test_flow.rb ...F.F.FEEF..EEEEFE.F.F.F.FFFFFFFF...F'm2': wrong number of arguments (1 for 0) | |
F.....FFFFFFFFFFFF | |
test_fork.rb F..FF | |
test_gc.rb .. | |
test_io.rb ...FF... | |
test_jump.rb ..FFFFFFFFFF..Fsyntax error, unexpected '}', expecting keyword_end | |
F...EE.FF.FFFE | |
test_literal.rb .......................FF..FF................F...F.syntax error, unexpected $end, expecting keyword_end | |
Fsyntax error, unexpected $end, expecting keyword_end | |
Fsyntax error, unexpected $end, expecting keyword_end | |
FInvalid char `\x60' in expression | |
Invalid char `\x60' in expression | |
FInvalid char `\x60' in expression | |
syntax error, unexpected $end, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
.syntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
.syntax error, unexpected tREGEXP_BEG | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
Fsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
F...................FF....EEE...............................................F..syntax error, unexpected tSTRING_BEG, expecting keyword_end | |
Fsyntax error, unexpected tSTRING_BEG, expecting keyword_end | |
syntax error, unexpected tSTRING_BEG, expecting keyword_end | |
F.E.. | |
test_load.rb Fsyntax error, unexpected tQWORDS_BEG, expecting keyword_end | |
syntax error, unexpected tQWORDS_BEG, expecting ')' | |
F | |
test_marshal.rb . | |
test_massign.rb FFEF..FF........................FF | |
test_method.rb ....'m': wrong number of arguments (1 for 0) | |
F'm': wrong number of arguments (0 for 1) | |
F.......................................................................................................FFEEsyntax error, unexpected tIDENTIFIER, expecting keyword_end | |
F.FFFFFF.F.....FFFFFFFFF..EFF.....FFF....FFFF............................................EFFFFF.F.FF..FFF.FFFF | |
test_objectspace.rb ..... | |
test_proc.rb ..F.....FF...FFF..FF.E.F.....FFF`&' interpreted as argument prefix | |
.FFF | |
test_struct.rb . | |
test_syntax.rb ..........FFFsyntax error, unexpected tREGEXP_BEG | |
syntax error, unexpected keyword_when, expecting keyword_end | |
syntax error, unexpected keyword_when, expecting keyword_end | |
else without rescue is useless | |
syntax error, unexpected ';', expecting ')' | |
FFFFFsyntax error, unexpected tREGEXP_BEG | |
Fsyntax error, unexpected tREGEXP_BEG | |
F.FFFFFFFFFFsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
syntax error, unexpected '(', expecting keyword_end | |
FFEEFEFFFFFFFFFFsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected keyword_end, expecting ')' | |
syntax error, unexpected keyword_end, expecting ')' | |
FFF...F....FF..............FFFFFFFFFFF....FFsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
FEsyntax error, unexpected '}', expecting ')' | |
syntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
Fsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
Fsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
Fsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
FEsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
FFsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
FFFsyntax error, unexpected tREGEXP_BEG, expecting ']' | |
syntax error, unexpected ')' | |
F...FF....FFFFF......E.....F....(...) interpreted as grouped expression | |
F'a': wrong number of arguments (1 for 0) | |
FF..FF.syntax error, unexpected tSTRING_BEG, expecting keyword_end | |
Fsyntax error, unexpected tSTRING_BEG, expecting keyword_end | |
FFFFF.Fsyntax error, unexpected keyword_do_block, expecting '}' | |
FFF | |
test_thread.rb FFFFFFFFFFFFFFFFFFFsyntax error, unexpected tREGEXP_BEG, expecting keyword_end | |
syntax error, unexpected tREGEXP_BEG, expecting '}' | |
FFFFsyntax error, unexpected keyword_END | |
syntax error, unexpected '\n', expecting '{' | |
syntax error, unexpected ')', expecting keyword_end | |
F....syntax error, unexpected tREGEXP_BEG | |
syntax error, unexpected tREGEXP_BEG | |
syntax error, unexpected ')' | |
syntax error, unexpected tMATCH | |
syntax error, unexpected keyword_end, expecting ')' | |
syntax error, unexpected keyword_ensure, expecting ')' | |
syntax error, unexpected keyword_end, expecting ')' | |
syntax error, unexpected keyword_end, expecting ')' | |
F........FFFFFFFInvalid char `\x60' in expression | |
Invalid char `\x60' in expression | |
FFsyntax error, unexpected keyword_END | |
syntax error, unexpected '\n', expecting '{' | |
syntax error, unexpected ')', expecting keyword_end | |
F.Fsyntax error, unexpected tREGEXP_BEG | |
syntax error, unexpected keyword_end, expecting '}' | |
F | |
#1 test_attr.rb:1:in `<top (required)>': | |
module M | |
class A | |
class << self | |
attr_accessor :at | |
def workflow_rule | |
yield self | |
end | |
def eval_str(str) | |
eval(str) | |
end | |
end | |
end | |
end | |
begin | |
M::A.eval_str(<<-END) | |
workflow_rule do |r| | |
r.at 1 | |
end | |
END | |
rescue ArgumentError => e | |
print "ok" | |
end | |
#=> "" (expected "ok") [ruby-core:14641] | |
#2 test_attr.rb:27:in `<top (required)>': | |
class A | |
attr :m | |
end | |
begin | |
A.new.m(3) | |
rescue ArgumentError => e | |
print "ok" | |
end | |
#=> "#<NoMethodError: no method named attr>\n" (expected "ok") [ruby-core:15120] | |
#3 test_autoload.rb:1:in `<top (required)>': | |
File.unlink('zzz.rb') if File.file?('zzz.rb') | |
instance_eval do | |
autoload :ZZZ, './zzz.rb' | |
begin | |
ZZZ | |
rescue LoadError | |
:ok | |
end | |
end | |
#=> "#<NameError: uninitialized constant File>\n" (expected "ok") [ruby-dev:43816] | |
#4 test_autoload.rb:13:in `<top (required)>': | |
open('zzz.rb', 'w') {|f| f.puts '' } | |
instance_eval do | |
autoload :ZZZ, './zzz.rb' | |
begin | |
ZZZ | |
rescue NameError | |
:ok | |
end | |
end | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") [ruby-dev:43816] | |
#5 test_autoload.rb:25:in `<top (required)>': | |
open('zzz.rb', 'w') {|f| f.puts 'class ZZZ; def self.ok;:ok;end;end'} | |
instance_eval do | |
autoload :ZZZ, './zzz.rb' | |
ZZZ.ok | |
end | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") [ruby-dev:43816] | |
#6 test_autoload.rb:33:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | |
autoload :ZZZ, "./zzz.rb" | |
ZZZ.ok | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#7 test_autoload.rb:39:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | |
autoload :ZZZ, "./zzz.rb" | |
require "./zzz.rb" | |
ZZZ.ok | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#8 test_autoload.rb:46:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | |
autoload :ZZZ, "./zzz.rb" | |
proc{$SAFE=4; ZZZ.ok}.call | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#9 test_autoload.rb:52:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | |
autoload :ZZZ, "./zzz.rb" | |
require "./zzz.rb" | |
proc{$SAFE=4; ZZZ.ok}.call | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#10 test_autoload.rb:59:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"} | |
autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb') | |
module M; end | |
Thread.new{M.instance_eval('$SAFE=4; ZZZ.new.hoge')}.value | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#11 test_autoload.rb:66:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"} | |
autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb') | |
module M; end | |
Thread.new{$SAFE=4; M.instance_eval('ZZZ.new.hoge')}.value | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#12 test_autoload.rb:73:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"} | |
autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb') | |
Thread.new{$SAFE=4; eval('ZZZ.new.hoge')}.value | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#13 test_autoload.rb:79:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def hoge;:ok;end;end"} | |
autoload :ZZZ, File.join(Dir.pwd, 'zzz.rb') | |
module M; end | |
Thread.new{eval('$SAFE=4; ZZZ.new.hoge')}.value | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") | |
#14 test_autoload.rb:86:in `<top (required)>': | |
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"} | |
autoload :ZZZ, "./zzz.rb" | |
t1 = Thread.new {ZZZ.ok} | |
t2 = Thread.new {ZZZ.ok} | |
[t1.value, t2.value].join | |
#=> "#<NoMethodError: no method named open>\n" (expected "okok") | |
#16 test_autoload.rb:102:in `<top (required)>': | |
open("zzz.rb", "w") {} | |
class A | |
autoload :C, "./zzz" | |
class C | |
end | |
C | |
end | |
#=> "#<NoMethodError: no method named open>\n" (expected "A::C") | |
#27 test_block.rb:69:in `<top (required)>': | |
class C | |
include Enumerable | |
def each | |
[1,2,3].each{|e| | |
yield e | |
} | |
end | |
end | |
C.new.to_a | |
#=> "#<NoMethodError: no method named call>\n" (expected "[1, 2, 3]") | |
#28 test_block.rb:81:in `<top (required)>': | |
class C | |
include Enumerable | |
def each | |
[1,2,3].each{|e| | |
yield e | |
} | |
end | |
end | |
C.new.map{|e| | |
e + 3 | |
} | |
#=> "#<NoMethodError: no method named call>\n" (expected "[4, 5, 6]") | |
#44 test_block.rb:270:in `<top (required)>': | |
def iter | |
yield 1, 2 | |
end | |
iter{|a, b, c, *d| | |
[a, b, c, d] | |
} | |
#=> "[1, 2, nil, [[]]]" (expected "[1, 2, nil, []]") | |
#57 test_block.rb:396:in `<top (required)>': | |
def m(ary = []) | |
yield(ary) | |
end | |
$ans = [] | |
o = 1 | |
5.times{ | |
v,(*) = o; $ans << o | |
m(o){|(v,(*))| $ans << v} | |
((x, y)) = o; $ans << [x, y] | |
m(o){|((x, y))| $ans << [x, y]} | |
(((x, y))) = o; $ans << [x, y] | |
m(o){|(((x, y)))| $ans << [x, y]} | |
o = [o, o] | |
}; $ans | |
#=> "unknown lhs 0\nunknown lhs 7517580\nunknown lhs 7518828\n[1, 1, [nil, nil], [1, nil], [nil, nil], [1, nil], [1, 1], [1, 1], [nil, nil], [[1, 1], nil], [nil, nil], [[1, 1], nil], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [nil, nil], [[[1, 1], [1, 1]], nil], [nil, nil], [[[1, 1], [1, 1]], nil], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [nil, nil], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], nil], [nil, nil], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], nil], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], [nil, nil], [[[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], nil], [nil, nil], [[[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], nil]]" (expected "[1, 1, [1, nil], [1, nil], [1, nil], [1, nil], [1, 1], 1, [1, nil], [1, nil], [1, nil], [1, nil], [[1, 1], [1, 1]], [1, 1], [1, 1], [1, 1], [1, nil], [1, nil], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [[1, 1], [1, 1]], [1, 1], [1, 1], [[[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[[1, 1], [1, 1]], [[1, 1], [1, 1]]], [[1, 1], [1, 1]], [[1, 1], [1, 1]]]") | |
#58 test_block.rb:414:in `<top (required)>': | |
def m() | |
yield [0] | |
end | |
m {|*,v| v}.inspect | |
#=> "[0]" (expected "0") [ruby-dev:31437] | |
#60 test_block.rb:426:in `<top (required)>': | |
begin | |
lambda{|a|}.call(1, 2) | |
rescue ArgumentError | |
:ok | |
else | |
:ng | |
end | |
#=> "ng" (expected "ok") [ruby-dev:31464] | |
#61 test_block.rb:435:in `<top (required)>': | |
begin | |
lambda{|&b|}.call(3) | |
rescue ArgumentError | |
:ok | |
else | |
:ng | |
end | |
#=> "ng" (expected "ok") [ruby-dev:31472] | |
#62 test_block.rb:444:in `<top (required)>': | |
class C | |
def each | |
yield [1,2] | |
yield 1,2 | |
end | |
end | |
vs1 = [] | |
C.new.each {|*v| vs1 << v } | |
vs2 = [] | |
C.new.to_enum.each {|*v| vs2 << v } | |
vs1 == vs2 ? :ok : :ng | |
#=> "#<NoMethodError: no method named to_enum>\n" (expected "ok") [ruby-dev:32329] | |
#64 test_block.rb:467:in `<top (required)>': | |
def m() yield nil,[] end | |
l = lambda {|*v| v} | |
GC.stress=true | |
r = m(&l) | |
GC.stress=false | |
r.inspect | |
#=> "#<NoMethodError: no method named stress=>\n" (expected "[nil, []]") [ruby-dev:32567] | |
#66 test_block.rb:480:in `<top (required)>': | |
class C | |
define_method(:foo) do |arg, &block| | |
if block then block.call else arg end | |
end | |
end | |
C.new.foo("ng") {"ok"} | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "ok") [ruby-talk:266422] | |
#67 test_block.rb:489:in `<top (required)>': | |
class C | |
define_method(:xyz) do |o, k, &block| | |
block.call(o, k) | |
end | |
end | |
C.new.xyz("o","k") {|o, k| o+k} | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "ok") [ruby-core:20544] | |
#68 test_block.rb:498:in `<top (required)>': | |
class C | |
define_method(:xyz) do |*args, &block| | |
block.call(*args) | |
end | |
end | |
C.new.xyz("o","k") {|*args| args.join("")} | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "ok") [ruby-core:20544] | |
#69 test_block.rb:507:in `<top (required)>': | |
STDERR.reopen(STDOUT) | |
class C | |
define_method(:foo) do |&block| | |
block.call if block | |
end | |
result = "ng" | |
new.foo() {result = "ok"} | |
result | |
end | |
#=> "#<NameError: uninitialized constant STDERR>\n" (expected "ok") | |
#70 test_block.rb:519:in `<top (required)>': | |
class Bar | |
def bar; :ok; end | |
end | |
def foo | |
yield(Bar.new) if block_given? | |
end | |
foo(&:bar) | |
#=> "false" (expected "ok") [ruby-core:14279] | |
#72 test_class.rb:2:in `<top (required)>': Object.const_defined?(:C) #=> "#<NoMethodError: no method named const_defined?>\n" (expected "true") | |
#74 test_class.rb:6:in `<top (required)>': C.name #=> "#<NoMethodError: no method named name>\n" (expected "C") | |
#76 test_class.rb:10:in `<top (required)>': C.new.class.name #=> "#<NoMethodError: no method named name>\n" (expected "C") | |
#78 test_class.rb:16:in `<top (required)>': | |
class C < A; end | |
Object.const_defined?(:C) #=> "#<NoMethodError: no method named const_defined?>\n" (expected "true") | |
#80 test_class.rb:22:in `<top (required)>': | |
class C < A; end | |
C.name #=> "#<NoMethodError: no method named name>\n" (expected "C") | |
#82 test_class.rb:28:in `<top (required)>': | |
class C < A; end | |
C.new.class.name #=> "#<NoMethodError: no method named name>\n" (expected "C") | |
#84 test_class.rb:36:in `<top (required)>': Object.const_defined?(:M) #=> "#<NoMethodError: no method named const_defined?>\n" (expected "true") | |
#86 test_class.rb:40:in `<top (required)>': M.name #=> "#<NoMethodError: no method named name>\n" (expected "M") | |
#89 test_class.rb:50:in `<top (required)>': | |
class A::B; end | |
A::B.name #=> "#<NoMethodError: no method named name>\n" (expected "A::B") | |
#93 test_class.rb:63:in `<top (required)>': | |
class A::B; end | |
class A::B::C; end | |
A::B::C.name #=> "#<NoMethodError: no method named name>\n" (expected "A::B::C") | |
#99 test_class.rb:89:in `<top (required)>': | |
class C; end; c2 = ::C | |
c1.equal?(c2) #=> "#<TypeError: constant look-up for non class/module>\n" (expected "true") | |
#100 test_class.rb:92:in `<top (required)>': | |
class A; end | |
begin class C < A; end; rescue TypeError; 1 end #=> "#<Proc:0x6ffcf8>" (expected "1") | |
#101 test_class.rb:95:in `<top (required)>': begin module C; end; rescue TypeError; 1 end #=> "#<Proc:0x6ffcf8>" (expected "1") | |
#102 test_class.rb:97:in `<top (required)>': core dumped | |
#103 test_class.rb:99:in `<top (required)>': core dumped | |
#105 test_class.rb:104:in `<top (required)>': A = 7; begin A::C = 7; rescue TypeError; 1 end #=> "#<TypeError: constant look-up for non class/module>\n" (expected "1") | |
#106 test_class.rb:105:in `<top (required)>': begin 7::C = 7; rescue TypeError; 1 end #=> "#<TypeError: constant look-up for non class/module>\n" (expected "1") | |
#109 test_class.rb:108:in `<top (required)>': class A; ::C = "OK"; end; C #=> "unknown lhs 75\n#<NameError: uninitialized constant C>\n" (expected "OK") | |
#110 test_class.rb:109:in `<top (required)>': class A; ::C = "OK"; end; C.class #=> "unknown lhs 75\n#<NameError: uninitialized constant C>\n" (expected "String") | |
#113 test_class.rb:116:in `<top (required)>': | |
module Foo | |
end | |
begin | |
def foo(&b) | |
Foo.module_eval &b | |
end | |
foo{ | |
def bar | |
end | |
} | |
bar() | |
rescue NameError | |
:ok | |
end | |
#=> "true" (expected "ok") [ruby-core:14378] | |
#114 test_class.rb:134:in `<top (required)>': | |
$i = 0 | |
class C | |
def self.const_missing *args | |
$i+=1 | |
end | |
end | |
3.times{ | |
C::FOO | |
} | |
$i | |
#=> "#<NameError: uninitialized constant FOO>\n" (expected "3") | |
#115 test_class.rb:148:in `<top (required)>': | |
c = nil | |
Module.new{|m| c = class m::C; name; end} | |
c | |
#=> /::C\z/ expected to be =~ | |
"" [ruby-dev:38456] | |
#117 test_eval.rb:1:in `<top (required)>': | |
def m | |
a = :ok | |
$b = binding | |
end | |
m | |
eval('a', $b) | |
#=> "#<NoMethodError: no method named binding>\n" (expected "ok") | |
#118 test_eval.rb:9:in `<top (required)>': | |
def m | |
a = :ok | |
$b = binding | |
end | |
m | |
eval('b = :ok2', $b) | |
eval('[a, b]', $b) | |
#=> "#<NoMethodError: no method named binding>\n" (expected "[:ok, :ok2]") | |
#119 test_eval.rb:18:in `<top (required)>': | |
$ans = [] | |
def m | |
$b = binding | |
end | |
m | |
$ans << eval(%q{ | |
$ans << eval(%q{ | |
a | |
}, $b) | |
a = 1 | |
}, $b) | |
$ans | |
#=> "" (expected "[nil, 1]") | |
#120 test_eval.rb:32:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
def m | |
binding | |
end | |
end | |
eval('Const', C.new.m) | |
#=> "#<NoMethodError: no method named binding>\n" (expected "C") | |
#121 test_eval.rb:42:in `<top (required)>': | |
Const = :top | |
a = 1 | |
class C | |
Const = :C | |
def m | |
eval('Const', TOPLEVEL_BINDING) | |
end | |
end | |
C.new.m | |
#=> "#<NameError: uninitialized constant TOPLEVEL_BINDING>\n" (expected "top") | |
#122 test_eval.rb:54:in `<top (required)>': | |
class C | |
$b = binding | |
end | |
eval %q{ | |
def m | |
:ok | |
end | |
}, $b | |
p C.new.m | |
#=> "#<NoMethodError: no method named binding>\n" (expected ":ok\nok") | |
#123 test_eval.rb:65:in `<top (required)>': | |
b = proc{ | |
a = :ok | |
binding | |
}.call | |
a = :ng | |
eval("a", b) | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") | |
#124 test_eval.rb:73:in `<top (required)>': | |
class C | |
def foo | |
binding | |
end | |
end | |
C.new.foo.eval("self.class.to_s") | |
#=> "#<NoMethodError: no method named binding>\n" (expected "C") | |
#125 test_eval.rb:81:in `<top (required)>': | |
eval('1') | |
#=> "false" (expected "1") | |
#126 test_eval.rb:84:in `<top (required)>': | |
eval('a=1; a') | |
#=> "false" (expected "1") | |
#127 test_eval.rb:87:in `<top (required)>': | |
a = 1 | |
eval('a') | |
#=> "false" (expected "1") | |
#128 test_eval.rb:91:in `<top (required)>': | |
__send__ :eval, %{ | |
:ok | |
} | |
#=> "" (expected "ok") | |
#129 test_eval.rb:96:in `<top (required)>': | |
1.__send__ :instance_eval, %{ | |
:ok | |
} | |
#=> "" (expected "ok") | |
#130 test_eval.rb:101:in `<top (required)>': | |
1.instance_eval{ | |
self | |
} | |
#=> "" (expected "1") | |
#131 test_eval.rb:106:in `<top (required)>': | |
'foo'.instance_eval{ | |
self | |
} | |
#=> "" (expected "foo") | |
#132 test_eval.rb:111:in `<top (required)>': | |
class Fixnum | |
Const = 1 | |
end | |
1.instance_eval %{ | |
Const | |
} | |
#=> "" (expected "1") | |
#133 test_eval.rb:119:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
end | |
C.module_eval{ | |
Const | |
} | |
#=> "#<NoMethodError: no method named module_eval>\n" (expected "top") | |
#134 test_eval.rb:128:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
end | |
C.class_eval %{ | |
def m | |
Const | |
end | |
} | |
C.new.m | |
#=> "#<NoMethodError: no method named class_eval>\n" (expected "C") | |
#135 test_eval.rb:140:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
end | |
C.class_eval{ | |
def m | |
Const | |
end | |
} | |
C.new.m | |
#=> "#<NoMethodError: no method named class_eval>\n" (expected "top") | |
#136 test_eval.rb:152:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
end | |
$nest = false | |
$ans = [] | |
def m | |
$ans << Const | |
C.module_eval %{ | |
$ans << Const | |
Boo = false unless defined? Boo | |
unless $nest | |
$nest = true | |
m | |
end | |
} | |
end | |
m | |
$ans | |
#=> "#<NoMethodError: no method named module_eval>\n" (expected "[:top, :C, :top, :C]") | |
#137 test_eval.rb:173:in `<top (required)>': | |
$nested = false | |
$ans = [] | |
$pr = proc{ | |
$ans << self | |
unless $nested | |
$nested = true | |
$pr.call | |
end | |
} | |
class C | |
def initialize &b | |
10.instance_eval(&b) | |
end | |
end | |
C.new(&$pr) | |
$ans | |
#=> "#<NoMethodError: no method named proc>\n" (expected "[10, main]") | |
#138 test_eval.rb:193:in `block in <top (required)>': | |
begin | |
eval "0 rescue break" | |
rescue SyntaxError => e | |
e.message | |
end | |
#=> /Can't escape from eval with break\z/ expected to be =~ | |
"" [ruby-dev:31372] | |
#139 test_eval.rb:193:in `block in <top (required)>': | |
begin | |
eval "0 rescue next" | |
rescue SyntaxError => e | |
e.message | |
end | |
#=> /Can't escape from eval with next\z/ expected to be =~ | |
"" [ruby-dev:31372] | |
#140 test_eval.rb:193:in `block in <top (required)>': | |
begin | |
eval "0 rescue redo" | |
rescue SyntaxError => e | |
e.message | |
end | |
#=> /Can't escape from eval with redo\z/ expected to be =~ | |
"" [ruby-dev:31372] | |
#142 test_eval.rb:212:in `<top (required)>': | |
class Module | |
def my_module_eval(&block) | |
module_eval(&block) | |
end | |
end | |
class String | |
Integer.my_module_eval do | |
def hoge; end | |
end | |
end | |
if Integer.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) && | |
!String.instance_methods(false).map{|m|m.to_sym}.include?(:hoge) | |
:ok | |
else | |
:ng | |
end | |
#=> "#<NoMethodError: no method named module_eval>\n" (expected "ok") [ruby-dev:34236] | |
#143 test_eval.rb:231:in `<top (required)>': | |
begin | |
eval("class nil::Foo; end") | |
:ng | |
rescue Exception | |
:ok | |
end | |
#=> "" (expected "ok") | |
#144 test_eval.rb:240:in `<top (required)>': | |
begin | |
0.instance_eval { def m() :m end } | |
1.m | |
:ng | |
rescue Exception | |
:ok | |
end | |
#=> "true" (expected "ok") [ruby-dev:34579] | |
#145 test_eval.rb:250:in `<top (required)>': | |
begin | |
12.instance_eval { @@a } | |
rescue NameError | |
:ok | |
end | |
#=> "#<Proc:0x6ffbf8>" (expected "ok") [ruby-core:16794] | |
#146 test_eval.rb:258:in `<top (required)>': | |
begin | |
12.instance_exec { @@a } | |
rescue NameError | |
:ok | |
end | |
#=> "true" (expected "ok") [ruby-core:16794] | |
#147 test_eval.rb:266:in `<top (required)>': | |
begin | |
nil.instance_eval { | |
def a() :a end | |
} | |
rescue TypeError | |
:ok | |
end | |
#=> "#<Proc:0x6ffbf8>" (expected "ok") [ruby-core:16796] | |
#148 test_eval.rb:276:in `<top (required)>': | |
begin | |
nil.instance_exec { | |
def a() :a end | |
} | |
rescue TypeError | |
:ok | |
end | |
#=> "#<NoMethodError: no method named instance_exec>\n" (expected "ok") [ruby-core:16796] | |
#150 test_eval.rb:290:in `<top (required)>': | |
b = binding | |
10.times{ | |
eval('', b) | |
} | |
begin | |
eval('1.times{raise}', b) | |
rescue => e | |
e.message | |
end | |
#=> "#<NoMethodError: no method named binding>\n" (expected "") [ruby-dev:35392] | |
#151 test_eval.rb:302:in `<top (required)>': | |
def kaboom! | |
yield.eval("local_variables") | |
end | |
for x in enum_for(:kaboom!) | |
binding | |
end | |
#=> "#<NoMethodError: no method named enum_for>\n" (expected "[:x]") [ruby-core:25125] | |
#157 test_exception.rb:47:in `<top (required)>': core dumped | |
#159 test_exception.rb:61:in `<top (required)>': | |
begin | |
raise "FOO" | |
rescue | |
$! | |
end | |
#=> "" (expected "FOO") | |
#160 test_exception.rb:68:in `<top (required)>': | |
def m | |
$! | |
end | |
begin | |
raise "FOO" | |
rescue | |
m() | |
end | |
#=> "" (expected "FOO") | |
#161 test_exception.rb:78:in `<top (required)>': | |
$ans = [] | |
def m | |
$! | |
end | |
begin | |
raise "FOO" | |
rescue | |
begin | |
raise "BAR" | |
rescue | |
$ans << m() | |
end | |
$ans << m() | |
end | |
$ans | |
#=> "[nil, nil]" (expected "[#<RuntimeError: BAR>, #<RuntimeError: FOO>]") | |
#162 test_exception.rb:95:in `<top (required)>': | |
$ans = [] | |
def m | |
$! | |
end | |
begin | |
begin | |
raise "FOO" | |
ensure | |
$ans << m() | |
end | |
rescue | |
$ans << m() | |
end | |
#=> "" (expected "[#<RuntimeError: FOO>, #<RuntimeError: FOO>]") | |
#164 test_exception.rb:128:in `<top (required)>': core dumped | |
#165 test_exception.rb:135:in `<top (required)>': core dumped | |
#166 test_exception.rb:144:in `<top (required)>': core dumped | |
#167 test_exception.rb:151:in `<top (required)>': core dumped | |
#168 test_exception.rb:160:in `<top (required)>': | |
begin | |
begin | |
raise "a" | |
rescue | |
raise "b" | |
ensure | |
raise "c" | |
end | |
rescue => e | |
e.message | |
end | |
#=> "" (expected "c") | |
#169 test_exception.rb:173:in `<top (required)>': core dumped | |
#170 test_exception.rb:190:in `<top (required)>': core dumped | |
#171 test_exception.rb:205:in `<top (required)>': core dumped | |
#174 test_exception.rb:276:in `<top (required)>': | |
begin | |
1 | |
rescue | |
2 | |
end | |
#=> "#<Proc:0x6ffcf8>" (expected "1") | |
#175 test_exception.rb:283:in `<top (required)>': | |
begin | |
1 | |
begin | |
2 | |
rescue | |
3 | |
end | |
4 | |
rescue | |
5 | |
end | |
#=> "" (expected "4") | |
#177 test_exception.rb:305:in `<top (required)>': | |
begin | |
1+1 | |
rescue | |
2+2 | |
ensure | |
3+3 | |
end | |
#=> "" (expected "2") | |
#178 test_exception.rb:314:in `<top (required)>': | |
begin | |
1+1 | |
rescue | |
2+2 | |
ensure | |
3+3 | |
end | |
#=> "" (expected "2") | |
#181 test_exception.rb:352:in `<top (required)>': | |
proc{ | |
begin | |
raise | |
break | |
rescue | |
:ok | |
end | |
}.call | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") | |
#182 test_exception.rb:362:in `<top (required)>': | |
proc do | |
begin | |
raise StandardError | |
redo | |
rescue StandardError | |
end | |
end.call | |
#=> "#<NoMethodError: no method named proc>\n" (expected "") | |
#183 test_exception.rb:373:in `<top (required)>': | |
STDERR.reopen(STDOUT) | |
class C | |
def inspect | |
bar {} | |
end | |
def bar | |
raise | |
ensure | |
end | |
end | |
C.new.foo | |
#=> /undefined method `foo\'/ expected to be =~ | |
"#<NameError: uninitialized constant STDERR>\n" [ruby-dev:31407] | |
#184 test_exception.rb:388:in `<top (required)>': | |
doit = false | |
exc = nil | |
t = Thread.new { | |
begin | |
doit = true | |
sleep 10 | |
ensure | |
exc = $! | |
end | |
} | |
Thread.pass until doit | |
t.kill | |
t.join | |
exc.inspect | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "nil") [ruby-dev:32608] | |
#185 test_exception.rb:405:in `<top (required)>': core dumped [ruby-core:24767] | |
#191 test_flow.rb:24:in `<top (required)>': | |
unless ''.respond_to? :lines | |
class String | |
def lines | |
self | |
end | |
end | |
end | |
('a').lines.map{|e| | |
break :ok | |
} | |
#=> "#<NoMethodError: no method named map>\n" (expected "ok") | |
#193 test_flow.rb:43:in `<top (required)>': | |
('a'..'b').map{|e|; $a << 2 | |
break :ok; $a << 3 | |
}; $a << 4 | |
; $a << 5 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 99]" (expected "[1, 2, 4, 5]") | |
#195 test_flow.rb:58:in `<top (required)>': | |
i=0; $a << 2 | |
while i<3; $a << 3 | |
i+=1; $a << 4 | |
begin; $a << 5 | |
ensure; $a << 6 | |
break; $a << 7 | |
end; $a << 8 | |
end; $a << 9 | |
; $a << 10 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 4, 5, 6, 99]#<RuntimeError: unexpected break>\n" (expected "[1, 2, 3, 4, 5, 6, 9, 10]") | |
#196 test_flow.rb:69:in `<top (required)>': core dumped | |
#197 test_flow.rb:81:in `<top (required)>': core dumped | |
#198 test_flow.rb:93:in `<top (required)>': | |
[1,2].each do; $a << 2 | |
begin; $a << 3 | |
raise StandardError; $a << 4 | |
ensure; $a << 5 | |
break; $a << 6 | |
end; $a << 7 | |
end; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 99]" (expected "[1, 2, 3, 5, 8, 9]") | |
#201 test_flow.rb:125:in `<top (required)>': core dumped | |
#202 test_flow.rb:141:in `<top (required)>': core dumped | |
#203 test_flow.rb:159:in `<top (required)>': core dumped | |
#204 test_flow.rb:175:in `<top (required)>': core dumped | |
#205 test_flow.rb:193:in `<top (required)>': | |
while true; $a << 2 | |
begin; $a << 3 | |
break; $a << 4 | |
ensure; $a << 5 | |
break; $a << 6 | |
end; $a << 7 | |
end; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 5, 99][1, 2, 3, 5, 99, 8, 9]" (expected "[1, 2, 3, 5, 8, 9]") | |
#206 test_flow.rb:203:in `<top (required)>': core dumped | |
#208 test_flow.rb:227:in `<top (required)>': | |
begin; $a << 2 | |
raise StandardError; $a << 3 | |
ensure; $a << 4 | |
end; $a << 5 | |
; $a << 6 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 99]" (expected "[1, 2, 4, 99]") | |
#210 test_flow.rb:239:in `<top (required)>': | |
[1,2].each do; $a << 2 | |
begin; $a << 3 | |
break; $a << 4 | |
ensure; $a << 5 | |
raise StandardError; $a << 6 | |
end; $a << 7 | |
end; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 5, 99][1, 2, 3, 5, 99, 8, 9]" (expected "[1, 2, 3, 5, 99]") | |
#212 test_flow.rb:259:in `<top (required)>': | |
def m a, b | |
a + b | |
end | |
m(1, | |
(i=0; while i<2 | |
i+=1 | |
class C | |
next 2 | |
end | |
end; 3) | |
) | |
#=> "#<RuntimeError: unexpected next>\n" (expected "4") | |
#214 test_flow.rb:279:in `<top (required)>': | |
3.times{; $a << 2 | |
class C; $a << 3 | |
break; $a << 4 | |
end; $a << 5 | |
}; $a << 6 | |
; $a << 7 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 99]" (expected "[1, 2, 3, 6, 7]") | |
#215 test_flow.rb:287:in `<top (required)>': | |
3.times{; $a << 2 | |
class A; $a << 3 | |
class B; $a << 4 | |
break; $a << 5 | |
end; $a << 6 | |
end; $a << 7 | |
}; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 4, 99]" (expected "[1, 2, 3, 4, 8, 9]") | |
#216 test_flow.rb:297:in `<top (required)>': | |
3.times{; $a << 2 | |
class C; $a << 3 | |
next; $a << 4 | |
end; $a << 5 | |
}; $a << 6 | |
; $a << 7 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 99]" (expected "[1, 2, 3, 2, 3, 2, 3, 6, 7]") | |
#217 test_flow.rb:305:in `<top (required)>': | |
3.times{; $a << 2 | |
class C; $a << 3 | |
class D; $a << 4 | |
next; $a << 5 | |
end; $a << 6 | |
end; $a << 7 | |
}; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 4, 99]" (expected "[1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 8, 9]") | |
#218 test_flow.rb:315:in `<top (required)>': | |
while true; $a << 2 | |
class C; $a << 3 | |
break; $a << 4 | |
end; $a << 5 | |
end; $a << 6 | |
; $a << 7 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 99]" (expected "[1, 2, 3, 6, 7]") | |
#219 test_flow.rb:323:in `<top (required)>': | |
while true; $a << 2 | |
class C; $a << 3 | |
class D; $a << 4 | |
break; $a << 5 | |
end; $a << 6 | |
end; $a << 7 | |
end; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 4, 99]" (expected "[1, 2, 3, 4, 8, 9]") | |
#220 test_flow.rb:333:in `<top (required)>': | |
i=0; $a << 2 | |
while i<3; $a << 3 | |
i+=1; $a << 4 | |
class C; $a << 5 | |
next 10; $a << 6 | |
end; $a << 7 | |
end; $a << 8 | |
; $a << 9 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 2, 3, 4, 5, 99]" (expected "[1, 2, 3, 4, 5, 3, 4, 5, 3, 4, 5, 8, 9]") | |
#221 test_flow.rb:343:in `<top (required)>': | |
1.times{ | |
while true | |
class C | |
begin | |
break | |
ensure | |
break | |
end | |
end | |
end | |
} | |
#=> "#<RuntimeError: unexpected break>\n" (expected "1") | |
#225 test_flow.rb:384:in `<top (required)>': | |
def m(); $a << 2 | |
begin; $a << 3 | |
2; $a << 4 | |
ensure; $a << 5 | |
return 3; $a << 6 | |
end; $a << 7 | |
end; $a << 8 | |
m; $a << 9 | |
; $a << 10 | |
; rescue Exception; $a << 99; end; $a #=> "[1, 8, 2, 3, 4, 5, 7, 9, 10]" (expected "[1, 8, 2, 3, 4, 5, 9, 10]") | |
#226 test_flow.rb:395:in `<top (required)>': | |
def m2; $a << 2 | |
end; $a << 3 | |
def m(); $a << 4 | |
m2(begin; $a << 5 | |
2; $a << 6 | |
ensure; $a << 7 | |
return 3; $a << 8 | |
end); $a << 9 | |
4; $a << 10 | |
end; $a << 11 | |
m(); $a << 12 | |
; $a << 13 | |
; rescue Exception; $a << 99; end; $a #=> "" (expected "[1, 3, 11, 4, 5, 6, 7, 12, 13]") | |
#232 test_flow.rb:547:in `block in <top (required)>': | |
class Bug2728 | |
include Enumerable | |
define_method(:dynamic_method) do | |
"dynamically defined method" | |
end | |
def each | |
begin | |
yield :foo | |
ensure | |
dynamic_method | |
end | |
end | |
end | |
e = Bug2728.new | |
e.detect {true} #=> "#<NoMethodError: no method named define_method>\n" (expected "foo") [ruby-core:28129] | |
#233 test_flow.rb:548:in `block in <top (required)>': | |
class Bug2728 | |
include Enumerable | |
define_method(:dynamic_method) do | |
"dynamically defined method" | |
end | |
def each | |
begin | |
yield :foo | |
ensure | |
dynamic_method | |
end | |
end | |
end | |
e = Bug2728.new | |
e.any? {true} #=> "#<NoMethodError: no method named define_method>\n" (expected "true") [ruby-core:28129] | |
#234 test_flow.rb:549:in `block in <top (required)>': | |
class Bug2728 | |
include Enumerable | |
define_method(:dynamic_method) do | |
"dynamically defined method" | |
end | |
def each | |
begin | |
yield :foo | |
ensure | |
dynamic_method | |
end | |
end | |
end | |
e = Bug2728.new | |
e.all? {false} #=> "#<NoMethodError: no method named define_method>\n" (expected "false") [ruby-core:28129] | |
#235 test_flow.rb:550:in `block in <top (required)>': | |
class Bug2728 | |
include Enumerable | |
define_method(:dynamic_method) do | |
"dynamically defined method" | |
end | |
def each | |
begin | |
yield :foo | |
ensure | |
dynamic_method | |
end | |
end | |
end | |
e = Bug2728.new | |
e.include?(:foo) #=> "#<NoMethodError: no method named define_method>\n" (expected "true") [ruby-core:28129] | |
#236 test_flow.rb:547:in `block in <top (required)>': | |
class Bug2729 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc {}.call | |
end | |
end | |
end | |
e = Bug2729.new | |
e.detect {true} #=> "#<NoMethodError: no method named proc>\n" (expected "foo") [ruby-core:28132] | |
#237 test_flow.rb:548:in `block in <top (required)>': | |
class Bug2729 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc {}.call | |
end | |
end | |
end | |
e = Bug2729.new | |
e.any? {true} #=> "#<NoMethodError: no method named proc>\n" (expected "true") [ruby-core:28132] | |
#238 test_flow.rb:549:in `block in <top (required)>': | |
class Bug2729 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc {}.call | |
end | |
end | |
end | |
e = Bug2729.new | |
e.all? {false} #=> "#<NoMethodError: no method named proc>\n" (expected "false") [ruby-core:28132] | |
#239 test_flow.rb:550:in `block in <top (required)>': | |
class Bug2729 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc {}.call | |
end | |
end | |
end | |
e = Bug2729.new | |
e.include?(:foo) #=> "#<NoMethodError: no method named proc>\n" (expected "true") [ruby-core:28132] | |
#240 test_flow.rb:547:in `block in <top (required)>': | |
class Bug5234 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc | |
end | |
end | |
end | |
e = Bug5234.new | |
e.detect {true} #=> "#<NoMethodError: no method named proc>\n" (expected "foo") [ruby-core:39125] | |
#241 test_flow.rb:548:in `block in <top (required)>': | |
class Bug5234 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc | |
end | |
end | |
end | |
e = Bug5234.new | |
e.any? {true} #=> "#<NoMethodError: no method named proc>\n" (expected "true") [ruby-core:39125] | |
#242 test_flow.rb:549:in `block in <top (required)>': | |
class Bug5234 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc | |
end | |
end | |
end | |
e = Bug5234.new | |
e.all? {false} #=> "#<NoMethodError: no method named proc>\n" (expected "false") [ruby-core:39125] | |
#243 test_flow.rb:550:in `block in <top (required)>': | |
class Bug5234 | |
include Enumerable | |
def each | |
begin | |
yield :foo | |
ensure | |
proc | |
end | |
end | |
end | |
e = Bug5234.new | |
e.include?(:foo) #=> "#<NoMethodError: no method named proc>\n" (expected "true") [ruby-core:39125] | |
#244 test_fork.rb:1:in `<top (required)>': | |
begin | |
GC.stress = true | |
pid = fork {} | |
Process.wait pid | |
$?.to_i | |
rescue NotImplementedError | |
0 | |
end | |
#=> "#<NoMethodError: no method named stress=>\n" (expected "0") [ruby-dev:32404] | |
#247 test_fork.rb:30:in `<top (required)>': | |
begin | |
if pid1 = fork | |
sleep 1 | |
Process.kill("USR1", pid1) | |
_, s = Process.wait2(pid1) | |
s.success? ? :ok : :ng | |
else | |
if pid2 = fork | |
trap("USR1") { Time.now.to_s } | |
Process.wait2(pid2) | |
else | |
sleep 2 | |
end | |
exit 0 | |
end | |
rescue NotImplementedError | |
:ok | |
end | |
#=> "#<NoMethodError: no method named fork>\n" (expected "ok") [ruby-core:28924] | |
#248 test_fork.rb:51:in `<top (required)>': | |
a = [] | |
trap(:INT) { a.push(1) } | |
trap(:TERM) { a.push(2) } | |
pid = $$ | |
begin | |
fork do | |
sleep 0.5 | |
Process.kill(:INT, pid) | |
Process.kill(:TERM, pid) | |
end | |
sleep 1 | |
a.sort | |
rescue NotImplementedError | |
[1, 2] | |
end | |
#=> "#<NoMethodError: no method named trap>\n" (expected "[1, 2]") [ruby-dev:44005] [Ruby 1.9 - Bug #4950] | |
#254 test_io.rb:44:in `<top (required)>': | |
require 'tmpdir' | |
begin | |
tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}" | |
rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL) | |
rescue Errno::EEXIST | |
retry | |
end | |
save = STDIN.dup | |
STDIN.reopen(rw) | |
STDIN.reopen(save) | |
rw.close | |
File.unlink(tmpname) | |
:ok | |
#=> "#<NameError: uninitialized constant Dir>\n" (expected "ok") | |
#255 test_io.rb:60:in `<top (required)>': | |
require 'tmpdir' | |
begin | |
tmpname = "#{Dir.tmpdir}/ruby-btest-#{$$}-#{rand(0x100000000).to_s(36)}" | |
rw = File.open(tmpname, File::RDWR|File::CREAT|File::EXCL) | |
rescue Errno::EEXIST | |
retry | |
end | |
save = STDIN.dup | |
STDIN.reopen(rw) | |
STDIN.print "a" | |
STDIN.reopen(save) | |
rw.close | |
File.unlink(tmpname) | |
:ok | |
#=> "#<NameError: uninitialized constant Dir>\n" (expected "ok") | |
#261 test_jump.rb:25:in `<top (required)>': | |
catch(:foo){ | |
throw :foo | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "") | |
#262 test_jump.rb:30:in `<top (required)>': | |
catch(:foo){ | |
throw :foo, false | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "false") | |
#263 test_jump.rb:35:in `<top (required)>': | |
catch(:foo){ | |
throw :foo, nil | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "") | |
#264 test_jump.rb:40:in `<top (required)>': | |
catch(:foo){ | |
throw :foo, :ok | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "ok") | |
#265 test_jump.rb:45:in `<top (required)>': | |
catch(:foo){ | |
1.times{ | |
throw :foo | |
} | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "") | |
#266 test_jump.rb:52:in `<top (required)>': | |
catch(:foo){ | |
1.times{ | |
throw :foo, :ok | |
} | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "ok") | |
#267 test_jump.rb:59:in `<top (required)>': | |
catch(:foo){ | |
catch(:bar){ | |
throw :foo, :ok | |
} | |
:ng | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "ok") | |
#268 test_jump.rb:67:in `<top (required)>': | |
catch(:foo){ | |
catch(:bar){ | |
1.times{ | |
throw :foo, :ok | |
} | |
} | |
:ng | |
} | |
#=> "#<NoMethodError: no method named catch>\n" (expected "ok") | |
#269 test_jump.rb:77:in `<top (required)>': | |
module Enumerable | |
def all_? | |
self.each{|e| | |
unless yield(e) | |
return false | |
end | |
} | |
true | |
end | |
end | |
xxx = 0 | |
[1,2].each{|bi| | |
[3,4].each{|bj| | |
[true, nil, true].all_?{|be| be} | |
break | |
} | |
xxx += 1 | |
} | |
xxx | |
#=> "#<NoMethodError: no method named call>\n" (expected "2") | |
#270 test_jump.rb:99:in `<top (required)>': | |
def m | |
yield | |
end | |
m{ | |
begin | |
ensure | |
break :ok | |
end | |
} | |
#=> "#<RuntimeError: unexpected break>\n" (expected "ok") | |
#273 test_jump.rb:135:in `<top (required)>': | |
def m | |
yield + 10 | |
end | |
i=0 | |
m{ | |
if i>10 | |
i*i | |
else | |
i+=1 | |
redo | |
end | |
} | |
#=> "#<NoMethodError: no method named +>\n" (expected "131") | |
#274 test_jump.rb:149:in `<top (required)>': | |
begin | |
eval %q{ | |
1.times{ | |
retry | |
} | |
} | |
rescue SyntaxError | |
:ok | |
end | |
#=> "" (expected "ok") | |
#278 test_jump.rb:200:in `<top (required)>': core dumped | |
#279 test_jump.rb:211:in `<top (required)>': core dumped | |
#281 test_jump.rb:233:in `<top (required)>': | |
begin | |
catch {|t| throw t, :ok } | |
rescue ArgumentError | |
:ng | |
end | |
#=> "#<NoMethodError: no method named catch>\n" (expected "ok") [ruby-dev:31609] | |
#282 test_jump.rb:241:in `<top (required)>': | |
catch do |t| | |
begin | |
throw t, 1 | |
2 | |
ensure | |
3 | |
end | |
end | |
#=> "#<NoMethodError: no method named catch>\n" (expected "1") [ruby-dev:31698] | |
#284 test_jump.rb:273:in `<top (required)>': | |
-> do | |
1.times do | |
begin | |
raise | |
rescue | |
return | |
end | |
end | |
end.call | |
#=> killed by SIGSEGV (signal 11) | |
#285 test_jump.rb:284:in `<top (required)>': | |
while true | |
begin | |
raise | |
next | |
rescue | |
end | |
break | |
end | |
#=> killed by SIGSEGV (signal 11) [ruby-core:28172] | |
#286 test_jump.rb:286:in `<top (required)>': | |
class Object | |
def return_eigenclass | |
class << self | |
return self | |
end | |
end | |
end | |
s = "foo" | |
s.return_eigenclass == class << s; self; end | |
#=> "false" (expected "true") [ruby-core:21379] | |
#287 test_jump.rb:298:in `<top (required)>': core dumped [ruby-dev:40975] | |
#311 test_literal.rb:27:in `<top (required)>': 123456789012345678901234567890 #=> "-1" (expected "123456789012345678901234567890") | |
#312 test_literal.rb:28:in `<top (required)>': 123456789012345678901234567890.class #=> "Fixnum" (expected "Bignum") | |
#315 test_literal.rb:33:in `<top (required)>': self #=> "" (expected "main") | |
#316 test_literal.rb:34:in `<top (required)>': self.class #=> "NilClass" (expected "Object") | |
#333 test_literal.rb:53:in `<top (required)>': "\1" #=> "\u0000" (expected "\x01") | |
#337 test_literal.rb:59:in `<top (required)>': "#{2 ** 4}" #=> "#<NoMethodError: no method named **>\n" (expected "16") | |
#339 test_literal.rb:63:in `<top (required)>': :"a#{1+2}c" #=> "" (expected "a3c") | |
#340 test_literal.rb:64:in `<top (required)>': :"a#{1+2}c".inspect #=> "" (expected ":a3c") | |
#341 test_literal.rb:65:in `<top (required)>': :"a#{1+2}c".class #=> "" (expected "Symbol") | |
#342 test_literal.rb:68:in `<top (required)>': `echo foo` #=> "" (expected "foo\n") | |
#343 test_literal.rb:69:in `<top (required)>': s = "foo"; `echo #{s}` #=> "" (expected "foo\n") | |
#345 test_literal.rb:73:in `<top (required)>': //.class #=> "" (expected "Regexp") | |
#346 test_literal.rb:74:in `<top (required)>': // =~ "a" #=> "" (expected "0") | |
#347 test_literal.rb:75:in `<top (required)>': // =~ "" #=> "" (expected "0") | |
#348 test_literal.rb:76:in `<top (required)>': /a/.source #=> "" (expected "a") | |
#349 test_literal.rb:77:in `<top (required)>': /a/.class #=> "" (expected "Regexp") | |
#350 test_literal.rb:78:in `<top (required)>': /a/ =~ "a" #=> "" (expected "0") | |
#351 test_literal.rb:79:in `<top (required)>': /test/ =~ "test" #=> "" (expected "0") | |
#353 test_literal.rb:81:in `<top (required)>': re = /test/; re =~ "test" #=> "" (expected "0") | |
#354 test_literal.rb:82:in `<top (required)>': str = "test"; /test/ =~ str #=> "" (expected "0") | |
#355 test_literal.rb:83:in `<top (required)>': re = /test/; str = "test"; re =~ str #=> "" (expected "0") | |
#356 test_literal.rb:86:in `<top (required)>': /re#{'ge'}xp/.source #=> "" (expected "regexp") | |
#357 test_literal.rb:87:in `<top (required)>': /re#{'ge'}xp/.class #=> "" (expected "Regexp") | |
#377 test_literal.rb:109:in `<top (required)>': ([0][0] += 1) #=> "[1]" (expected "1") | |
#378 test_literal.rb:110:in `<top (required)>': ([2][0] -= 1) #=> "[1]" (expected "1") | |
#383 test_literal.rb:115:in `<top (required)>': core dumped | |
#384 test_literal.rb:116:in `<top (required)>': core dumped | |
#385 test_literal.rb:117:in `<top (required)>': core dumped | |
#433 test_literal.rb:174:in `<top (required)>': | |
# this cause "called on terminated object". | |
ObjectSpace.each_object(Module) {|m| m.name.inspect } | |
:ok | |
#=> "#<NameError: uninitialized constant ObjectSpace>\n" (expected "ok") | |
#436 test_literal.rb:196:in `<top (required)>': | |
"#{}""#{}ok" | |
#=> "" (expected "ok") [ruby-dev:38968] | |
#437 test_literal.rb:200:in `<top (required)>': | |
"#{}o""#{}k""#{}" | |
#=> "" (expected "ok") [ruby-core:25284] | |
#439 test_literal.rb:210:in `<top (required)>': core dumped | |
#442 test_load.rb:1:in `<top (required)>': | |
open("require-lock-test.rb", "w") {|f| | |
f.puts "sleep 0.1" | |
f.puts "module M" | |
f.puts "end" | |
} | |
$:.unshift Dir.pwd | |
vs = (1..2).map {|i| | |
Thread.start { | |
require "require-lock-test" | |
M | |
} | |
}.map {|t| t.value } | |
vs[0] == M && vs[1] == M ? :ok : :ng | |
#=> "#<NoMethodError: no method named open>\n" (expected "ok") [ruby-dev:32048] | |
#443 test_load.rb:17:in `<top (required)>': | |
%w[a a/foo b].each {|d| Dir.mkdir(d)} | |
open("b/foo", "w") {|f| f.puts "$ok = :ok"} | |
$:.replace(%w[a b]) | |
begin | |
load "foo" | |
$ok | |
rescue => e | |
e.message | |
end | |
#=> "" (expected "ok") [ruby-dev:38097] | |
#445 test_massign.rb:1:in `<top (required)>': *v1, (a, b) = [1,[2, 3]]; [v1, a, b] #=> "unknown lhs 7515912\n[[1], nil, nil]" (expected "[[1], 2, 3]") | |
#446 test_massign.rb:2:in `<top (required)>': *v1,(*), (a, b) = [1,:x,[2, 3]]; [v1, a, b] #=> "unknown lhs 0\nunknown lhs 7515976\n[[1], nil, nil]" (expected "[[1], 2, 3]") | |
#447 test_massign.rb:4:in `<top (required)>': core dumped | |
#448 test_massign.rb:5:in `<top (required)>': *a = nil; a #=> "[]" (expected "[nil]") | |
#451 test_massign.rb:8:in `<top (required)>': | |
ans = [] | |
trace_var(:$a){|v| ans << v} | |
trace_var(:$b){|v| ans << v} | |
$a, $b = 1, 2 | |
ans | |
#=> "#<NoMethodError: no method named trace_var>\n" (expected "[1, 2]") | |
#452 test_massign.rb:16:in `<top (required)>': | |
r = :ok | |
:ng.tap {|(r)|} | |
r | |
#=> "#<NoMethodError: no method named tap>\n" (expected "ok") [ruby-dev:31507] | |
#477 test_massign.rb:165:in `<top (required)>': | |
a,s=[],"aaa" | |
300.times { a<<s; s=s.succ } | |
eval <<-END__ | |
GC.stress=true | |
Fiber.new do | |
#{ a.join(",") },*zzz=1 | |
end.resume | |
END__ | |
:ok | |
#=> "#<NoMethodError: no method named succ>\n" (expected "ok") [ruby-dev:32581] | |
#478 test_massign.rb:177:in `<top (required)>': | |
while true | |
*, z = 1 | |
break | |
end | |
:ok | |
#=> "unknown lhs 83\nok" (expected "ok") [ruby-dev:32892] | |
#483 test_method.rb:6:in `<top (required)>': | |
def m; end | |
begin | |
m(1) | |
rescue => e | |
e.message | |
end | |
#=> "" (expected "wrong number of arguments (1 for 0)") | |
#484 test_method.rb:15:in `<top (required)>': | |
def m a; end | |
begin | |
m | |
rescue => e | |
e.message | |
end | |
#=> "" (expected "wrong number of arguments (0 for 1)") | |
#588 test_method.rb:207:in `<top (required)>': | |
def m() end | |
undef m | |
end | |
begin C.new.m; rescue NoMethodError; 1 end #=> "true" (expected "1") | |
#589 test_method.rb:212:in `<top (required)>': | |
def m() end | |
end | |
class C < A | |
def m() end | |
undef m | |
end | |
begin C.new.m; rescue NoMethodError; 1 end #=> "true" (expected "1") | |
#590 test_method.rb:220:in `<top (required)>': core dumped | |
#591 test_method.rb:226:in `<top (required)>': core dumped | |
#592 test_method.rb:233:in `<top (required)>': | |
def m1 | |
1 | |
end | |
alias m2 m1 | |
alias :"#{'m3'}" m1 | |
m1 + m2 + m3 | |
#=> "" (expected "3") [ruby-dev:32308] | |
#594 test_method.rb:247:in `<top (required)>': | |
def foobar | |
1 | |
end | |
alias :"bar#{:baz}" :"foo#{:bar}" | |
barbaz | |
#=> "#<NoMethodError: no method named barbaz\n>\n" (expected "1") [ruby-dev:32308] | |
#595 test_method.rb:256:in `<top (required)>': | |
def m() mm() end | |
def mm() 1 end | |
private :mm | |
end | |
C.new.m #=> "#<NoMethodError: no method named private>\n" (expected "1") | |
#596 test_method.rb:262:in `<top (required)>': | |
def m() 7 end | |
private :m | |
end | |
begin C.m; rescue NoMethodError; 1 end #=> "#<NoMethodError: no method named private>\n" (expected "1") | |
#597 test_method.rb:267:in `<top (required)>': | |
def C.m() mm() end | |
def C.mm() 1 end | |
private_class_method :mm | |
end | |
C.m #=> "#<NoMethodError: no method named private_class_method>\n" (expected "1") | |
#598 test_method.rb:273:in `<top (required)>': | |
def C.m() 7 end | |
private_class_method :m | |
end | |
begin C.m; rescue NoMethodError; 1 end #=> "#<NoMethodError: no method named private_class_method>\n" (expected "1") | |
#599 test_method.rb:278:in `<top (required)>': | |
C.new.m # cache | |
class C | |
alias mm m; private :mm | |
end | |
C.new.m | |
begin C.new.mm; 7; rescue NoMethodError; 1 end #=> "#<NoMethodError: no method named private>\n" (expected "1") | |
#601 test_method.rb:294:in `<top (required)>': | |
def m | |
def mm() 1 end | |
end | |
end | |
instance_eval "C.new.m; C.new.mm" #=> "" (expected "1") | |
#607 test_method.rb:324:in `<top (required)>': C.new.__send__(:m) #=> "" (expected "1") | |
#608 test_method.rb:326:in `<top (required)>': C.new.send(:m) #=> "" (expected "1") | |
#609 test_method.rb:328:in `<top (required)>': C.new.send(:m,1) #=> "" (expected "1") | |
#610 test_method.rb:330:in `<top (required)>': C.new.send(:m,1,7) #=> "" (expected "1") | |
#611 test_method.rb:332:in `<top (required)>': C.new.send(:m,7) #=> "" (expected "1") | |
#612 test_method.rb:334:in `<top (required)>': C.new.send(:m,7,1) #=> "" (expected "1") | |
#613 test_method.rb:336:in `<top (required)>': C.new.send(:m,1,2).inspect #=> "nil" (expected "[1, 2]") | |
#614 test_method.rb:338:in `<top (required)>': begin C.new.public_send(:m); rescue NoMethodError; 1 end #=> "#<NoMethodError: no method named private>\n" (expected "1") | |
#615 test_method.rb:340:in `<top (required)>': C.new.send(:m) #=> "#<NoMethodError: no method named private>\n" (expected "1") | |
#618 test_method.rb:378:in `<top (required)>': core dumped | |
#619 test_method.rb:406:in `<top (required)>': class Foo;def []=(a,b,c,d);end;end;Foo.new[1,*a=[2,3]]=4 #=> "[1, 2, 3, 4]" (expected "4") | |
#620 test_method.rb:407:in `<top (required)>': class Foo;def []=(a,b,c,d);end;end;def m(&blk)Foo.new[1,*a=[2,3],&blk]=4;end;m{} #=> "[1, 2, 3, 4]" (expected "4") | |
#626 test_method.rb:445:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8, 9) #=> "[1, 2, 3, 4, [5, 6, 7], 8, 9, NilClass, 9, nil]" (expected "[1, 2, 3, 4, [5, 6, 7], 8, 9, NilClass, nil, nil]") | |
#627 test_method.rb:452:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) #=> "[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, NilClass, 9, 10]" (expected "[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, NilClass, nil, nil]") | |
#628 test_method.rb:459:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) #=> "[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, NilClass, 9, 10]" (expected "[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, NilClass, nil, nil]") | |
#633 test_method.rb:494:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8){} #=> "[1, 2, 3, 4, [5, 6], 7, 8, Proc, #<Proc:0x6ffbb8>, nil]" (expected "[1, 2, 3, 4, [5, 6], 7, 8, Proc, nil, nil]") | |
#634 test_method.rb:501:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8, 9){} #=> "[1, 2, 3, 4, [5, 6, 7], 8, 9, Proc, 9, #<Proc:0x6ffbb8>]" (expected "[1, 2, 3, 4, [5, 6, 7], 8, 9, Proc, nil, nil]") | |
#635 test_method.rb:508:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10){} #=> "[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, Proc, 9, 10]" (expected "[1, 2, 3, 4, [5, 6, 7, 8], 9, 10, Proc, nil, nil]") | |
#636 test_method.rb:515:in `<top (required)>': | |
def m(m1, m2, o1=:o1, o2=:o2, *r, p1, p2, &b) | |
x, y = :x, :y if $foo | |
[m1, m2, o1, o2, r, p1, p2, b.class, x, y] | |
end | |
; m(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11){} #=> "[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, Proc, 9, 10]" (expected "[1, 2, 3, 4, [5, 6, 7, 8, 9], 10, 11, Proc, nil, nil]") | |
#681 test_method.rb:889:in `<top (required)>': core dumped | |
#682 test_method.rb:933:in `<top (required)>': | |
class C | |
def x=(n) | |
end | |
def m | |
self.x = :ok | |
end | |
end | |
C.new.m | |
#=> "#<C:0x6ffab8>" (expected "ok") | |
#683 test_method.rb:944:in `<top (required)>': | |
proc{ | |
$SAFE = 1 | |
class C | |
def m | |
:ok | |
end | |
end | |
}.call | |
C.new.m | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") [ruby-core:11998] | |
#684 test_method.rb:956:in `<top (required)>': | |
proc{ | |
$SAFE = 2 | |
class C | |
def m | |
:ok | |
end | |
end | |
}.call | |
C.new.m | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") [ruby-core:11998] | |
#685 test_method.rb:968:in `<top (required)>': | |
proc{ | |
$SAFE = 3 | |
class C | |
def m | |
:ng | |
end | |
end | |
}.call | |
begin | |
C.new.m | |
rescue SecurityError | |
:ok | |
end | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") [ruby-core:11998] | |
#686 test_method.rb:984:in `<top (required)>': | |
class B | |
def m() :fail end | |
end | |
class C < B | |
undef m | |
begin | |
remove_method :m | |
rescue NameError | |
end | |
end | |
begin | |
C.new.m | |
rescue NameError | |
:ok | |
end | |
#=> "true" (expected "ok") [ruby-dev:31816], [ruby-dev:31817] | |
#688 test_method.rb:1014:in `<top (required)>': | |
class Module | |
def define_method2(name, &block) | |
define_method(name, &block) | |
end | |
end | |
class C | |
define_method2(:m) {|x, y| :fail } | |
end | |
begin | |
C.new.m([1,2]) | |
rescue ArgumentError | |
:ok | |
end | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "ok") | |
#690 test_method.rb:1035:in `<top (required)>': | |
class C | |
define_method(:foo) { | |
block_given? | |
} | |
end | |
C.new.foo {} | |
class D | |
def foo | |
D.module_eval{ | |
define_method(:m1){ | |
block_given? | |
} | |
} | |
end | |
def bar | |
D.module_eval{ | |
define_method(:m2){ | |
block_given? | |
} | |
} | |
end | |
end | |
D.new.foo | |
D.new.bar{} | |
[C.new.foo, C.new.foo{}, D.new.m1, D.new.m1{}, D.new.m2, D.new.m2{}] | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "[false, false, false, false, true, true]") [ruby-core:14813] | |
#691 test_method.rb:1066:in `<top (required)>': | |
class Foo | |
define_method(:foo) do |&b| | |
b.call | |
end | |
end | |
Foo.new.foo do | |
break :ok | |
end | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "ok") [ruby-dev:36028] | |
#694 test_method.rb:1092:in `<top (required)>': | |
class A | |
def m | |
'A' | |
end | |
end | |
class B < A | |
define_method(:m) do | |
['B', super()] | |
end | |
end | |
class C < B | |
end | |
C.new.m | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "[\"B\", \"A\"]") | |
#695 test_method.rb:1111:in `<top (required)>': | |
module Foo | |
def foo | |
begin | |
super | |
rescue NoMethodError | |
:ok | |
end | |
end | |
module_function :foo | |
end | |
Foo.foo | |
#=> "#<NoMethodError: no method named module_function>\n" (expected "ok") [ruby-dev:37587] | |
#696 test_method.rb:1125:in `<top (required)>': | |
class Object | |
def self.foo | |
"Object.foo" | |
end | |
def foo | |
"Object#foo" | |
end | |
end | |
module Foo | |
def foo | |
begin | |
super | |
rescue NoMethodError | |
:ok | |
end | |
end | |
module_function :foo | |
end | |
Foo.foo | |
#=> "#<NoMethodError: no method named module_function>\n" (expected "Object#foo") [ruby-dev:37587] | |
#698 test_method.rb:1159:in `<top (required)>': | |
"hello"[0] ||= "H" | |
"ok" | |
#=> "#<NoMethodError: no method named ||>\n" (expected "ok") | |
#699 test_method.rb:1164:in `<top (required)>': | |
"hello"[0, 1] ||= "H" | |
"ok" | |
#=> "#<NoMethodError: no method named ||>\n" (expected "ok") | |
#700 test_method.rb:1169:in `<top (required)>': | |
class C | |
define_method(:foo) do | |
C.class_eval { remove_method(:foo) } | |
super() | |
end | |
end | |
begin | |
C.new.foo | |
rescue NoMethodError | |
'ok' | |
end | |
#=> "#<NoMethodError: no method named define_method>\n" (expected "ok") | |
#701 test_method.rb:1182:in `<top (required)>': | |
[0][0, &proc{}] += 21 | |
'ok' | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") [ruby-core:30534] | |
#709 test_proc.rb:38:in `<top (required)>': | |
class C | |
def foo | |
:ok | |
end | |
end | |
def block | |
C.method(:new).to_proc | |
end | |
b = block() | |
b.call.foo | |
#=> "#<NoMethodError: no method named method>\n" (expected "ok") | |
#715 test_proc.rb:170:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
$pr = proc{ | |
(1..2).map{ | |
Const | |
} | |
} | |
end | |
$pr.call | |
#=> "#<NoMethodError: no method named proc>\n" (expected "[:C, :C]") | |
#716 test_proc.rb:182:in `<top (required)>': | |
Const = :top | |
class C | |
Const = :C | |
end | |
pr = proc{ | |
Const | |
} | |
C.class_eval %q{ | |
pr.call | |
} | |
#=> "#<NoMethodError: no method named proc>\n" (expected "top") | |
#720 test_proc.rb:219:in `<top (required)>': | |
[ | |
Proc.new{|a, *b| [a, b]}.call(), | |
Proc.new{|a, *b| [a, b]}.call(1), | |
Proc.new{|a, *b| [a, b]}.call(1, 2), | |
Proc.new{|a, *b| [a, b]}.call(1, 2, 3), | |
] | |
#=> "[[nil, [[]]], [1, []], [1, [2]], [1, [2, 3]]]" (expected "[[nil, []], [1, []], [1, [2]], [1, [2, 3]]]") | |
#721 test_proc.rb:227:in `<top (required)>': | |
pr = proc{ | |
$SAFE | |
} | |
$SAFE = 1 | |
pr.call | |
#=> "#<NoMethodError: no method named proc>\n" (expected "0") | |
#722 test_proc.rb:234:in `<top (required)>': | |
pr = proc{ | |
$SAFE += 1 | |
} | |
[pr.call, $SAFE] | |
#=> "#<NoMethodError: no method named proc>\n" (expected "[1, 0]") | |
#725 test_proc.rb:256:in `<top (required)>': | |
class A; def get_block; proc {puts "ok"} end end | |
block = A.new.get_block | |
GC.start | |
block.call | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok\n") [ruby-core:14885] | |
#726 test_proc.rb:263:in `<top (required)>': | |
a = lambda {|x, y, &b| b } | |
b = a.curry[1] | |
if b.call(2){} == nil | |
:ng | |
else | |
:ok | |
end | |
#=> "#<NoMethodError: no method named curry>\n" (expected "ok") [ruby-core:15551] | |
#728 test_proc.rb:280:in `<top (required)>': core dumped [ ruby-Bugs-19304 ] | |
#730 test_proc.rb:306:in `<top (required)>': | |
lambda { a = lambda { return }; $x = :ng; a[]; $x = :ok }.call | |
$x | |
#=> "ng" (expected "ok") [ruby-core:17164] | |
#736 test_proc.rb:360:in `<top (required)>': | |
def def12 | |
b = Proc.new { $x = :ng; lambda { return }.call; $x = :ok }.call | |
end | |
def12 | |
$x | |
#=> "ng" (expected "ok") [ruby-core:17164] | |
#737 test_proc.rb:368:in `<top (required)>': | |
def m | |
pr = proc{ | |
proc{ | |
return :ok | |
} | |
}.call | |
pr.call | |
:ng | |
end | |
m() | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") | |
#738 test_proc.rb:381:in `<top (required)>': | |
class Foo | |
def call_it | |
p = Proc.new | |
p.call | |
end | |
end | |
def give_it | |
proc { :ok } | |
end | |
f = Foo.new | |
a_proc = give_it | |
f.call_it(&give_it()) | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") [ruby-core:15711] | |
#740 test_proc.rb:422:in `<top (required)>': | |
o = Object.new | |
def o.write(s); end | |
$stderr = o | |
at_exit{ | |
print $!.message | |
} | |
raise "ok" | |
#=> "#<NoMethodError: no method named at_exit>\n" (expected "ok") | |
#741 test_proc.rb:432:in `<top (required)>': | |
lambda do | |
class A | |
class B | |
proc{return :ng}.call | |
end | |
end | |
end.call | |
:ok | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") | |
#742 test_proc.rb:443:in `<top (required)>': | |
$proc = proc{return} | |
begin | |
lambda do | |
class A | |
class B | |
$proc.call | |
end | |
end | |
end.call | |
:ng | |
rescue LocalJumpError | |
:ok | |
end | |
#=> "#<NoMethodError: no method named proc>\n" (expected "ok") | |
#754 test_syntax.rb:11:in `<top (required)>': | |
case 1 | |
when 2 | |
:ng | |
end #=> "false" (expected "") | |
#755 test_syntax.rb:16:in `<top (required)>': | |
case 1 | |
when 10,20,30 | |
:ng1 | |
when 1,2,3 | |
:ok | |
when 100,200,300 | |
:ng2 | |
else | |
:elseng | |
end #=> "" (expected "ok") | |
#756 test_syntax.rb:27:in `<top (required)>': | |
case 123 | |
when 10,20,30 | |
:ng1 | |
when 1,2,3 | |
:ng2 | |
when 100,200,300 | |
:ng3 | |
else | |
:elseok | |
end | |
#=> "123" (expected "elseok") | |
#757 test_syntax.rb:39:in `<top (required)>': | |
case 'test' | |
when /testx/ | |
:ng1 | |
when /test/ | |
:ok | |
when /tetxx/ | |
:ng2 | |
else | |
:ng_else | |
end | |
#=> "" (expected "ok") | |
#758 test_syntax.rb:51:in `<top (required)>': | |
case Object.new | |
when Object | |
:ok | |
end | |
#=> "true" (expected "ok") | |
#759 test_syntax.rb:57:in `<top (required)>': | |
case Object | |
when Object.new | |
:ng | |
else | |
:ok | |
end | |
#=> "Object" (expected "ok") | |
#760 test_syntax.rb:65:in `<top (required)>': | |
case 'test' | |
when 'tes' | |
:ng | |
when 'te' | |
:ng | |
else | |
:ok | |
end | |
#=> "test" (expected "ok") | |
#761 test_syntax.rb:75:in `<top (required)>': | |
case 'test' | |
when 'tes' | |
:ng | |
when 'te' | |
:ng | |
when 'test' | |
:ok | |
end | |
#=> "true" (expected "ok") | |
#762 test_syntax.rb:85:in `<top (required)>': | |
case 'test' | |
when 'tes' | |
:ng | |
when /te/ | |
:ng | |
else | |
:ok | |
end | |
#=> "" (expected "ng") | |
#763 test_syntax.rb:95:in `<top (required)>': | |
case 'test' | |
when 'tes' | |
:ng | |
when /test/ | |
:ok | |
else | |
:ng | |
end | |
#=> "" (expected "ok") | |
#765 test_syntax.rb:116:in `<top (required)>': | |
ary = [1, 2] | |
case 1 | |
when *ary | |
:ok | |
else | |
:ng | |
end | |
#=> "1" (expected "ok") | |
#766 test_syntax.rb:125:in `<top (required)>': | |
ary = [1, 2] | |
case 3 | |
when *ary | |
:ng | |
else | |
:ok | |
end | |
#=> "3" (expected "ok") | |
#767 test_syntax.rb:134:in `<top (required)>': | |
ary = [1, 2] | |
case 1 | |
when :x, *ary | |
:ok | |
when :z | |
:ng1 | |
else | |
:ng2 | |
end | |
#=> "1" (expected "ok") | |
#768 test_syntax.rb:145:in `<top (required)>': | |
ary = [1, 2] | |
case 3 | |
when :x, *ary | |
:ng1 | |
when :z | |
:ng2 | |
else | |
:ok | |
end | |
#=> "3" (expected "ok") | |
#769 test_syntax.rb:156:in `<top (required)>': | |
def make_perm ary, num | |
if num == 1 | |
ary.map{|e| [e]} | |
else | |
base = make_perm(ary, num-1) | |
res = [] | |
base.each{|b| | |
ary.each{|e| | |
res << [e] + b | |
} | |
} | |
res | |
end | |
end | |
def each_test | |
conds = make_perm(['fv', 'tv'], 3) | |
bangs = make_perm(['', '!'], 3) | |
exprs = make_perm(['and', 'or'], 3) | |
['if', 'unless'].each{|syn| | |
conds.each{|cs| | |
bangs.each{|bs| | |
exprs.each{|es| | |
yield(syn, cs, bs, es) | |
} | |
} | |
} | |
} | |
end | |
fv = false | |
tv = true | |
$ans = [] | |
each_test{|syn, conds, bangs, exprs| | |
c1, c2, c3 = conds | |
bang1, bang2, bang3 = bangs | |
e1, e2 = exprs | |
eval %Q{ | |
#{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3} | |
$ans << :then | |
else | |
$ans << :false | |
end | |
} | |
} | |
each_test{|syn, conds, bangs, exprs| | |
c1, c2, c3 = conds | |
bang1, bang2, bang3 = bangs | |
e1, e2 = exprs | |
eval %Q{ | |
#{syn} #{bang1}#{c1} #{e1} #{bang2}#{c2} #{e2} #{bang3}#{c3} | |
$ans << :then | |
end | |
$ans << :sep | |
} | |
} | |
$ans | |
#=> "#<NoMethodError: no method named call>\n" (expected "[:false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :false, :false, :false, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :then, :false, :then, :then, :then, :false, :false, :false, :false, :false, :false, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :false, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :false, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :false, :then, :then, :then, :then, :then, :then, :then, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep, :then, :sep]") | |
#770 test_syntax.rb:218:in `<top (required)>': | |
defined?(m) | |
#=> "#<NoMethodError: no method named m>\n" (expected "") | |
#771 test_syntax.rb:221:in `<top (required)>': | |
def m | |
end | |
defined?(m) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "method") | |
#772 test_syntax.rb:226:in `<top (required)>': | |
defined?(a.class) | |
#=> "#<NoMethodError: no method named a>\n" (expected "") | |
#773 test_syntax.rb:229:in `<top (required)>': | |
a = 1 | |
defined?(a.class) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "method") | |
#774 test_syntax.rb:233:in `<top (required)>': | |
class C | |
def test | |
[defined?(m1()), defined?(self.m1), defined?(C.new.m1), | |
defined?(m2()), defined?(self.m2), defined?(C.new.m2), | |
defined?(m3()), defined?(self.m3), defined?(C.new.m3)] | |
end | |
def m1 | |
end | |
private | |
def m2 | |
end | |
protected | |
def m3 | |
end | |
end | |
C.new.test + [defined?(C.new.m3)] | |
#=> "#<NoMethodError: no method named private>\n" (expected "[\"method\", \"method\", \"method\", \"method\", nil, nil, \"method\", \"method\", \"method\", nil]") | |
#775 test_syntax.rb:251:in `<top (required)>': | |
$ans = [defined?($1), defined?($2), defined?($3), defined?($4)] | |
/(a)(b)/ =~ 'ab' | |
$ans + [defined?($1), defined?($2), defined?($3), defined?($4)] | |
#=> "" (expected "[nil, nil, nil, nil, \"global-variable\", \"global-variable\", nil, nil]") | |
#776 test_syntax.rb:256:in `<top (required)>': | |
defined?(nil) + defined?(self) + | |
defined?(true) + defined?(false) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "nilselftruefalse") | |
#777 test_syntax.rb:260:in `<top (required)>': core dumped | |
#778 test_syntax.rb:263:in `<top (required)>': core dumped | |
#779 test_syntax.rb:267:in `<top (required)>': | |
defined?(@@a) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "") | |
#780 test_syntax.rb:270:in `<top (required)>': core dumped | |
#781 test_syntax.rb:274:in `<top (required)>': | |
defined?($a) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "") | |
#782 test_syntax.rb:277:in `<top (required)>': | |
$a = 1 | |
defined?($a) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "global-variable") | |
#783 test_syntax.rb:281:in `<top (required)>': | |
defined?(C_definedtest) | |
#=> "#<NameError: uninitialized constant C_definedtest>\n" (expected "") | |
#784 test_syntax.rb:284:in `<top (required)>': | |
C_definedtest = 1 | |
defined?(C_definedtest) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "constant") | |
#785 test_syntax.rb:288:in `<top (required)>': | |
defined?(::C_definedtest) | |
#=> "#<NameError: uninitialized constant C_definedtest>\n" (expected "") | |
#786 test_syntax.rb:291:in `<top (required)>': | |
C_definedtest = 1 | |
defined?(::C_definedtest) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "constant") | |
#787 test_syntax.rb:295:in `<top (required)>': | |
defined?(C_definedtestA::C_definedtestB::C_definedtestC) | |
#=> "#<NameError: uninitialized constant C_definedtestA>\n" (expected "") | |
#788 test_syntax.rb:298:in `<top (required)>': | |
class C_definedtestA | |
class C_definedtestB | |
C_definedtestC = 1 | |
end | |
end | |
defined?(C_definedtestA::C_definedtestB::C_definedtestC) | |
#=> "#<NoMethodError: no method named defined?>\n" (expected "constant") | |
#789 test_syntax.rb:306:in `<top (required)>': | |
sum = 0 | |
30.times{|ib| | |
if ib % 10 == 0 .. true | |
sum += ib | |
end | |
} | |
sum | |
#=> "435" (expected "30") | |
#790 test_syntax.rb:315:in `<top (required)>': | |
sum = 0 | |
30.times{|ib| | |
if ib % 10 == 0 ... true | |
sum += ib | |
end | |
} | |
sum | |
#=> "435" (expected "63") | |
#791 test_syntax.rb:324:in `<top (required)>': | |
t = nil | |
unless ''.respond_to? :lines | |
class String | |
def lines | |
self | |
end | |
end | |
end | |
ary = [] | |
"this must not print | |
Type: NUM | |
123 | |
456 | |
Type: ARP | |
aaa | |
bbb | |
\f | |
this must not print | |
hoge | |
Type: ARP | |
aaa | |
bbb | |
".lines.each{|l| | |
if (t = l[/^Type: (.*)/, 1])..(/^\f/ =~ l) | |
ary << [t, l] | |
end | |
} | |
ary | |
#=> "" (expected "[[\"NUM\", \"Type: NUM\\n\"], [\"NUM\", \"123\\n\"], [\"NUM\", \"456\\n\"], [\"NUM\", \"Type: ARP\\n\"], [\"NUM\", \"aaa\\n\"], [\"NUM\", \"bbb\\n\"], [\"NUM\", \"\\f\\n\"], [\"ARP\", \"Type: ARP\\n\"], [\"ARP\", \"aaa\\n\"], [\"ARP\", \"bbb\\n\"]]") | |
#792 test_syntax.rb:354:in `<top (required)>': if true then 1 ; end #=> "" (expected "1") | |
#793 test_syntax.rb:355:in `<top (required)>': if false then 1 ; end #=> "false" (expected "") | |
#797 test_syntax.rb:359:in `<top (required)>': if false then ; elsif true then ; 1 ; end #=> "" (expected "1") | |
#802 test_syntax.rb:364:in `<top (required)>': 1 if true #=> "" (expected "1") | |
#803 test_syntax.rb:365:in `<top (required)>': 1 if false #=> "false" (expected "") | |
#818 test_syntax.rb:380:in `<top (required)>': | |
case | |
when 1==2, 2==3 | |
:ng1 | |
when false, 4==5 | |
:ok | |
when false | |
:ng2 | |
else | |
:elseng | |
end | |
#=> "" (expected "elseng") | |
#819 test_syntax.rb:392:in `<top (required)>': | |
case | |
when nil, nil | |
:ng1 | |
when 1,2,3 | |
:ok | |
when false, false | |
:ng2 | |
else | |
:elseng | |
end | |
#=> "" (expected "ok") | |
#820 test_syntax.rb:404:in `<top (required)>': | |
case | |
when nil | |
:ng1 | |
when false | |
:ng2 | |
else | |
:elseok | |
end #=> "" (expected "elseok") | |
#821 test_syntax.rb:413:in `<top (required)>': | |
case | |
when 1 | |
end | |
#=> "1" (expected "") | |
#822 test_syntax.rb:418:in `<top (required)>': | |
r = nil | |
ary = [] | |
case | |
when false | |
r = :ng1 | |
when false, false | |
r = :ng2 | |
when *ary | |
r = :ng3 | |
when false, *ary | |
r = :ng4 | |
when true, *ary | |
r = :ok | |
end | |
r | |
#=> "" (expected "ok") | |
#823 test_syntax.rb:435:in `<top (required)>': | |
ary = [] | |
case | |
when false, *ary | |
:ng | |
else | |
:ok | |
end | |
#=> "" (expected "ok") | |
#824 test_syntax.rb:444:in `<top (required)>': | |
ary = [false, nil] | |
case | |
when *ary | |
:ng | |
else | |
:ok | |
end | |
#=> "" (expected "ok") | |
#825 test_syntax.rb:453:in `<top (required)>': | |
ary = [false, nil] | |
case | |
when *ary | |
:ng | |
when true | |
:ok | |
else | |
:ng2 | |
end | |
#=> "" (expected "ok") | |
#826 test_syntax.rb:464:in `<top (required)>': | |
ary = [false, nil] | |
case | |
when *ary | |
:ok | |
else | |
:ng | |
end | |
#=> "" (expected "ng") | |
#827 test_syntax.rb:473:in `<top (required)>': | |
ary = [false, true] | |
case | |
when *ary | |
:ok | |
else | |
:ng | |
end | |
#=> "" (expected "ok") | |
#828 test_syntax.rb:482:in `<top (required)>': | |
ary = [false, true] | |
case | |
when false, false | |
when false, *ary | |
:ok | |
else | |
:ng | |
end | |
#=> "" (expected "ok") | |
#833 test_syntax.rb:512:in `<top (required)>': | |
i = 0 | |
begin | |
i+=1 | |
end while false | |
i | |
#=> "0" (expected "1") | |
#834 test_syntax.rb:519:in `<top (required)>': | |
i = 0 | |
begin | |
i+=1 | |
end until true | |
i | |
#=> "0" (expected "1") | |
#835 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{().."}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "unterminated string meets end of file") [ruby-dev:29732] | |
#836 test_syntax.rb:531:in `<top (required)>': core dumped [ruby-dev:31068] | |
#837 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{{*0}}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "syntax error, unexpected tSTAR, expecting '}'") [ruby-dev:31072] | |
#838 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{@0..0}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "`@0' is not allowed as an instance variable name") [ruby-dev:31095] | |
#839 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{$00..0}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "identifier $00 is not valid to get") [ruby-dev:31100] | |
#840 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{0..$00=1}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "identifier $00 is not valid to set") | |
#841 test_syntax.rb:536:in `<top (required)>': core dumped [ruby-dev:31102] | |
#842 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{v0,(*,v1,) = 0}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "syntax error, unexpected ')'") [ruby-dev:31104] | |
#843 test_syntax.rb:538:in `<top (required)>': | |
class << (ary=[]); def []; 0; end; def []=(x); super(0,x);end;end; ary[]+=1 | |
#=> "[1]" (expected "1") [ruby-dev:31110] | |
#844 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{0..$1=1}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "Can't set variable $1") [ruby-dev:31118] | |
#845 test_syntax.rb:542:in `<top (required)>': [ruby-dev:31119] | |
#846 test_syntax.rb:543:in `<top (required)>': [ruby-dev:31119] | |
#847 test_syntax.rb:527:in `assert_syntax_error': begin eval(%q{!}, nil, '', 0); rescue SyntaxError => e; e.message[/\A:(?:\d+:)? (.*)/, 1] end #=> "" (expected "syntax error, unexpected $end") [ruby-dev:31243] | |
#851 test_syntax.rb:548:in `<top (required)>': | |
1.times { | |
begin | |
ensure | |
next | |
end | |
}; :ok | |
#=> "#<RuntimeError: unexpected next>\n" (expected "ok") [ruby-dev:31373] | |
#852 test_syntax.rb:556:in `<top (required)>': | |
flag = false | |
1.times { | |
next if flag | |
flag = true | |
begin | |
ensure | |
redo | |
end | |
}; :ok | |
#=> "#<RuntimeError: unexpected redo>\n" (expected "ok") [ruby-dev:31373] | |
#857 test_syntax.rb:596:in `<top (required)>': | |
i = 0 | |
1 + (while true | |
break 2 if (i+=1) > 1 | |
redo | |
end) | |
#=> "1" (expected "3") | |
#858 test_syntax.rb:603:in `<top (required)>': | |
i = 0 | |
1 + (while true | |
break 2 if (i+=1) > 1 | |
p(1, (redo; 2)) | |
end) | |
#=> "1" (expected "3") | |
#859 test_syntax.rb:610:in `<top (required)>': | |
a = [0] | |
a[*a]+=1 | |
#=> "[1]" (expected "1") | |
#860 test_syntax.rb:614:in `<top (required)>': | |
ary = [0] | |
case 1 | |
when *ary, 1 | |
1 | |
end + | |
case | |
when *ary | |
1 | |
end | |
#=> "#<ArgumentError: expected Array>\n" (expected "2") | |
#861 test_syntax.rb:626:in `<top (required)>': | |
STDERR.reopen(STDOUT) | |
eval("\"\xf0".force_encoding("utf-8")) | |
#=> /invalid multibyte char/ expected to be =~ | |
"#<NameError: uninitialized constant STDERR>\n" [ruby-dev:32429] | |
#868 test_syntax.rb:646:in `<top (required)>': core dumped | |
#874 test_syntax.rb:727:in `<top (required)>': | |
begin | |
raise | |
rescue | |
counter = 2 | |
while true | |
counter -= 1 | |
break if counter == 0 | |
next | |
retry | |
end | |
end | |
#=> killed by SIGSEGV (signal 11) reported by Yusuke ENDOH | |
#879 test_syntax.rb:769:in `<top (required)>': [ruby-list:44479] | |
#880 test_syntax.rb:771:in `<top (required)>': | |
def a() end | |
begin | |
if defined?(a(1).a) | |
:ng | |
else | |
:ok | |
end | |
rescue | |
:ng | |
end | |
#=> "" (expected "ok") [ruby-core:16010] | |
#881 test_syntax.rb:784:in `<top (required)>': | |
def a() end | |
begin | |
if defined?(a::B) | |
:ng | |
else | |
:ok | |
end | |
rescue | |
:ng | |
end | |
#=> "#<TypeError: constant look-up for non class/module>\n" (expected "ok") [ruby-core:16010] | |
#884 test_syntax.rb:810:in `<top (required)>': | |
class X < RuntimeError;end | |
x = [X] | |
begin | |
raise X | |
rescue *x | |
:ok | |
end | |
#=> "#<X: X>\n" (expected "ok") [ruby-core:14537] | |
#885 test_syntax.rb:820:in `<top (required)>': | |
a = [false] | |
(a[0] &&= true) == false ? :ok : :ng | |
#=> "#<NoMethodError: no method named &&>\n" (expected "ok") [ruby-dev:34679] | |
#887 test_syntax.rb:831:in `<top (required)>': | |
"#{}""#{}ok" | |
#=> "" (expected "ok") [ruby-dev:38968] | |
#888 test_syntax.rb:836:in `<top (required)>': | |
"o" "#{}k" | |
#=> "" (expected "ok") [ruby-dev:38980] | |
#889 test_syntax.rb:847:in `<top (required)>': | |
0.times do | |
0.times do | |
def x(a=1, b, *rest); nil end | |
end | |
end | |
#=> killed by SIGSEGV (signal 11) | |
| syntax error, unexpected tSTAR | |
[ruby-core:26961] | |
#890 test_syntax.rb:855:in `<top (required)>': | |
0.times do | |
0.times do | |
def x@; nil end | |
end | |
end | |
#=> killed by SIGSEGV (signal 11) | |
| syntax error, unexpected $undefined, expecting ';' or '\n' | |
[ruby-core:26961] | |
#891 test_syntax.rb:867:in `<top (required)>': | |
0.times do | |
0.times do | |
def x(a = 0.times do | |
def y(a=1, b, *rest); nil; end | |
end) | |
nil | |
end | |
end | |
end | |
#=> killed by SIGSEGV (signal 11) | |
| syntax error, unexpected tSTAR | |
[ruby-core:26961] | |
#892 test_syntax.rb:879:in `<top (required)>': | |
0.times do | |
0.times do | |
def x(a = 0.times do | |
def x@; nil; end | |
end) | |
nil | |
end | |
end | |
end | |
#=> killed by SIGSEGV (signal 11) | |
| syntax error, unexpected $undefined, expecting ';' or '\n' | |
[ruby-core:26961] | |
#894 test_syntax.rb:889:in `<top (required)>': [ruby-core:22637] | |
#895 test_syntax.rb:890:in `<top (required)>': [ruby-core:22637] | |
#896 test_syntax.rb:892:in `<top (required)>': [ruby-core:29579] | |
#897 test_syntax.rb:902:in `<top (required)>': | |
def foo(&block) | |
yield | |
end | |
foo do | |
s = defined?(raise + 1) | |
Class | |
end | |
#=> killed by SIGSEGV (signal 11) [ruby-core:30293] | |
#898 test_thread.rb:3:in `<top (required)>': | |
Thread.new{ | |
}.join | |
:ok | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#899 test_thread.rb:8:in `<top (required)>': | |
Thread.new{ | |
:ok | |
}.value | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#900 test_thread.rb:13:in `<top (required)>': | |
v = 0 | |
(1..200).map{|i| | |
Thread.new{ | |
i | |
} | |
}.each{|t| | |
v += t.value | |
} | |
v | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "20100") | |
#901 test_thread.rb:24:in `<top (required)>': | |
5000.times{|e| | |
(1..2).map{ | |
Thread.new{ | |
} | |
}.each{|e| | |
e.join() | |
} | |
} | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "5000") | |
#902 test_thread.rb:34:in `<top (required)>': | |
5000.times{|e| | |
(1..2).map{ | |
Thread.new{ | |
} | |
}.each{|e| | |
e.join(1000000000) | |
} | |
} | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "5000") | |
#903 test_thread.rb:44:in `<top (required)>': | |
5000.times{ | |
t = Thread.new{} | |
while t.alive? | |
Thread.pass | |
end | |
} | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "5000") | |
#904 test_thread.rb:52:in `<top (required)>': | |
100.times{ | |
Thread.new{loop{Thread.pass}} | |
} | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "100") | |
#905 test_thread.rb:57:in `<top (required)>': | |
Thread.new{ | |
:ok | |
}.join.value | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#906 test_thread.rb:62:in `<top (required)>': | |
begin | |
Thread.new{ | |
raise "ok" | |
}.join | |
rescue => e | |
e | |
end | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#907 test_thread.rb:71:in `<top (required)>': | |
ans = nil | |
t = Thread.new{ | |
begin | |
sleep 0.5 | |
ensure | |
ans = :ok | |
end | |
} | |
Thread.pass | |
t.kill | |
t.join | |
ans | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#908 test_thread.rb:85:in `<top (required)>': | |
t = Thread.new{ | |
sleep | |
} | |
sleep 0.1 | |
t.raise | |
begin | |
t.join | |
:ng | |
rescue | |
:ok | |
end | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#909 test_thread.rb:98:in `<top (required)>': | |
t = Thread.new{ | |
loop{} | |
} | |
Thread.pass | |
t.raise | |
begin | |
t.join | |
:ng | |
rescue | |
:ok | |
end | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#910 test_thread.rb:111:in `<top (required)>': | |
t = Thread.new{ | |
} | |
Thread.pass | |
t.join | |
t.raise # raise to exited thread | |
begin | |
t.join | |
:ok | |
rescue | |
:ng | |
end | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#911 test_thread.rb:124:in `<top (required)>': | |
t = Thread.new{ | |
loop{} | |
} | |
st = t.status | |
t.kill | |
st | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "run") | |
#912 test_thread.rb:132:in `<top (required)>': | |
t = Thread.new{ | |
sleep | |
} | |
sleep 0.1 | |
st = t.status | |
t.kill | |
st | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "sleep") | |
#913 test_thread.rb:141:in `<top (required)>': | |
t = Thread.new{ | |
} | |
t.kill | |
sleep 0.1 | |
t.status | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "false") | |
#914 test_thread.rb:148:in `<top (required)>': | |
ptg = Thread.current.group | |
Thread.new{ | |
ctg = Thread.current.group | |
[ctg.class, ctg == ptg] | |
}.value | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "[ThreadGroup, true]") | |
#915 test_thread.rb:155:in `<top (required)>': | |
thg = ThreadGroup.new | |
t = Thread.new{ | |
thg.add Thread.current | |
sleep | |
} | |
sleep 0.1 | |
[thg.list.size, ThreadGroup::Default.list.size] | |
#=> "#<NameError: uninitialized constant ThreadGroup>\n" (expected "[1, 1]") | |
#916 test_thread.rb:165:in `<top (required)>': | |
thg = ThreadGroup.new | |
t = Thread.new{sleep 5} | |
thg.add t | |
thg.list.include?(t) | |
#=> "#<NameError: uninitialized constant ThreadGroup>\n" (expected "true") | |
#917 test_thread.rb:172:in `<top (required)>': | |
/a/ =~ 'a' | |
$a = $~ | |
Thread.new{ | |
$b = $~ | |
/b/ =~ 'b' | |
$c = $~ | |
}.join | |
$d = $~ | |
[$a == $d, $b, $c != $d] | |
#=> "" (expected "[true, nil, true]") | |
#918 test_thread.rb:183:in `<top (required)>': | |
Thread.current[:a] = 1 | |
Thread.new{ | |
Thread.current[:a] = 10 | |
Thread.pass | |
Thread.current[:a] | |
}.value + Thread.current[:a] | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "11") | |
#919 test_thread.rb:204:in `<top (required)>': | |
begin | |
100.times do |i| | |
begin | |
th = Thread.start(Thread.current) {|u| u.raise } | |
raise | |
rescue | |
ensure | |
th.join | |
end | |
end | |
rescue | |
end | |
#=> killed by SIGSEGV (signal 11) [ruby-dev:31371] | |
#920 test_thread.rb:206:in `<top (required)>': | |
t = Thread.new { loop {} } | |
begin | |
pid = fork { | |
exit t.status != "run" | |
} | |
Process.wait pid | |
$?.success? | |
rescue NotImplementedError | |
true | |
end | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "true") | |
#921 test_thread.rb:219:in `<top (required)>': | |
open("zzz.rb", "w") do |f| | |
f.puts <<-END | |
begin | |
Thread.new { fork { GC.start } }.join | |
pid, status = Process.wait2 | |
$result = status.success? ? :ok : :ng | |
rescue NotImplementedError | |
$result = :ok | |
end | |
END | |
end | |
require "./zzz.rb" | |
$result | |
#=> "" (expected "ok") | |
#926 test_thread.rb:268:in `<top (required)>': | |
def m | |
t = Thread.new { while true do // =~ "" end } | |
sleep 0.1 | |
10.times { | |
if /((ab)*(ab)*)*(b)/ =~ "ab"*7 | |
return :ng if !$4 | |
return :ng if $~.size != 5 | |
end | |
} | |
:ok | |
ensure | |
Thread.kill t | |
end | |
m | |
#=> "" (expected "ok") [ruby-dev:34492] | |
#935 test_thread.rb:322:in `<top (required)>': | |
begin | |
Thread.new { Thread.stop } | |
Thread.stop | |
:ng | |
rescue Exception | |
:ok | |
end | |
#=> "#<NameError: uninitialized constant Thread>\n" (expected "ok") | |
#936 test_thread.rb:332:in `<top (required)>': | |
begin | |
m1, m2 = Mutex.new, Mutex.new | |
Thread.new { m1.lock; sleep 1; m2.lock } | |
m2.lock; sleep 1; m1.lock | |
:ng | |
rescue Exception | |
:ok | |
end | |
#=> "#<NameError: uninitialized constant Mutex>\n" (expected "ok") | |
#937 test_thread.rb:343:in `<top (required)>': | |
m = Mutex.new | |
Thread.new { m.lock }; sleep 1; m.lock | |
:ok | |
#=> "#<NameError: uninitialized constant Mutex>\n" (expected "ok") | |
#938 test_thread.rb:349:in `<top (required)>': | |
m = Mutex.new | |
Thread.new { m.lock }; m.lock | |
:ok | |
#=> "#<NameError: uninitialized constant Mutex>\n" (expected "ok") | |
#939 test_thread.rb:355:in `<top (required)>': | |
m = Mutex.new | |
Thread.new { m.lock }.join; m.lock | |
:ok | |
#=> "#<NameError: uninitialized constant Mutex>\n" (expected "ok") | |
#940 test_thread.rb:361:in `<top (required)>': | |
m = Mutex.new | |
Thread.new { m.lock; sleep 2 } | |
sleep 1; m.lock | |
:ok | |
#=> "#<NameError: uninitialized constant Mutex>\n" (expected "ok") | |
#941 test_thread.rb:368:in `<top (required)>': | |
m = Mutex.new | |
Thread.new { m.lock; sleep 2; m.unlock } | |
sleep 1; m.lock | |
:ok | |
#=> "#<NameError: uninitialized constant Mutex>\n" (expected "ok") | |
#942 test_thread.rb:375:in `<top (required)>': | |
t = Thread.new {`echo`} | |
t.join | |
$? ? :ng : :ok | |
#=> "" (expected "ok") [ruby-dev:35414] | |
#943 test_thread.rb:381:in `<top (required)>': | |
begin | |
10000.times { Thread.new(true) {|x| x == false } } | |
rescue NoMemoryError, StandardError | |
end | |
:ok | |
#=> "#<NameError: uninitialized constant NoMemoryError>\n" (expected "ok") | |
#944 test_thread.rb:389:in `<top (required)>': | |
open("zzz.rb", "w") do |f| | |
f.puts <<-END | |
begin | |
m = Mutex.new | |
Thread.new { m.lock; sleep 1 } | |
sleep 0.3 | |
parent = Thread.current | |
Thread.new do | |
sleep 0.3 | |
begin | |
fork { GC.start } | |
rescue Exception | |
parent.raise $! | |
end | |
end | |
m.lock | |
pid, status = Process.wait2 | |
$result = status.success? ? :ok : :ng | |
rescue NotImplementedError | |
$result = :ok | |
end | |
END | |
end | |
require "./zzz.rb" | |
$result | |
#=> "" (expected "ok") | |
#946 test_thread.rb:439:in `<top (required)>': | |
begin | |
Process.waitpid2(fork {sleep 1})[1].success? ? 'ok' : 'ng' | |
rescue NotImplementedError | |
'ok' | |
end | |
#=> "#<NameError: uninitialized constant Process>\n" (expected "ok") | |
#947 test_thread.rb:447:in `<top (required)>': | |
f = proc {|s| /#{ sleep 1; s }/o } | |
[ Thread.new { f.call("foo"); nil }, | |
Thread.new { sleep 0.5; f.call("bar"); nil }, | |
].each {|t| t.join } | |
GC.start | |
f.call.source | |
#=> "" (expected "foo") | |
FAIL 404/947 tests failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment