()
| 3665 | |
| 3666 | #[test] |
| 3667 | fn test_undo_different_kinds_not_grouped() { |
| 3668 | let mut state = TextEditState::default(); |
| 3669 | |
| 3670 | // Type then delete — different kinds, not grouped |
| 3671 | state.push_undo(UndoActionKind::InsertChar); |
| 3672 | state.insert_text("abc", None); |
| 3673 | state.push_undo(UndoActionKind::Backspace); |
| 3674 | state.backspace(); |
| 3675 | assert_eq!(state.text, "ab"); |
| 3676 | |
| 3677 | // First undo restores before backspace |
| 3678 | assert!(state.undo()); |
| 3679 | assert_eq!(state.text, "abc"); |
| 3680 | |
| 3681 | // Second undo restores before insert |
| 3682 | assert!(state.undo()); |
| 3683 | assert_eq!(state.text, ""); |
| 3684 | } |
| 3685 | |
| 3686 | #[test] |
| 3687 | fn test_redo_cleared_on_new_edit() { |
nothing calls this directly
no test coverage detected