use rstest::*; #[fixture] fn fx_base_impl_return() -> impl Iterator { std::iter::once(42) } #[fixture] fn fx_base_impl_input(mut fx_base_impl_return: impl Iterator) -> u32 { fx_base_impl_return.next().unwrap() } #[rstest] fn base_impl_return(mut fx_base_impl_return: impl Iterator) { assert_eq!(42, fx_base_impl_return.next().unwrap()); } #[rstest] fn base_impl_input(mut fx_base_impl_input: u32) { assert_eq!(42, fx_base_impl_input); } #[fixture] fn fx_nested_impl_return() -> impl Iterator { std::iter::once(42) } #[fixture] fn fx_nested_impl_input(mut fx_nested_impl_return: impl Iterator) -> String { fx_nested_impl_return.next().unwrap().to_string() } #[rstest] fn nested_impl_return(mut fx_nested_impl_return: impl Iterator) { assert_eq!("42", fx_nested_impl_return.next().unwrap().to_string()); } #[rstest] fn nested_impl_input(mut fx_nested_impl_input: String) { assert_eq!("42", &fx_nested_impl_input); } #[fixture] fn fx_nested_multiple_impl_return() -> (impl Iterator, impl ToString) { (std::iter::once(42), 42i32) } #[fixture] fn fx_nested_multiple_impl_input(mut fx_nested_multiple_impl_return: (impl Iterator, impl ToString)) -> bool { fx_nested_multiple_impl_return.0.next().unwrap().to_string() == fx_nested_multiple_impl_return.1.to_string() } #[rstest] fn nested_multiple_impl_return(mut fx_nested_multiple_impl_return: (impl Iterator, impl ToString)) { assert_eq!(fx_nested_multiple_impl_return.0.next().unwrap().to_string(), fx_nested_multiple_impl_return.1.to_string()); } #[rstest] fn nested_multiple_impl_input(fx_nested_multiple_impl_input: bool) { assert!(fx_nested_multiple_impl_input); }