This is an automated email from the ASF dual-hosted git repository.

nickva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git

commit 7606c3f35b2e5cbf179a35bb0e34be1b5c3e8061
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Tue Mar 31 01:09:48 2026 -0400

    Add coverage for random unicode edge cases
    
    We had pretty good coverage except some odds and ends like uencoded 
sequences
    that started off well but ended up being junk.
---
 test/jiffy_04_string_tests.erl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/jiffy_04_string_tests.erl b/test/jiffy_04_string_tests.erl
index 0e37f27..f923a31 100644
--- a/test/jiffy_04_string_tests.erl
+++ b/test/jiffy_04_string_tests.erl
@@ -130,7 +130,17 @@ cases(error) ->
         <<"\"\\uD834foo\\uDD1E\"">>,
         <<"\"\\u", 200, 200, 200, 200, "\"">>,
         % CouchDB-345
-        <<34,78,69,73,77,69,78,32,70,216,82,82,32,70,65,69,78,33,34>>
+        <<34,78,69,73,77,69,78,32,70,216,82,82,32,70,65,69,78,33,34>>,
+        % Lone high surrogate followed by non-backslash
+        <<"\"\\uD834a\"">>,
+        % Lone high surrogate followed by backslash but not 'u'
+        <<"\"\\uD834\\n\"">>,
+        % Lone high surrogate followed by \u but not a valid low surrogate
+        <<"\"\\uD834\\u0041\"">>,
+        % Truncated \uXX (not enough hex digits)
+        <<"\"\\u00\"">>,
+        % Invalid hex digit in \u escape
+        <<"\"\\uZZZZ\"">>
     ];
 
 cases(utf8) ->

Reply via email to