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

Function test_undo_grouping_backspace

src/text_input.rs:3647–3664  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3645
3646 #[test]
3647 fn test_undo_grouping_backspace() {
3648 let mut state = TextEditState::default();
3649 state.text = "hello".to_string();
3650 state.cursor_pos = 5;
3651
3652 // Backspace 3 times
3653 state.push_undo(UndoActionKind::Backspace);
3654 state.backspace();
3655 state.push_undo(UndoActionKind::Backspace);
3656 state.backspace();
3657 state.push_undo(UndoActionKind::Backspace);
3658 state.backspace();
3659 assert_eq!(state.text, "he");
3660
3661 // Should undo all backspaces at once
3662 assert!(state.undo());
3663 assert_eq!(state.text, "hello");
3664 }
3665
3666 #[test]
3667 fn test_undo_different_kinds_not_grouped() {

Callers

nothing calls this directly

Calls 2

push_undoMethod · 0.80
backspaceMethod · 0.80

Tested by

no test coverage detected