Introduce instruction::Target in test crate

This commit is contained in:
Héctor Ramón Jiménez 2025-08-20 13:47:34 +02:00
parent f9755b0b7a
commit bdcaadbe00
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 150 additions and 82 deletions

View file

@ -5,12 +5,20 @@ use crate::widget::operation::Operation;
/// The internal state of a widget that has text input.
pub trait TextInput {
/// Returns the current _visible_ text of the text input
///
/// Normally, this is either its value or its placeholder.
fn text(&self) -> &str;
/// Moves the cursor of the text input to the front of the input text.
fn move_cursor_to_front(&mut self);
/// Moves the cursor of the text input to the end of the input text.
fn move_cursor_to_end(&mut self);
/// Moves the cursor of the text input to an arbitrary location.
fn move_cursor_to(&mut self, position: usize);
/// Selects all the content of the text input.
fn select_all(&mut self);
}