diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-06 02:04:19 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-06 02:04:19 +0000 |
| commit | 40e44f99511431da05eff9402e76583a37011943 (patch) | |
| tree | d4b32395b86535a15ea91e8105052c28d6263b5f /bootstraptest | |
| parent | eb2d19174e0201b4446f6062dea892b0ba2b9b60 (diff) | |
| download | ruby-40e44f99511431da05eff9402e76583a37011943.tar.gz ruby-40e44f99511431da05eff9402e76583a37011943.tar.xz ruby-40e44f99511431da05eff9402e76583a37011943.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@14118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
| -rw-r--r-- | bootstraptest/test_knownbug.rb | 23 | ||||
| -rw-r--r-- | bootstraptest/test_syntax.rb | 4 |
2 files changed, 19 insertions, 8 deletions
diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index 9883ceb25..38f42adac 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -10,20 +10,27 @@ assert_equal '0', %q{ $?.to_i }, '[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{ "abcd\xf0".force_encoding("utf-8").reverse.inspect }, '[ruby-dev:32448]' -assert_equal 'hi', %q{ +assert_equal 'ok', %q{ class C - define_method(:foo) { |arg, &block| + define_method(:foo) do |arg, &block| if block then block.call else arg end - } + end end C.new.foo("ng") {"ok"} }, '[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 +} diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index b25d0d43c..8b499c50d 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -624,3 +624,7 @@ assert_equal '2', %q{ end } +assert_match /illegal multibyte char/, %q{ + STDERR.reopen(STDOUT) + eval("\"\xfd".force_encoding("utf-8")) +}, '[ruby-dev:32429]' |
