mirror of
https://github.com/ricoriedel/wipe.git
synced 2024-11-21 15:36:38 +00:00
Move mockall to dev-dependencies
This commit is contained in:
parent
d914bdfe75
commit
941ecfb757
@ -14,4 +14,6 @@ anyhow = "1.0"
|
||||
clap = { version = "3.1", features = ["derive"]}
|
||||
crossterm = "0.23"
|
||||
rand = "0.8"
|
||||
|
||||
[dev-dependencies]
|
||||
mockall = "0.11"
|
@ -4,9 +4,10 @@ pub mod rhombus;
|
||||
|
||||
use crate::vec::Vector;
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait Animation {
|
||||
fn sample(&self, step: f32, pos: Vector) -> f32;
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
/// Used to get a character with a given brightness.
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait CharSampler {
|
||||
/// Gets a character with the given brightness.
|
||||
/// # Arguments
|
||||
|
@ -1,8 +1,10 @@
|
||||
use crossterm::style::Color;
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
/// A collection of colors.
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait ColorSampler {
|
||||
/// Gets a color for the given fill.
|
||||
/// # Arguments
|
||||
|
@ -4,10 +4,11 @@ pub mod stripes;
|
||||
|
||||
use crate::vec::Vector;
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
/// Used to choose the colors of characters.
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait FillMode {
|
||||
/// Gets the color for this character.
|
||||
fn sample(&self, level: f32, pos: Vector) -> f32;
|
||||
|
@ -3,9 +3,10 @@ use crate::sampler::{Sample, Sampler};
|
||||
use crate::surface::Surface;
|
||||
use crate::Vector;
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait Renderer {
|
||||
fn render(&mut self, step: f32);
|
||||
fn present(&mut self) -> Result<(), Error>;
|
||||
|
@ -1,18 +1,20 @@
|
||||
use crossterm::style::Color;
|
||||
use mockall::automock;
|
||||
use crate::animation::Animation;
|
||||
use crate::char::CharSampler;
|
||||
use crate::color::ColorSampler;
|
||||
use crate::fill::FillMode;
|
||||
use crate::vec::Vector;
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
pub enum Sample {
|
||||
Keep,
|
||||
Draw { char: char, color: Color },
|
||||
Clear,
|
||||
}
|
||||
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait Sampler {
|
||||
fn sample(&self, step: f32, pos: Vector) -> Sample;
|
||||
}
|
||||
|
@ -3,11 +3,13 @@ use crossterm::cursor::MoveTo;
|
||||
use crossterm::{ExecutableCommand, QueueableCommand};
|
||||
use crossterm::style::{Color, Print, SetForegroundColor};
|
||||
use crossterm::terminal::{Clear, ClearType};
|
||||
use mockall::automock;
|
||||
use std::io::Write;
|
||||
use crate::array::Array2D;
|
||||
|
||||
#[automock]
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait Surface {
|
||||
fn width(&self) -> usize;
|
||||
fn height(&self) -> usize;
|
||||
|
@ -1,8 +1,10 @@
|
||||
use std::thread::sleep;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
||||
#[automock]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait Timer {
|
||||
fn sleep(&mut self);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user