From e2700c71b8335817c26070cedd44953334ec6549 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Wed, 13 May 2026 14:38:23 +0100 Subject: [PATCH] Add test --- src/glyph/tests.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/glyph/tests.rs b/src/glyph/tests.rs index d3ec0c84..49b230f4 100644 --- a/src/glyph/tests.rs +++ b/src/glyph/tests.rs @@ -392,10 +392,17 @@ fn if_no_one_uses_your_lib_is_it_broken() { } #[test] -fn parse_note() { +fn roundtrip_note() { let bytes = include_bytes!("../../testdata/note.glif"); let glyph = parse_glyph(bytes).unwrap(); assert_eq!(glyph.note, Some(".notdef".to_string())); + + let buf = glyph.encode_xml().expect("encode failed"); + let buf = std::str::from_utf8(&buf).unwrap(); + assert!( + buf.find("\n.notdef\n").is_some(), + "Notes should have newlines like ufoLib does it." + ); } #[test]