Skip to content
Permalink
Browse files

Add simple single-threaded test to `conc::sync::Treiber`.

  • Loading branch information...
ticki committed Jun 9, 2017
1 parent 75466b3 commit 51bab5cf9bc6ac200c64ef6c9cbe871d405a32a8
Showing with 13 additions and 0 deletions.
  1. +13 −0 conc/src/sync/treiber.rs
@@ -111,6 +111,19 @@ mod tests {
use std::thread;
use std::sync::Arc;

#[test]
fn simple() {
let stack = Treiber::new();
stack.push(1);
stack.push(200);
stack.push(44);

assert_eq!(*stack.pop().unwrap(), 44);
assert_eq!(*stack.pop().unwrap(), 200);
assert_eq!(*stack.pop().unwrap(), 1);
assert!(stack.pop().is_none());
}

#[test]
fn single_thread() {
let stack = Treiber::new();

0 comments on commit 51bab5c

Please sign in to comment.
You can’t perform that action at this time.