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

Function test_no_styles_backspace

src/text_input.rs:3806–3817  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3804 #[test]
3805 #[cfg(feature = "text-styling")]
3806 fn test_no_styles_backspace() {
3807 let mut s = make_no_styles_state("a{red|b}c");
3808 // Put cursor at content 2 (before 'c')
3809 s.cursor_pos = styling::content_to_cursor(&s.text, 2, true);
3810 s.backspace_styled();
3811 // Should delete 'b', leaving "a...c"
3812 let stripped = styling::strip_styling(&s.text);
3813 assert_eq!(stripped, "ac");
3814 // Cursor should be at content 1 (between a and c)
3815 let cp = styling::cursor_to_content(&s.text, s.cursor_pos);
3816 assert_eq!(cp, 1);
3817 }
3818
3819 #[test]
3820 #[cfg(feature = "text-styling")]

Callers

nothing calls this directly

Calls 5

make_no_styles_stateFunction · 0.85
content_to_cursorFunction · 0.85
strip_stylingFunction · 0.85
cursor_to_contentFunction · 0.85
backspace_styledMethod · 0.80

Tested by

no test coverage detected