MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / test_undo_different_kinds_not_grouped

Function test_undo_different_kinds_not_grouped

src/text_input.rs:3667–3684  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

push_undoMethod · 0.80
insert_textMethod · 0.80
backspaceMethod · 0.80

Tested by

no test coverage detected