()
| 3623 | |
| 3624 | #[test] |
| 3625 | fn test_undo_grouping_insert_char() { |
| 3626 | let mut state = TextEditState::default(); |
| 3627 | |
| 3628 | // Simulate typing "abc" one char at a time |
| 3629 | state.push_undo(UndoActionKind::InsertChar); |
| 3630 | state.insert_text("a", None); |
| 3631 | state.push_undo(UndoActionKind::InsertChar); |
| 3632 | state.insert_text("b", None); |
| 3633 | state.push_undo(UndoActionKind::InsertChar); |
| 3634 | state.insert_text("c", None); |
| 3635 | assert_eq!(state.text, "abc"); |
| 3636 | |
| 3637 | // Should undo all at once (grouped) |
| 3638 | assert!(state.undo()); |
| 3639 | assert_eq!(state.text, ""); |
| 3640 | assert_eq!(state.cursor_pos, 0); |
| 3641 | |
| 3642 | // No more undos |
| 3643 | assert!(!state.undo()); |
| 3644 | } |
| 3645 | |
| 3646 | #[test] |
| 3647 | fn test_undo_grouping_backspace() { |
nothing calls this directly
no test coverage detected