summaryrefslogtreecommitdiff
path: root/test/ripper/test_parser_events.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ripper/test_parser_events.rb')
-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