Skip to content

Commit

Permalink
Test case for layout with only inline boxes
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns committed Dec 6, 2024
1 parent 0bbc5bf commit 564c981
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions parley/src/tests/test_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,24 @@ fn placing_inboxes() {
env.with_name(test_case_name).check_layout_snapshot(&layout);
}
}

#[test]
fn only_inboxes_wrap() {
let mut env = testenv!();

let text = "";
let mut builder = env.builder(text);
for id in 0..10 {
builder.push_inline_box(InlineBox {
id,
index: 0,
width: 10.0,
height: 10.0,
});
}
let mut layout = builder.build(text);
layout.break_all_lines(Some(40.0));
layout.align(None, Alignment::Middle);

env.check_layout_snapshot(&layout);
}
Binary file added parley/tests/snapshots/only_inboxes_wrap-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 564c981

Please sign in to comment.