mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
59676f6d03
From: MSP-Greg <greg.mpls@gmail.com>
5187ea768f
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
39 lines
471 B
Ruby
39 lines
471 B
Ruby
assert_equal 'A', %q{
|
|
class A
|
|
@@a = 'A'
|
|
def a=(x)
|
|
@@a = x
|
|
end
|
|
def a
|
|
@@a
|
|
end
|
|
end
|
|
|
|
B = A.dup
|
|
B.new.a = 'B'
|
|
A.new.a
|
|
}, '[ruby-core:17019]'
|
|
|
|
assert_equal 'ok', %q{
|
|
def m
|
|
lambda{
|
|
proc{
|
|
return :ng1
|
|
}
|
|
}.call.call
|
|
:ng2
|
|
end
|
|
|
|
begin
|
|
m()
|
|
rescue LocalJumpError
|
|
:ok
|
|
end
|
|
}
|
|
|
|
assert_normal_exit %q{
|
|
r = Range.allocate
|
|
def r.<=>(o) true end
|
|
r.instance_eval { initialize r, r }
|
|
r.inspect
|
|
}
|