Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns committed Feb 18, 2025
1 parent c94000b commit 5cdaa45
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
36 changes: 36 additions & 0 deletions parley/src/tests/test_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,42 @@ fn full_width_inbox() {
}
}

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

let text = " ";
let mut builder = env.ranged_builder(text);
builder.push_inline_box(InlineBox {
id: 0,
index: 0,
width: 10.,
height: 10.0,
});
builder.push_inline_box(InlineBox {
id: 1,
index: 1,
width: 10.0,
height: 10.0,
});
builder.push_inline_box(InlineBox {
id: 2,
index: 2,
width: 10.0,
height: 10.0,
});
builder.push_inline_box(InlineBox {
id: 3,
index: 3,
width: 10.0,
height: 10.0,
});
let mut layout = builder.build(text);
layout.break_all_lines(Some(100.));
layout.align(None, Alignment::Start, AlignmentOptions::default());
env.check_layout_snapshot(&layout);
}

#[test]
fn trailing_whitespace() {
let mut env = testenv!();
Expand Down
3 changes: 3 additions & 0 deletions parley/tests/snapshots/inboxes_separated_by_whitespace-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 5cdaa45

Please sign in to comment.