mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Revert "test: Remove swappable-test" due to test failures
This reverts commit aabf84cdd8
.
This commit is contained in:
parent
055158d051
commit
d53e633bd5
13
src/test/run-pass/swappable-test.rs
Normal file
13
src/test/run-pass/swappable-test.rs
Normal file
@ -0,0 +1,13 @@
|
||||
import swappable::{swappable, methods};
|
||||
|
||||
fn main() {
|
||||
let d = swappable(3);
|
||||
assert d.get() == 3;
|
||||
d.set(4);
|
||||
assert d.get() == 4;
|
||||
d.swap { |i| i + 1 };
|
||||
assert d.get() == 5;
|
||||
assert d.with { |i| i + 1 } == 6;
|
||||
assert d.get() == 5;
|
||||
assert swappable::unwrap(d) == 5;
|
||||
}
|
Loading…
Reference in New Issue
Block a user