Cover valid surrogate pairs and a second unpaired surrogate in node ids

Stryker on the escaping showed the pair-skip branch uncovered and the run
offset unpinned; the kinds now include a valid pair, a replacement character
before a lone low surrogate, a reversed pair, and two unpaired surrogates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-29 15:49:51 +02:00
commit b9cca38dbf

View file

@ -542,8 +542,8 @@ namespace GameCult.Caching.Tests
public async Task GroupNodeIdsSeparateAnEscapeFromTheTextItSpells()
{
// "a/b" and "a%2Fb" collide under an id that escapes '/' alone; the unpaired surrogates, U+FFFD and "a%uD800"
// are the values a replacement character or a sloppy %u form would merge.
var kinds = new[] { "a/b", "a%2Fb", "a%2fb", "a%252Fb", "a", "A", "\uD800", "\uD801", "\uDC00", "<22>", "a%uD800", "a\uD800" };
// are the values a replacement character or a sloppy %u form would merge; the valid pair is one node, not two halves.
var kinds = new[] { "a/b", "a%2Fb", "a%2fb", "a%252Fb", "a", "A", "\uD800", "\uD801", "\uDC00", "<22>", "a%uD800", "a\uD800", "😀", "<22>\uDE00", "\uDE00\uD83D", "a\uD800b\uD801c" };
using var cache = OpenGroups();
for (var i = 0; i < kinds.Length; i++)
await cache.UpsertAsync(typeof(GroupRedeclared), new GroupRedeclared { Kind = kinds[i] }, new CultRecordKey("k" + i));