Skip to content

Commit

Permalink
Merge pull request #9 from Hoverbear/chaining-test
Browse files Browse the repository at this point in the history
Add test of chaining
  • Loading branch information
Andrew Hobden committed Apr 22, 2018
2 parents 996e7e6 + fcdefeb commit 157c4b6
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tests/setters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -37,7 +42,7 @@ mod submodule {
/// Multiple lines, even.
#[set]
private_accessible: T,

/// A doc comment.
#[set = "pub"]
public_accessible: T,
Expand All @@ -61,7 +66,7 @@ mod submodule {
/// Multiple lines, even.
#[set]
private_accessible: T,

/// A doc comment.
#[set = "pub"]
public_accessible: T,
Expand Down Expand Up @@ -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);
}

0 comments on commit 157c4b6

Please sign in to comment.