diff options
| author | tv <tv@krebsco.de> | 2026-11-16 18:27:18 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-16 19:29:20 +0100 |
| commit | cdbfe7e4fb4646a7749d1155d1b784a4ca2a99c2 (patch) | |
| tree | 59339668d2f67d7f89b312050511d9e4e6926871 /src/federation/jcs.rs | |
| parent | 0b011438496d3f9245033d1ebb58a4cbebd88f00 (diff) | |
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.
Diffstat (limited to 'src/federation/jcs.rs')
| -rw-r--r-- | src/federation/jcs.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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); } |
