summaryrefslogtreecommitdiff
path: root/bootstraptest/test_syntax.rb
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-18 12:07:51 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-12-18 12:07:51 +0000
commitcd843108646b999e13cfbf04e51eca30b68850b3 (patch)
treeeb87ffe59f0f71747be4fc76d84244c414e3e3da /bootstraptest/test_syntax.rb
parent1f75a4e700883da8d15048fc3da6528ba53ec1e4 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@14299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest/test_syntax.rb')
-rw-r--r--bootstraptest/test_syntax.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb
index 3e4c79b..0ba8f65 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
+}
+
+