Skip to content

Commit

Permalink
core::rand - adding test for task_rng()
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Patterson authored and brson committed Oct 2, 2012
1 parent c7354e6 commit 6c7459d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libcore/rand.rs
Expand Up @@ -487,6 +487,14 @@ pub mod tests {
assert r.shuffle(~[]) == empty;
assert r.shuffle(~[1, 1, 1]) == ~[1, 1, 1];
}

#[test]
pub fn task_rng() {
let r = rand::task_rng();
r.gen_int();
assert r.shuffle(~[1, 1, 1]) == ~[1, 1, 1];
assert r.gen_uint_range(0u, 1u) == 0u;
}
}


Expand Down

0 comments on commit 6c7459d

Please sign in to comment.