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

Function test_undo_grouping_insert_char

src/text_input.rs:3625–3644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

push_undoMethod · 0.80
insert_textMethod · 0.80

Tested by

no test coverage detected