From 1917d08f7cf71e2933763a09e1b63e0040936c3b Mon Sep 17 00:00:00 2001 From: Code Ass Date: Sat, 5 Aug 2017 01:04:22 +0900 Subject: [PATCH] Add test_parse_statements_complex_condition_in_for --- test/test_rdoc_parser_ruby.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/test_rdoc_parser_ruby.rb b/test/test_rdoc_parser_ruby.rb index c369590ec9..b661e92c93 100644 --- a/test/test_rdoc_parser_ruby.rb +++ b/test/test_rdoc_parser_ruby.rb @@ -2446,6 +2446,38 @@ class DateTime < Date assert_equal :private, date_time_now.visibility, date_time_now.full_name end + def test_parse_statements_complex_condition_in_for + util_parser <def blah() + for i in (k+1)...n do + end + for i in (k+1)...n + end +end +EXPTECTED + expected = expected.rstrip + + @parser.scan + + foo = @top_level.classes.first + assert_equal 'Foo', foo.full_name + + blah = foo.method_list.first + markup_code = blah.markup_code.sub(/^.*\n/, '') + assert_equal markup_code, expected + end + def test_parse_require_dynamic_string content = <<-RUBY prefix = 'path'