-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split tests for field and var assignment.
- Loading branch information
1 parent
8001ffd
commit 8c46cbe
Showing
3 changed files
with
16 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
extern crate stainless; | ||
use stainless::*; | ||
|
||
#[var(field)] | ||
struct S { | ||
field: i32, | ||
} | ||
|
||
pub fn main() { | ||
// field assignment | ||
let mut s = S { field: 123 }; | ||
assert!(s.field == 123); | ||
s.field = 456; | ||
assert!(s.field == 456); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters