Skip to content

Commit f51d789

Browse files
committed
Add test
Signed-off-by: Nico Burns <[email protected]>
1 parent 51b9235 commit f51d789

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

parley/src/tests/test_basic.rs

+40
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,46 @@ fn full_width_inbox() {
112112
}
113113
}
114114

115+
#[test]
116+
fn inboxes_separated_by_whitespace() {
117+
let mut env = testenv!();
118+
119+
let text = " ";
120+
let mut builder = env.ranged_builder(text);
121+
builder.push_inline_box(InlineBox {
122+
id: 0,
123+
index: 0,
124+
width: 10.,
125+
height: 10.0,
126+
});
127+
builder.push_inline_box(InlineBox {
128+
id: 1,
129+
index: 1,
130+
width: 10.0,
131+
height: 10.0,
132+
});
133+
builder.push_inline_box(InlineBox {
134+
id: 2,
135+
index: 2,
136+
width: 10.0,
137+
height: 10.0,
138+
});
139+
builder.push_inline_box(InlineBox {
140+
id: 3,
141+
index: 3,
142+
width: 10.0,
143+
height: 10.0,
144+
});
145+
let mut layout = builder.build(text);
146+
layout.break_all_lines(Some(100.));
147+
layout.align(
148+
None,
149+
Alignment::Start,
150+
false, /* align_when_overflowing */
151+
);
152+
env.check_layout_snapshot(&layout);
153+
}
154+
115155
#[test]
116156
fn trailing_whitespace() {
117157
let mut env = testenv!();
Loading

0 commit comments

Comments
 (0)