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

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 9, 2015, 2:41 p.m.
Message ID <a7e586cc8587d3e4a0bb.1447080079@mimosa>
Download mbox | patch
Permalink /patch/11334/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 9, 2015, 2:41 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@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@drmaciver.com> at the London
sprint. We can enable it as the bug in utf8b encoder/decoder has been fixed.
Pierre-Yves David - Nov. 16, 2015, 9:56 p.m.
On 11/09/2015 06:41 AM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@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@drmaciver.com> at the London
> sprint. We can enable it as the bug in utf8b encoder/decoder has been fixed.

This one is pushed to the clowncopter. Thanks

Patch

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