Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Apr 9, 2022
1 parent a2ac368 commit 2d21b35
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions epaint/src/text/text_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,3 +775,14 @@ fn is_chinese(c: char) -> bool {
|| ('\u{3400}' <= c && c <= '\u{4DBF}')
|| ('\u{2B740}' <= c && c <= '\u{2B81F}')
}

// ----------------------------------------------------------------------------

#[test]
fn test_zero_max_width() {
let mut fonts = FontsImpl::new(1.0, 1024, super::FontDefinitions::default());
let mut layout_job = LayoutJob::single_section("W".into(), super::TextFormat::default());
layout_job.wrap.max_width = 0.0;
let galley = super::layout(&mut fonts, layout_job.into());
assert_eq!(galley.rows.len(), 1);
}

0 comments on commit 2d21b35

Please sign in to comment.