Integration: keep-lines IDML tests expect the split main's frame gives

The merge took main's 236 pt test frame (19 lines whatever the last line's
descent) with next's 7/3 expectations, which belong to next's 240 pt frame.
With main's frame the paragraph splits 6/4, as main's tests said.
This commit is contained in:
aiongg
2026-10-16 03:32:00 +00:00
parent fa3d13ae5a
commit 1caf53f40b
+3 -4
View File
@@ -148,14 +148,13 @@ fn para_lines_per_frame(d: &Document, para: usize) -> Vec<usize> {
}
/// Keep Lines Together without a mode in the IDML: InDesign's default, at start/end of paragraph.
/// A 10-line paragraph starting 7 lines above the first frame's bottom (the last baseline may sit
/// on the bottom edge) splits 7/3.
/// A 10-line paragraph starting 6 lines above the first frame's bottom splits 6/4.
#[test]
fn idml_keep_lines_without_mode_split_at_start_and_end() {
let keep = r#"KeepLinesTogether="true" KeepFirstLines="2" KeepLastLines="2""#;
let d = designcraft_idml::import_idml(&keep_lines_idml(keep, &[13, 10, 2])).unwrap();
assert_eq!(para_lines_per_frame(&d, 0), [13, 0]);
assert_eq!(para_lines_per_frame(&d, 1), [7, 3]);
assert_eq!(para_lines_per_frame(&d, 1), [6, 4]);
// All lines in paragraph, written explicitly: the paragraph moves whole.
let d = designcraft_idml::import_idml(&keep_lines_idml(&format!(r#"{keep} KeepAllLinesTogether="true""#), &[13, 10, 2])).unwrap();
assert_eq!(para_lines_per_frame(&d, 1), [0, 10]);
@@ -175,7 +174,7 @@ fn format_1_keep_lines_without_mode_lays_out_all_lines() {
let v1 = designcraft_format::load(&w.finish().unwrap().into_inner()).unwrap();
assert_eq!(para_lines_per_frame(&v1, 1), [0, 10]);
let now = designcraft_format::load(&designcraft_format::save(&d).unwrap()).unwrap();
assert_eq!(para_lines_per_frame(&now, 1), [7, 3]);
assert_eq!(para_lines_per_frame(&now, 1), [6, 4]);
}
#[test]