mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* bootstraptest/test_knownbug.rb: new test for block and
define_method. * bootstraptest/test_syntax.rb: moved [ruby-dev:32429] from test_knownbug.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
95cf86dd26
commit
de4ec68991
2 changed files with 19 additions and 8 deletions
|
@ -10,20 +10,27 @@ assert_equal '0', %q{
|
||||||
$?.to_i
|
$?.to_i
|
||||||
}, '[ruby-dev:32404]'
|
}, '[ruby-dev:32404]'
|
||||||
|
|
||||||
assert_match /unterminated string meets end of file/, %q{
|
|
||||||
STDERR.reopen(STDOUT)
|
|
||||||
eval("\"\xfd".force_encoding("utf-8"))
|
|
||||||
}, '[ruby-dev:32429]'
|
|
||||||
|
|
||||||
assert_normal_exit %q{
|
assert_normal_exit %q{
|
||||||
"abcd\xf0".force_encoding("utf-8").reverse.inspect
|
"abcd\xf0".force_encoding("utf-8").reverse.inspect
|
||||||
}, '[ruby-dev:32448]'
|
}, '[ruby-dev:32448]'
|
||||||
|
|
||||||
assert_equal 'hi', %q{
|
assert_equal 'ok', %q{
|
||||||
class C
|
class C
|
||||||
define_method(:foo) { |arg, &block|
|
define_method(:foo) do |arg, &block|
|
||||||
if block then block.call else arg end
|
if block then block.call else arg end
|
||||||
}
|
end
|
||||||
end
|
end
|
||||||
C.new.foo("ng") {"ok"}
|
C.new.foo("ng") {"ok"}
|
||||||
}, '[ruby-talk:266422]'
|
}, '[ruby-talk:266422]'
|
||||||
|
|
||||||
|
assert_equal 'ok', %q{
|
||||||
|
STDERR.reopen(STDOUT)
|
||||||
|
class C
|
||||||
|
define_method(:foo) do |&block|
|
||||||
|
block.call if block
|
||||||
|
end
|
||||||
|
result = "ng"
|
||||||
|
new.foo() {result = "ok"}
|
||||||
|
result
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
|
@ -624,3 +624,7 @@ assert_equal '2', %q{
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_match /illegal multibyte char/, %q{
|
||||||
|
STDERR.reopen(STDOUT)
|
||||||
|
eval("\"\xfd".force_encoding("utf-8"))
|
||||||
|
}, '[ruby-dev:32429]'
|
||||||
|
|
Loading…
Reference in a new issue