[DRE-commits] [ruby-bdb] 03/04: Add patch 'use-same-encoding-for-dup-test'
David Suárez
deiv-guest at moszumanska.debian.org
Thu Mar 13 20:03:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
deiv-guest pushed a commit to branch master
in repository ruby-bdb.
commit b66c9256d66e9f4e26c6dc6a1e19847a9ef1d596
Author: David Suárez <david.sephirot at gmail.com>
Date: Thu Mar 13 20:53:36 2014 +0100
Add patch 'use-same-encoding-for-dup-test'
---
debian/patches/series | 1 +
debian/patches/use-same-encoding-for-dup-test | 30 +++++++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
index 238cc81..86b4238 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ remove_constants_safely
fix-inheritance
remove-src-dir-from-tests-load-path
dont-rely-on-ruby-objects-to-accommodate-c-data
+use-same-encoding-for-dup-test
diff --git a/debian/patches/use-same-encoding-for-dup-test b/debian/patches/use-same-encoding-for-dup-test
new file mode 100644
index 0000000..aaaa3ea
--- /dev/null
+++ b/debian/patches/use-same-encoding-for-dup-test
@@ -0,0 +1,30 @@
+Description: Use the same encoding for key index on count test
+
+Author: David Suárez <david.sephirot at gmail.com>
+Last-Update: 2014-03-13
+
+--- ruby-bdb-0.6.6.orig/tests/marshal.rb
++++ ruby-bdb-0.6.6/tests/marshal.rb
+@@ -113,16 +113,16 @@ class TestBtree < Inh::TestCase
+ ind = 0
+ array.each do |arr|
+ arr.each do |i|
+- assert_equal(i, $bdb[ind.to_s] = i, "<set dup>")
++ assert_equal(i, $bdb[ind.to_s.encode("US-ASCII")] = i, "<set dup>")
+ end
+ ind += 1
+ end
+ if BDB::VERSION_MAJOR > 2 || (BDB::VERSION_MAJOR == 2 && BDB::VERSION_MINOR >= 6)
+- assert_equal(4, $bdb.count("0"), "<count dup 0>")
+- assert_equal(3, $bdb.count("1"), "<count dup 1>")
+- assert_equal(2, $bdb.count("2"), "<count dup 2>")
+- assert_equal(1, $bdb.count("3"), "<count dup 3>")
+- assert_equal(0, $bdb.count("4"), "<count dup 4>")
++ assert_equal(4, $bdb.count("0".encode("US-ASCII")), "<count dup 0>")
++ assert_equal(3, $bdb.count("1".encode("US-ASCII")), "<count dup 1>")
++ assert_equal(2, $bdb.count("2".encode("US-ASCII")), "<count dup 2>")
++ assert_equal(1, $bdb.count("3".encode("US-ASCII")), "<count dup 3>")
++ assert_equal(0, $bdb.count("4".encode("US-ASCII")), "<count dup 4>")
+ array.size.times do |i|
+ $bdb.get_dup(i.to_s) do |val|
+ assert(array[i].index(val) != nil)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-bdb.git
More information about the Pkg-ruby-extras-commits
mailing list