Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test of chaining #9

Merged
merged 1 commit into from
Apr 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}