diff --git a/tests/setters.rs b/tests/setters.rs index d2b3def..19ba1c9 100644 --- a/tests/setters.rs +++ b/tests/setters.rs @@ -13,11 +13,16 @@ mod submodule { /// Multiple lines, even. #[set] private_accessible: usize, - + /// A doc comment. #[set = "pub"] public_accessible: usize, + /// This field is used for testing chaining. + #[set = "pub"] + second_public_accessible: bool, + + // /// A doc comment. // #[set = "pub(crate)"] // crate_accessible: usize, @@ -37,7 +42,7 @@ mod submodule { /// Multiple lines, even. #[set] private_accessible: T, - + /// A doc comment. #[set = "pub"] public_accessible: T, @@ -61,7 +66,7 @@ mod submodule { /// Multiple lines, even. #[set] private_accessible: T, - + /// A doc comment. #[set = "pub"] public_accessible: T, @@ -116,3 +121,11 @@ fn test_where() { let mut val = Where::default(); val.set_public_accessible(1); } + +#[test] +fn test_chaining() { + let mut val = Plain::default(); + val + .set_public_accessible(1) + .set_second_public_accessible(true); +}