summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2011-06-22 07:22:23 +0000
committermurphy <murphy@rubychan.de>2011-06-22 07:22:23 +0000
commitd6fe4e777a4f543c8828dbf77e955ab38e6c2803 (patch)
tree7f2a155c7645718f8936e649aee05574cd3d1b54 /test
parent90f70ee61e87e137aa192c5db97c382e1ec7d24b (diff)
downloadcoderay-d6fe4e777a4f543c8828dbf77e955ab38e6c2803.tar.gz
#309 Improved highlighting of Ruby inside diffs
Diffstat (limited to 'test')
-rw-r--r--test/unit/tokens.rb11
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],