#![cfg_attr(feature = "galvanic_mock_integration", feature(proc_macro_hygiene))]
#[cfg(feature = "galvanic_mock_integration")]
extern crate galvanic_mock;
#[cfg(test)]
use galvanic_test::test_suite;
test_suite! {
test simple_test_in_unnamed_test_suite() {
assert!(true);
}
}
test_suite! {
name named_test_suite0;
test simple_test() {
assert!(true);
}
}
test_suite! {
name named_test_suite1;
fixture test_fixture() -> i32 {
setup(&mut self) {
42
}
}
test inject_fixture(test_fixture) {
assert_eq!(test_fixture.val, 42);
}
}
test_suite! {
name named_test_suite2;
fixture fixture_with_params(x: i32, y: i32) -> i32 {
setup(&mut self) {
self.x * self.y
}
}
test inject_fixture(fixture_with_params(6, 7)) {
assert_eq!(fixture_with_params.val, 42);
}
}
test_suite! {
name parameterised_test_suite;
fixture fixture_with_params(x: i32, y: i32) -> i32 {
params {
vec![(1,2), (2,3), (3,4)].into_iter()
}
setup(&mut self) {
self.x * self.y
}
}
test inject_fixture(fixture_with_params) {
let params = &fixture_with_params.params;
assert_eq!(fixture_with_params.val, params.x*params.y);
}
}