diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-18 12:07:51 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-18 12:07:51 +0000 |
| commit | f180a690a552d29aca0818721f0f3dac7ebb53f2 (patch) | |
| tree | eb87ffe59f0f71747be4fc76d84244c414e3e3da /bootstraptest | |
| parent | 386b97a9c875b3117a3796fa3a4616b3e3423df7 (diff) | |
| download | ruby-f180a690a552d29aca0818721f0f3dac7ebb53f2.tar.gz ruby-f180a690a552d29aca0818721f0f3dac7ebb53f2.tar.xz ruby-f180a690a552d29aca0818721f0f3dac7ebb53f2.zip | |
* compile.c, insnhelper.ci, insns.def, object.c, vm.c, vm.h:
optimize !@, != method invocation.
* id.c, id.h: ditto.
* bootstraptest/test_syntax.rb: add tests for above.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
| -rw-r--r-- | bootstraptest/test_syntax.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index 3e4c79bec..0ba8f658f 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -628,3 +628,18 @@ assert_match /illegal multibyte char/, %q{ STDERR.reopen(STDOUT) eval("\"\xf0".force_encoding("utf-8")) }, '[ruby-dev:32429]' + +# method ! and != +assert_equal 'true', %q{!false} +assert_equal 'true', %q{1 == 1} +assert_equal 'true', %q{1 != 2} +assert_equal 'true', %q{ + class C; def !=(obj); true; end; end + C.new != 1 +} +assert_equal 'true', %q{ + class C; def !@; true; end; end + !C.new +} + + |
