diff options
Diffstat (limited to 'test/unit/tokens.rb')
-rw-r--r-- | test/unit/tokens.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/unit/tokens.rb b/test/unit/tokens.rb index 51d286e..4fc9833 100644 --- a/test/unit/tokens.rb +++ b/test/unit/tokens.rb @@ -65,14 +65,21 @@ class TokensTest < Test::Unit::TestCase end def test_split_into_parts - parts = [ + parts_4_3 = [ ["stri", :type], ["ng", :type, :begin_group, :operator, "(", :content, :end_group, :operator], [:begin_group, :operator, ")", :content, :end_group, :operator] ] - assert_equal parts, make_tokens.split_into_parts(4, 3) + assert_equal parts_4_3, make_tokens.split_into_parts(4, 3) assert_equal [make_tokens.to_a], make_tokens.split_into_parts + parts_7_0_1 = [ + ["string", :type, :begin_group, :operator, "(", :content, :end_group, :operator], + [], + [:begin_group, :operator, ")", :content, :end_group, :operator] + ] + assert_equal parts_7_0_1, make_tokens.split_into_parts(7, 0, 1) + line = CodeRay::Tokens[:begin_line, :head, '...', :plain] line_parts = [ [:begin_line, :head, ".", :plain, :end_line, :head], |