|
77 | 77 | assert_equal expected, tokens |
78 | 78 | end |
79 | 79 |
|
| 80 | + def test_class_tokenize_hash_symbol |
| 81 | + tokens = RDoc::RubyLex.tokenize '{ class:"foo" }', nil |
| 82 | + |
| 83 | + expected = [ |
| 84 | + @TK::TkLBRACE .new( 0, 1, 0, '{'), |
| 85 | + @TK::TkSPACE .new( 1, 1, 1, ' '), |
| 86 | + @TK::TkIDENTIFIER.new( 2, 1, 2, 'class'), |
| 87 | + @TK::TkSYMBEG .new( 7, 1, 7, ':'), |
| 88 | + @TK::TkSTRING .new( 8, 1, 8, '"foo"'), |
| 89 | + @TK::TkSPACE .new(13, 1, 13, ' '), |
| 90 | + @TK::TkRBRACE .new(14, 1, 14, '}'), |
| 91 | + @TK::TkNL .new(15, 1, 15, "\n"), |
| 92 | + ] |
| 93 | + |
| 94 | + assert_equal expected, tokens |
| 95 | + end |
| 96 | + |
80 | 97 | def test_class_tokenize_heredoc_indent |
81 | 98 | tokens = RDoc::RubyLex.tokenize <<-'RUBY', nil |
82 | 99 | string = <<-STRING |
|
0 commit comments