core::rand - adding test for task_rng()

This commit is contained in:
Daniel Patterson 2012-10-01 23:48:33 -04:00 committed by Brian Anderson
parent c7354e6c10
commit 6c7459de99
1 changed files with 8 additions and 0 deletions

View File

@ -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;
}
}