in src/components/splitting.rs [316:348]
fn test_many_sized() {
let splitter = Split::new(
vec![
Box::new(Echo::<Echo1>::new(false)),
Box::new(Echo::<Echo2>::new(false)),
Box::new(Echo::<Echo3>::new(false)),
],
Direction::Horizontal,
SplitKind::Sized(vec![0.25, 0.5, 0.25]),
);
let msg1 = Echo1(vec![
vec!["test", "ok"].try_into().unwrap(),
vec!["also"].try_into().unwrap(),
]);
let msg2 = Echo2(vec![vec!["hola"].try_into().unwrap()]);
let msg3 = Echo3(vec![vec!["way way way way too long"].try_into().unwrap()]);
let state = crate::state!(&msg1, &msg2, &msg3);
let output = splitter
.draw(&state, Dimensions::new(20, 20), DrawMode::Normal)
.unwrap();
let expected = vec![
vec!["test", "o", "hola", &" ".repeat(6), "way w"]
.try_into()
.unwrap(),
vec!["also", " ", &" ".repeat(10), &" ".repeat(5)]
.try_into()
.unwrap(),
];
assert_eq!(output, expected);
}