[PATCH 1 of 2] test-encoding: enable fuzz testing of utf8b roundtrip

Yuya Nishihara yuya at tcha.org
Mon Nov 9 14:41:19 UTC 2015


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1447075861 -32400
#      Mon Nov 09 22:31:01 2015 +0900
# Node ID a7e586cc8587d3e4a0bbf607d5b902a988cb5bc8
# Parent  7af0c039bd12de2805beedd3a5d0aabcae192131
test-encoding: enable fuzz testing of utf8b roundtrip

This test was written by David R. MacIver <david at drmaciver.com> at the London
sprint. We can enable it as the bug in utf8b encoder/decoder has been fixed.

diff --git a/tests/test-encoding.t b/tests/test-encoding.t
--- a/tests/test-encoding.t
+++ b/tests/test-encoding.t
@@ -272,3 +272,14 @@ Test roundtrip encoding of lookup tables
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
 
   $ cd ..
+
+Test roundtrip encoding/decoding of utf8b for generated data
+
+#if hypothesis
+
+  >>> from hypothesishelpers import *
+  >>> from mercurial import encoding
+  >>> roundtrips(st.binary(), encoding.fromutf8b, encoding.toutf8b)
+  Round trip OK
+
+#endif


More information about the Mercurial-devel mailing list