Write documentation for new iced_test APIs

This commit is contained in:
Héctor Ramón Jiménez 2025-09-12 22:53:28 +02:00
parent 5796ba272e
commit 59e2687146
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
6 changed files with 240 additions and 21 deletions

View file

@ -1,4 +1,4 @@
//! Run a simulation of your application.
//! Run a simulation of your application without side effects.
use crate::core;
use crate::core::clipboard;
use crate::core::event;
@ -366,6 +366,7 @@ pub fn click() -> impl Iterator<Item = Event> {
.into_iter()
}
/// Returns the sequence of events of a key press.
pub fn press_key(
key: impl Into<keyboard::Key>,
text: Option<SmolStr>,
@ -384,6 +385,7 @@ pub fn press_key(
})
}
/// Returns the sequence of events of a key release.
pub fn release_key(key: impl Into<keyboard::Key>) -> Event {
let key = key.into();