tests/test-template-engine.t
changeset 26843 f580c78ea667
parent 17358 2917f82f6040
child 28213 93b5c540db69
--- a/tests/test-template-engine.t	Sat Oct 24 12:46:03 2015 +0100
+++ b/tests/test-template-engine.t	Mon Nov 02 11:56:59 2015 +0000
@@ -44,4 +44,17 @@
   0 97e5f848f0936960273bbf75be6388cd0350a32b -1 0000000000000000000000000000000000000000
   -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000
 
+Fuzzing the unicode escaper to ensure it produces valid data
+
+#if hypothesis
+
+  >>> from hypothesishelpers import *
+  >>> import mercurial.templatefilters as tf
+  >>> import json
+  >>> @check(st.text().map(lambda s: s.encode('utf-8')))
+  ... def testtfescapeproducesvalidjson(text):
+  ...     json.loads('"' + tf.jsonescape(text) + '"')
+
+#endif
+
   $ cd ..