fn test_align_right()

in src/components/alignment.rs [230:257]


    fn test_align_right() {
        let mut state = State::new();
        let component = Aligned::new(
            Box::new(Echo::<Msg>::new(false)),
            HorizontalAlignmentKind::Right,
            VerticalAlignmentKind::Top,
        );
        let original = vec![
            vec!["hello world"].try_into().unwrap(),           // 11 chars
            vec!["pretty normal testsss"].try_into().unwrap(), // 21 chars
            vec!["shorts"].try_into().unwrap(),                // 6 chars
        ];
        let msg = Msg(original);
        state.insert(&msg);
        let dimensions = Dimensions::new(20, 20);
        let actual = component
            .draw(&state, dimensions, DrawMode::Normal)
            .unwrap();
        let expected = vec![
            vec![" ".repeat(9).as_ref(), "hello world"]
                .try_into()
                .unwrap(),
            vec!["pretty normal testss"].try_into().unwrap(),
            vec![" ".repeat(14).as_ref(), "shorts"].try_into().unwrap(),
        ];

        assert_eq!(actual, expected);
    }