summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora14m <[email protected]>2021-04-04 01:39:23 +0200
committera14m <[email protected]>2021-04-04 01:39:23 +0200
commit82da71df436fc8650aff7932f736890ce42da72d (patch)
tree5e2f5e2fa256ca4c10728a5453c9f909d4385602
parentc125b8f303aee292e1875728d4dcb6efa3ca419f (diff)
Configure generators to be mockable
-rw-r--r--CLI/rust/src/game_of_life/generators/input.rs4
-rw-r--r--CLI/rust/src/game_of_life/generators/seed.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/CLI/rust/src/game_of_life/generators/input.rs b/CLI/rust/src/game_of_life/generators/input.rs
index 2ce8944..1f10a22 100644
--- a/CLI/rust/src/game_of_life/generators/input.rs
+++ b/CLI/rust/src/game_of_life/generators/input.rs
@@ -1,12 +1,16 @@
use crate::game_of_life::opts::Opts;
use crate::game_of_life::universe::Universe;
+#[cfg(test)]
+use mocktopus::macros::mockable;
+
/// Generate a new Universe/Board with a parsed local file or remote URL/file
///
/// If a URL is provided as an input (starting with http/ftp) the URL/File will be downloaded
/// and parsed to generate a seeding input for the simulation
/// otherwise, it'll be assumed that it's a path to a local file that will be parsed, and
/// used as the seeding input
+#[cfg_attr(test, mockable)]
pub(crate) fn new(opts: Opts) -> Universe {
unimplemented!()
}
diff --git a/CLI/rust/src/game_of_life/generators/seed.rs b/CLI/rust/src/game_of_life/generators/seed.rs
index 8a10ac0..9b28eaf 100644
--- a/CLI/rust/src/game_of_life/generators/seed.rs
+++ b/CLI/rust/src/game_of_life/generators/seed.rs
@@ -1,10 +1,14 @@
use crate::game_of_life::opts::Opts;
use crate::game_of_life::universe::Universe;
+#[cfg(test)]
+use mocktopus::macros::mockable;
+
/// Generate a new Universe/Board from a seed number
///
/// The generation of the seed should be stable across different machines
/// using the same language package, version, width and height.
+#[cfg_attr(test, mockable)]
pub(crate) fn new(opts: Opts) -> Universe {
unimplemented!()
}