From f180a690a552d29aca0818721f0f3dac7ebb53f2 Mon Sep 17 00:00:00 2001 From: ko1 Date: Tue, 18 Dec 2007 12:07:51 +0000 Subject: * 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 --- bootstraptest/test_syntax.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'bootstraptest') 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 +} + + -- cgit