Add image and hash snapshot-based testing to iced_test
This commit is contained in:
parent
8e3636d769
commit
1aeb317f2d
17 changed files with 280 additions and 105 deletions
|
|
@ -1,13 +1,12 @@
|
|||
//! Create and run daemons that run in the background.
|
||||
use crate::application;
|
||||
use crate::program::{self, Program};
|
||||
use crate::theme;
|
||||
use crate::window;
|
||||
use crate::{Element, Executor, Font, Result, Settings, Subscription, Task};
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub use crate::shell::program::{Appearance, DefaultStyle};
|
||||
|
||||
/// Creates an iced [`Daemon`] given its title, update, and view logic.
|
||||
///
|
||||
/// A [`Daemon`] will not open a window by default, but will run silently
|
||||
|
|
@ -26,7 +25,7 @@ pub fn daemon<State, Message, Theme, Renderer>(
|
|||
where
|
||||
State: 'static,
|
||||
Message: Send + std::fmt::Debug + 'static,
|
||||
Theme: Default + DefaultStyle,
|
||||
Theme: Default + theme::Base,
|
||||
Renderer: program::Renderer,
|
||||
{
|
||||
use std::marker::PhantomData;
|
||||
|
|
@ -44,7 +43,7 @@ where
|
|||
for Instance<State, Message, Theme, Renderer, Update, View>
|
||||
where
|
||||
Message: Send + std::fmt::Debug + 'static,
|
||||
Theme: Default + DefaultStyle,
|
||||
Theme: Default + theme::Base,
|
||||
Renderer: program::Renderer,
|
||||
Update: application::Update<State, Message>,
|
||||
View: for<'a> self::View<'a, State, Message, Theme, Renderer>,
|
||||
|
|
@ -201,7 +200,7 @@ impl<P: Program> Daemon<P> {
|
|||
/// Sets the style logic of the [`Daemon`].
|
||||
pub fn style(
|
||||
self,
|
||||
f: impl Fn(&P::State, &P::Theme) -> Appearance,
|
||||
f: impl Fn(&P::State, &P::Theme) -> theme::Style,
|
||||
) -> Daemon<
|
||||
impl Program<State = P::State, Message = P::Message, Theme = P::Theme>,
|
||||
> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue