We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f474c76 commit 1d12ddbCopy full SHA for 1d12ddb
src/layout.rs
@@ -463,6 +463,31 @@ impl Rect {
463
mod tests {
464
use super::*;
465
466
+ #[test]
467
+ fn test_vertical_split_by_height() {
468
+ let target = Rect {
469
+ x: 2,
470
+ y: 2,
471
+ width: 10,
472
+ height: 10,
473
+ };
474
+
475
+ let chunks = Layout::default()
476
+ .direction(Direction::Vertical)
477
+ .constraints(
478
+ [
479
+ Constraint::Percentage(10),
480
+ Constraint::Max(5),
481
+ Constraint::Min(1),
482
+ ]
483
+ .as_ref(),
484
+ )
485
+ .split(target);
486
487
+ assert_eq!(target.height, chunks.iter().map(|r| r.height).sum::<u16>());
488
+ chunks.windows(2).for_each(|w| assert!(w[0].y <= w[1].y));
489
+ }
490
491
#[test]
492
fn test_rect_size_truncation() {
493
for width in 256u16..300u16 {
0 commit comments