[DRE-commits] [ruby-redcarpet] 01/02: Add patch fix-test-suite-on-32b-arch.patch. Closes #865133

Lucas Nussbaum lucas at moszumanska.debian.org
Sat Jul 8 07:29:26 UTC 2017


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

lucas pushed a commit to branch master
in repository ruby-redcarpet.

commit 6d72e9980b7534f2f83da8fa78b6997ffa3002a8
Author: Lucas Nussbaum <lucas at debian.org>
Date:   Sat Jul 8 09:24:22 2017 +0200

    Add patch fix-test-suite-on-32b-arch.patch. Closes #865133
---
 debian/patches/fix-test-suite-on-32b-arch.patch | 42 +++++++++++++++++++++++++
 debian/patches/series                           |  1 +
 2 files changed, 43 insertions(+)

diff --git a/debian/patches/fix-test-suite-on-32b-arch.patch b/debian/patches/fix-test-suite-on-32b-arch.patch
new file mode 100644
index 0000000..a82f699
--- /dev/null
+++ b/debian/patches/fix-test-suite-on-32b-arch.patch
@@ -0,0 +1,42 @@
+commit ed0dd93a6fd54f881ec1603bd5ee9694947be9b2
+Author: Lucas Nussbaum <lucas at debian.org>
+Date:   Sat Jul 8 09:18:50 2017 +0200
+
+    Fix hashes in test suite for 32b architectures
+    
+    The hash length depends on integer size (32b/64b). Allow the test suite
+    to work on 32b architectures too.
+
+diff --git a/test/html_render_test.rb b/test/html_render_test.rb
+index 9371d0a..f8abf52 100644
+--- a/test/html_render_test.rb
++++ b/test/html_render_test.rb
+@@ -254,7 +254,13 @@ class HTMLRenderTest < Redcarpet::TestCase
+ 
+   def test_utf8_only_header_anchors
+     markdown = "# 見出し"
+-    html = "<h1 id=\"part-37870bfa194139f\">見出し</h1>"
++    if 1.size == 4 # 32-bit architecture
++      html = "<h1 id=\"part-a194139f\">見出し</h1>"
++    elsif 1.size == 8 # 64-bit architecture
++      html = "<h1 id=\"part-37870bfa194139f\">見出し</h1>"
++    else
++      raise "unknown integer size"
++    end
+ 
+     assert_equal html, render(markdown, with: [:with_toc_data])
+   end
+diff --git a/test/html_toc_render_test.rb b/test/html_toc_render_test.rb
+index 6dc5ad8..0aae905 100644
+--- a/test/html_toc_render_test.rb
++++ b/test/html_toc_render_test.rb
+@@ -54,7 +54,8 @@ class HTMLTOCRenderTest < Redcarpet::TestCase
+     assert_match /a-nice-subtitle/, output
+     assert_match /another-one/, output
+     assert_match /a-sub-sub-title/, output
+-    assert_match /part-37870bfa194139f/, output
++    # the part number length varies depending on architecture (32b or 64b)
++    assert_match /part-(37870bf)?a194139f/, output
+   end
+ 
+   def test_toc_heading_with_hyphen_and_equal
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..266a850
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix-test-suite-on-32b-arch.patch

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



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