#[cfg(feature = "mock")]
#[macro_export]
macro_rules! mock_todo {
($message: expr, $value: expr) => {
$value
};
($value: expr) => {
$value
};
}
#[cfg(feature = "todo")]
#[macro_export]
macro_rules! mock_todo {
($message: expr, $value: expr) => {
todo!($message)
};
($value: expr) => {
todo!()
};
}
#[cfg(test)]
mod tests {
use super::*;
#[cfg(feature = "mock")]
#[test]
fn on() {
let result = mock_todo!("Fix", 1);
assert_eq!(result, 1);
}
#[cfg(feature = "mock")]
#[test]
fn on_empty_message() {
let result = mock_todo!(1);
assert_eq!(result, 1);
}
#[cfg(feature = "todo")]
#[test]
#[should_panic(expected = "not yet implemented: Fix")]
fn off() {
mock_todo!("Fix", 1)
}
#[cfg(feature = "todo")]
#[test]
#[should_panic(expected = "not yet implemented")]
fn off_empty_message() {
mock_todo!(1)
}
}