[DRE-commits] [ruby-albino] 01/06: d/patches: Fix albino tests (utf8 issues)

Sebastien Badia sbadia-guest at moszumanska.debian.org
Mon Feb 29 20:44:32 UTC 2016


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

sbadia-guest pushed a commit to branch master
in repository ruby-albino.

commit baa1137292f569ce5192ff0ceaf8283193323a09
Author: Sebastien Badia <seb at sebian.fr>
Date:   Mon Feb 29 17:33:46 2016 -0300

    d/patches: Fix albino tests (utf8 issues)
---
 ...01_fix_Albino_Multi_accepting_UTF-8_input.patch | 45 ++++++++++++++++++++++
 .../002_fix-albino-according-pygments.patch        | 17 ++++++++
 debian/patches/series                              |  2 +
 3 files changed, 64 insertions(+)

diff --git a/debian/patches/001_fix_Albino_Multi_accepting_UTF-8_input.patch b/debian/patches/001_fix_Albino_Multi_accepting_UTF-8_input.patch
new file mode 100644
index 0000000..c8a29d3
--- /dev/null
+++ b/debian/patches/001_fix_Albino_Multi_accepting_UTF-8_input.patch
@@ -0,0 +1,45 @@
+From: Mislav Marohnic <mislav.marohnic at gmail.com>
+Origin: upstream, https://github.com/github-archive/albino/commit/ea72e6451ac48048c7e7e241bf9cfbbc666c778d.patch
+Reviewed-by: Sebastien Badia <seb at sebian.fr>
+Date: Sat, 8 Oct 2011 19:01:00 +0200
+Subject: [PATCH] fix Albino::Multi accepting UTF-8 input
+
+---
+ test/multi_albino_test.rb | 7 +++++++
+ vendor/multipygmentize    | 1 +
+ 2 files changed, 8 insertions(+)
+
+diff --git a/test/multi_albino_test.rb b/test/multi_albino_test.rb
+index e53bc2c..43142cd 100644
+--- a/test/multi_albino_test.rb
++++ b/test/multi_albino_test.rb
+@@ -1,3 +1,5 @@
++# coding: utf-8
++
+ require 'rubygems'
+ require 'albino/multi'
+ require 'test/unit'
+@@ -27,6 +29,11 @@ def test_forces_utf8
+     end
+   end
+
++  def test_accepts_utf8
++    code = Albino::Multi.colorize('éøü', :html)
++    assert_includes code, "<pre>éøü\n</pre>"
++  end
++
+   def test_works_with_strings
+     syntaxer = Albino::Multi.new("class New\nend", :ruby)
+     assert_match %r(highlight), code=syntaxer.colorize
+diff --git a/vendor/multipygmentize b/vendor/multipygmentize
+index 8649f7d..467043f 100755
+--- a/vendor/multipygmentize
++++ b/vendor/multipygmentize
+@@ -14,6 +14,7 @@
+
+ import sys, os, codecs
+
++sys.stdin = codecs.getreader('UTF-8')(sys.stdin)
+ sys.stdout = codecs.getwriter('UTF-8')(sys.stdout)
+
+ vpath = os.path.realpath(__file__).split("/")
diff --git a/debian/patches/002_fix-albino-according-pygments.patch b/debian/patches/002_fix-albino-according-pygments.patch
new file mode 100644
index 0000000..028edf0
--- /dev/null
+++ b/debian/patches/002_fix-albino-according-pygments.patch
@@ -0,0 +1,17 @@
+Description: Fix albino test accroding new pygments
+Author: Sebastien Badia <seb at sebian.fr>
+Bug-Debian: https://bugs.debian.org/813644
+Forwarded: no
+Last-Update: 2016-03-29
+
+--- ruby-albino-1.3.3.orig/test/albino_test.rb
++++ ruby-albino-1.3.3/test/albino_test.rb
+@@ -39,7 +39,7 @@ class AlbinoTest < Test::Unit::TestCase
+   def test_works_with_utf8_strings
+     code = Albino.new("# é", :bash).colorize
+     assert_match %r(highlight), code
+-    assert_match %(<span class="c"># é</span>), code
++    assert_match %(<span class="c1"># é</span>), code
+   end
+
+   def test_works_with_files
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b649ad7
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+001_fix_Albino_Multi_accepting_UTF-8_input.patch
+002_fix-albino-according-pygments.patch

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



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