Add docs on treatment of strings, World fields

This commit is contained in:
2026-03-17 17:22:26 -07:00
parent a1b54b6172
commit 11339ef6ae
3 changed files with 86 additions and 1 deletions
+9
View File
@@ -76,6 +76,15 @@ mod tests {
assert_eq!(bytes, serialize_title(&decode_oneline(&bytes)))
}
#[test]
fn one_codepoint_per_byte() {
// This check guarantees that length checks on Unicode Strings will tell you something useful
// about how much headroom your text will have once serialized into a field in the file format.
let bytes: Vec<u8> = (0..=255).collect();
assert_eq!(256, decode_oneline(&bytes).chars().count());
assert_eq!(256, decode_multiline(&bytes).chars().count());
}
#[test]
fn newlines_to_cr() {
assert_debug_snapshot!(serialize_code("ABC\nDEF"), @r###"