From e12ed1608ef02722825941d2b76e0b54addc1312 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 9 Oct 2026 04:36:06 +0700 Subject: [PATCH] Tests: the composer round trip counts #600's area type in the rich fixture #587 and #600 landed together: the fixture's new area type (Every-line, the default) is a second text object the composer test now sees. Co-Authored-By: Claude Opus 5.5 --- crates/format/tests/native_v3.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/format/tests/native_v3.rs b/crates/format/tests/native_v3.rs index 3b502347..5919897e 100644 --- a/crates/format/tests/native_v3.rs +++ b/crates/format/tests/native_v3.rs @@ -149,10 +149,11 @@ fn text_composer_round_trips() { }); v }; - assert_eq!(composers(&d), [Composer::SingleLine]); + // The point type set to Single-line, then the area type left at the default. + assert_eq!(composers(&d), [Composer::SingleLine, Composer::EveryLine]); let bytes = save(&d, false); assert!(String::from_utf8_lossy(&bytes).contains("\"composer\":\"singleLine\"")); - assert_eq!(composers(&load(&bytes).unwrap()), [Composer::SingleLine]); + assert_eq!(composers(&load(&bytes).unwrap()), [Composer::SingleLine, Composer::EveryLine]); // Files without the key (older files, Every-line text) read as Every-line. fn strip(v: &mut Value) { match v { @@ -167,7 +168,7 @@ fn text_composer_round_trips() { let mut v = json_of(&bytes); strip(&mut v); let d2 = load(&serde_json::to_vec(&v).unwrap()).unwrap(); - assert_eq!(composers(&d2), [Composer::EveryLine]); + assert_eq!(composers(&d2), [Composer::EveryLine, Composer::EveryLine]); assert!(!String::from_utf8_lossy(&save(&d2, false)).contains("composer")); }