Skip to content

Commit

Permalink
dynamic attach test
Browse files Browse the repository at this point in the history
  • Loading branch information
cyypherus committed Feb 4, 2025
1 parent 149ba53 commit 37008c5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/tests/layout_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,22 @@ mod tests {
})
.draw(Area::new(0., 0., 100., 100.), &mut ());
}
#[test]
fn test_dynamic_attached() {
Layout::new({
row(vec![
space(),
draw(|a, _: &mut ()| {
assert_eq!(a, Area::new(25., 25., 25., 50.));
})
.attach_under(draw(|a, _: &mut ()| {
assert_eq!(a, Area::new(25., 25., 25., 50.));
}))
.dynamic_height(|h, _| h * 2.),
space(),
space(),
])
})
.draw(Area::new(0., 0., 100., 100.), &mut ());
}
}

0 comments on commit 37008c5

Please sign in to comment.