From cdbfe7e4fb4646a7749d1155d1b784a4ca2a99c2 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 18:27:18 +0000 Subject: federation: the JCS test asks escapes JCS doesn't write, as escapes Two of the strings `json_written_otherwise_is_none` takes for none, an escaped U+2028 and an escaped `A`, stood in the file as the characters themselves, which JCS writes as they are: the test took them for none, and they read. They are built as escapes now. --- src/federation/jcs.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/federation/jcs.rs b/src/federation/jcs.rs index 8b05994..151c6f9 100644 --- a/src/federation/jcs.rs +++ b/src/federation/jcs.rs @@ -405,8 +405,6 @@ mod tests { r#""\udc00\ud800""#, r#""\u001F""#, r#""\/""#, - r#""
""#, - r#""A""#, "\"\u{1}\"", "nul", "[1]x", @@ -414,6 +412,10 @@ mod tests { ] { assert!(!reads(text), "{text}"); } + // Escapes JCS doesn't write: of U+2028, which it writes as it is, and of a letter. + for escape in ["u2028", "u0041"] { + assert!(!reads(&format!("\"\\{escape}\"")), "{escape}"); + } assert_eq!(read(b"\"\xff\""), None); } -- cgit v1.3.1