Skip to content

Commit 3302583

Browse files
author
Daniel Patterson
committed
---
yaml --- r: 30955 b: refs/heads/incoming c: 0b9a47a h: refs/heads/master i: 30953: 81165ed 30951: c5ef3b0 v: v3
1 parent cc18484 commit 3302583

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 92841793114d7e60e3227d9087dc8741e7592789
9+
refs/heads/incoming: 0b9a47a18969f770f57b84f50a22e48b97d6ea28
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/rand.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ pub fn task_rng() -> Rng {
334334
}
335335
}
336336

337+
/**
338+
* Returns a random uint, using the task's based random number generator.
339+
*/
340+
pub fn random() -> uint {
341+
task_rng().gen_uint()
342+
}
343+
337344

338345
#[cfg(test)]
339346
pub mod tests {
@@ -495,6 +502,12 @@ pub mod tests {
495502
assert r.shuffle(~[1, 1, 1]) == ~[1, 1, 1];
496503
assert r.gen_uint_range(0u, 1u) == 0u;
497504
}
505+
506+
#[test]
507+
pub fn random() {
508+
// not sure how to test this aside from just getting a number
509+
let _n : uint = rand::random();
510+
}
498511
}
499512

500513

0 commit comments

Comments
 (0)