diff options
author | 2024-12-10 04:56:37 +0100 | |
---|---|---|
committer | 2024-12-10 04:56:37 +0100 | |
commit | 1713ac49f2ae794f78f24c01d6c21625b2c2879c (patch) | |
tree | 7a4ac6f2940c05bd024e62e7ac943e860246f09a | |
parent | 1aeb317f2dbfb63215e6226073e67878ffa6503b (diff) | |
download | iced-1713ac49f2ae794f78f24c01d6c21625b2c2879c.tar.gz iced-1713ac49f2ae794f78f24c01d6c21625b2c2879c.tar.bz2 iced-1713ac49f2ae794f78f24c01d6c21625b2c2879c.zip |
Decouple `iced_test` from `iced` crate
Diffstat (limited to '')
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | examples/todos/src/main.rs | 23 | ||||
-rw-r--r-- | src/lib.rs | 1 |
3 files changed, 11 insertions, 14 deletions
@@ -72,7 +72,6 @@ unconditional-rendering = ["iced_winit/unconditional-rendering"] iced_core.workspace = true iced_futures.workspace = true iced_renderer.workspace = true -iced_test.workspace = true iced_widget.workspace = true iced_winit.features = ["program"] iced_winit.workspace = true diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index ff38c6ce..f4b8d786 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -590,30 +590,29 @@ impl SavedState { mod tests { use super::*; - use iced::test; - use iced::test::selector; + use iced_test::{interface, load_font, selector, Error}; #[test] - fn it_creates_a_new_task() -> Result<(), test::Error> { - test::load_font(Todos::ICON_FONT)?; + fn it_creates_a_new_task() -> Result<(), Error> { + load_font(Todos::ICON_FONT)?; let (mut todos, _command) = Todos::new(); let _command = todos.update(Message::Loaded(Err(LoadError::File))); - let mut interface = test::interface(todos.view()); - let _input = interface.click("new-task")?; + let mut ui = interface(todos.view()); + let _input = ui.click("new-task")?; - interface.typewrite("Create the universe"); - interface.press_key(keyboard::key::Named::Enter); + ui.typewrite("Create the universe"); + ui.press_key(keyboard::key::Named::Enter); - for message in interface.into_messages() { + for message in ui.into_messages() { let _command = todos.update(message); } - let mut interface = test::interface(todos.view()); - let _ = interface.find(selector::text("Create the universe"))?; + let mut ui = interface(todos.view()); + let _ = ui.find(selector::text("Create the universe"))?; - let snapshot = interface.snapshot()?; + let snapshot = ui.snapshot()?; assert!( snapshot.matches_hash("snapshots/creates_a_new_task")?, "snapshots should match!" @@ -479,7 +479,6 @@ use iced_winit::runtime; pub use iced_futures::futures; pub use iced_futures::stream; -pub use iced_test as test; #[cfg(feature = "highlighter")] pub use iced_highlighter as highlighter; |