aboutsummaryrefslogtreecommitdiffstats
path: root/test/ripper
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-27 05:53:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-27 05:53:22 +0000
commitce9fc203d1e7cd97d68fab6e10733bd62f065c5a (patch)
treeca3bae3f9000ce0c094c20f0065f7bf813d3b950 /test/ripper
parent202b4bbe81dc5f5d40df5c779d8f8d20d06e9b70 (diff)
downloadruby-ce9fc203d1e7cd97d68fab6e10733bd62f065c5a.tar.gz
test_parser_events.rb: split test_binary
* test/ripper/test_parser_events.rb (test_binary): split for each operators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ripper')
-rw-r--r--test/ripper/test_parser_events.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb
index 1942157b89..ed026785db 100644
--- a/test/ripper/test_parser_events.rb
+++ b/test/ripper/test_parser_events.rb
@@ -9,13 +9,10 @@ end
class TestRipper::ParserEvents < Test::Unit::TestCase
- # should be enabled
def test_event_coverage
- dispatched = Ripper::PARSER_EVENTS.map {|event,*| event }
- dispatched.each do |e|
- assert_equal true, respond_to?("test_#{e}", true),
- "event not tested: #{e.inspect}"
- end
+ dispatched = Ripper::PARSER_EVENTS
+ tested = self.class.instance_methods(false).grep(/\Atest_(\w+)/) {$1.intern}
+ assert_empty dispatched-tested
end
def parse(str, nm = nil, &bl)
@@ -249,9 +246,8 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
assert_equal true, thru_begin
end
- def test_binary
- thru_binary = nil
- %w"and or + - * / % ** | ^ & <=> > >= < <= == === != =~ !~ << >> && ||".each do |op|
+ %w"and or + - * / % ** | ^ & <=> > >= < <= == === != =~ !~ << >> && ||".each do |op|
+ define_method("test_binary(#{op})") do
thru_binary = false
parse("a #{op} b", :on_binary) {thru_binary = true}
assert_equal true, thru_binary