[DRE-commits] [ruby-pygments.rb] 05/07: adapt pygments tests to new version

Cédric Boutillier boutil at moszumanska.debian.org
Tue Mar 1 17:45:23 UTC 2016


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to branch master
in repository ruby-pygments.rb.

commit 0fb14f993694ce0b8957da3687d13978e5e58682
Author: Cédric Boutillier <boutil at debian.org>
Date:   Tue Mar 1 18:23:32 2016 +0100

    adapt pygments tests to new version
---
 debian/patches/0008-fix_test_pygments.patch | 55 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 2 files changed, 56 insertions(+)

diff --git a/debian/patches/0008-fix_test_pygments.patch b/debian/patches/0008-fix_test_pygments.patch
new file mode 100644
index 0000000..b33ea16
--- /dev/null
+++ b/debian/patches/0008-fix_test_pygments.patch
@@ -0,0 +1,55 @@
+Description: reflect changes in pygments engine s/c1/ch
+Bug-Debian: https://bugs.debian.org/812940
+Forwarded: no
+Author: Cédric Boutillier <boutil at debian.org>
+Last-Update: 2016-03-01
+
+--- a/test/test_pygments.rb
++++ b/test/test_pygments.rb
+@@ -13,20 +13,20 @@
+ 
+   def test_highlight_defaults_to_html
+     code = P.highlight(RUBY_CODE)
+-    assert_match '<span class="c1">#!/usr/bin/ruby</span>', code
++    assert_match '<span class="ch">#!/usr/bin/ruby</span>', code
+     assert_equal '<div class', code[0..9]
+   end
+ 
+   def test_full_html_highlight
+     code = P.highlight(RUBY_CODE)
+-    assert_match '<span class="c1">#!/usr/bin/ruby</span>', code
+-    assert_equal "<div class=\"highlight\"><pre><span class=\"c1\">#!/usr/bin/ruby</span>\n<span class=\"nb\">puts</span> <span class=\"s1\">'foo'</span>\n</pre></div>", code
++    assert_match '<span class="ch">#!/usr/bin/ruby</span>', code
++    assert_equal "<div class=\"highlight\"><pre><span class=\"ch\">#!/usr/bin/ruby</span>\n<span class=\"nb\">puts</span> <span class=\"s1\">'foo'</span>\n</pre></div>", code
+   end
+ 
+   def test_full_table_highlight
+     code = P.highlight(RUBY_CODE, :options => {:linenos => true})
+-    assert_match '<span class="c1">#!/usr/bin/ruby</span>', code
+-    assert_equal "<table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre>1\n2</pre></div></td><td class=\"code\"><div class=\"highlight\"><pre><span class=\"c1\">#!/usr/bin/ruby</span>\n<span class=\"nb\">puts</span> <span class=\"s1\">'foo'</span>\n</pre></div>\n</td></tr></table>", code
++    assert_match '<span class="ch">#!/usr/bin/ruby</span>', code
++    assert_equal "<table class=\"highlighttable\"><tr><td class=\"linenos\"><div class=\"linenodiv\"><pre>1\n2</pre></div></td><td class=\"code\"><div class=\"highlight\"><pre><span class=\"ch\">#!/usr/bin/ruby</span>\n<span class=\"nb\">puts</span> <span class=\"s1\">'foo'</span>\n</pre></div>\n</td></tr></table>", code
+   end
+ 
+   def test_highlight_works_with_larger_files
+@@ -94,17 +94,17 @@
+ 
+   def test_highlight_works_with_trailing_newline
+     code = P.highlight(RUBY_CODE_TRAILING_NEWLINE)
+-    assert_match '<span class="c1">#!/usr/bin/ruby</span>', code
++    assert_match '<span class="ch">#!/usr/bin/ruby</span>', code
+   end
+ 
+   def test_highlight_works_with_multiple_newlines
+     code = P.highlight(RUBY_CODE_TRAILING_NEWLINE + "derp\n\n")
+-    assert_match '<span class="c1">#!/usr/bin/ruby</span>', code
++    assert_match '<span class="ch">#!/usr/bin/ruby</span>', code
+   end
+ 
+   def test_highlight_works_with_trailing_cr
+     code = P.highlight(RUBY_CODE_TRAILING_NEWLINE + "\r")
+-    assert_match '<span class="c1">#!/usr/bin/ruby</span>', code
++    assert_match '<span class="ch">#!/usr/bin/ruby</span>', code
+   end
+ 
+   def test_highlight_still_works_with_invalid_code
diff --git a/debian/patches/series b/debian/patches/series
index d2a5edd..aeea4e8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 0005-Use-proper-python-shebang.patch
 0006-Invoke-mentos-directly-on-GNU-Linux.patch
 0007-Update-test-result.patch
+0008-fix_test_pygments.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-pygments.rb.git



More information about the Pkg-ruby-extras-commits mailing list