summaryrefslogtreecommitdiff
path: root/test/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-24 08:25:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-24 08:25:11 +0000
commit3fa061cd57021964a8536c34719729c7161fe38b (patch)
treef9d4ee9c755661da3bd9c5259de641522f0dd7b4 /test/ripper
parent79255ac86cb86832fca4b5a326b2e5bf54d68d36 (diff)
downloadruby-3fa061cd57021964a8536c34719729c7161fe38b.tar.gz
parse.y: fix token
* parse.y (paren_args): fix separator token at `foo::bar()` in ripper. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51927 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_parser_events.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 6f1fc92238..46204bcec6 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -346,12 +346,41 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
}
assert_equal true, thru_call
assert_equal "[call(ref(self),.,foo)]", tree
+
+ thru_call = false
+ assert_nothing_raised {
+ tree = parse("self.foo()", :on_call) {thru_call = true}
+ }
+ assert_equal true, thru_call
+ assert_equal "[call(ref(self),.,foo,[])]", tree
+
thru_call = false
assert_nothing_raised(bug2233) {
tree = parse("foo.()", :on_call) {thru_call = true}
}
assert_equal true, thru_call
assert_equal "[call(vcall(foo),.,call,[])]", tree
+
+ thru_call = false
+ assert_nothing_raised {
+ tree = parse("self::foo", :on_call) {thru_call = true}
+ }
+ assert_equal true, thru_call
+ assert_equal "[call(ref(self),::,foo)]", tree
+
+ thru_call = false
+ assert_nothing_raised {
+ tree = parse("self::foo()", :on_call) {thru_call = true}
+ }
+ assert_equal true, thru_call
+ assert_equal "[call(ref(self),::,foo,[])]", tree
+
+ thru_call = false
+ assert_nothing_raised(bug2233) {
+ tree = parse("foo::()", :on_call) {thru_call = true}
+ }
+ assert_equal true, thru_call
+ assert_equal "[call(vcall(foo),::,call,[])]", tree
end
def test_excessed_comma