Skip to content

Commit 6c7459d

Browse files
Daniel Pattersonbrson
Daniel Patterson
authored andcommitted
core::rand - adding test for task_rng()
1 parent c7354e6 commit 6c7459d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libcore/rand.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,14 @@ pub mod tests {
487487
assert r.shuffle(~[]) == empty;
488488
assert r.shuffle(~[1, 1, 1]) == ~[1, 1, 1];
489489
}
490+
491+
#[test]
492+
pub fn task_rng() {
493+
let r = rand::task_rng();
494+
r.gen_int();
495+
assert r.shuffle(~[1, 1, 1]) == ~[1, 1, 1];
496+
assert r.gen_uint_range(0u, 1u) == 0u;
497+
}
490498
}
491499

492500

0 commit comments

Comments
 (0)