Skip to content

Commit

Permalink
Add smoke test for borrow usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dbkaplun committed May 12, 2018
1 parent adef57d commit 25c1fe3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/atom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,10 @@ fn lifo_drop() {
drop(atom);
assert_eq!(2, v.load(Ordering::SeqCst));
}

#[test]
fn borrow() {
let a = Atom::new(&5);
assert_eq!(a.swap(&7, Ordering::Relaxed), Some(&5));
assert_eq!(a.take(Ordering::Relaxed), Some(&7));
}

0 comments on commit 25c1fe3

Please sign in to comment.