From 905cc5dfd198f1bf2779392984084d10fb7d82f1 Mon Sep 17 00:00:00 2001 From: Marcono1234 Date: Sun, 4 Aug 2024 00:00:42 +0200 Subject: [PATCH] Add more surrogate pair tests (#91) --- tests/name_selector.json | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/name_selector.json b/tests/name_selector.json index ed033ab..980f8be 100644 --- a/tests/name_selector.json +++ b/tests/name_selector.json @@ -339,6 +339,26 @@ "A" ] }, + { + "name": "double quotes, before high surrogates", + "selector": "$[\"\\uD7FF\\uD7FF\"]", + "document": { + "\uD7FF\uD7FF": "A" + }, + "result": [ + "A" + ] + }, + { + "name": "double quotes, after low surrogates", + "selector": "$[\"\\uE000\\uE000\"]", + "document": { + "\uE000\uE000": "A" + }, + "result": [ + "A" + ] + }, { "name": "double quotes, invalid escaped single quote", "selector": "$[\"\\'\"]", @@ -449,6 +469,26 @@ "selector": "$[\"\\uD800\\u1234\"]", "invalid_selector": true }, + { + "name": "double quotes, non-surrogate surrogate", + "selector": "$[\"\\u1234\\uDC00\"]", + "invalid_selector": true + }, + { + "name": "double quotes, surrogate supplementary", + "selector": "$[\"\\uD800𝄞\"]", + "invalid_selector": true + }, + { + "name": "double quotes, supplementary surrogate", + "selector": "$[\"𝄞\\uDC00\"]", + "invalid_selector": true + }, + { + "name": "double quotes, surrogate incomplete low", + "selector": "$[\"\\uD800\\uDC0\"]", + "invalid_selector": true + }, { "name": "single quotes", "selector": "$['a']",