#![forbid(unsafe_code)]
use ftui_core::geometry::Rect;
use ftui_render::frame::Frame;
use ftui_render::grapheme_pool::GraphemePool;
use ftui_widgets::Widget;
use ftui_widgets::textarea::TextArea;
#[test]
fn test_cursor_at_wrap_boundary_mid_line() {
let mut pool = GraphemePool::new();
let mut frame = Frame::new(2, 2, &mut pool);
let mut ta = TextArea::new()
.with_text("Hi你")
.with_soft_wrap(true)
.with_focus(true);
ta.move_to_document_start();
ta.move_right(); ta.move_right();
let area = Rect::new(0, 0, 2, 2);
Widget::render(&ta, area, &mut frame);
assert_eq!(frame.cursor_position, Some((0, 1)));
}