Skip to content

Commit a1bbde7

Browse files
author
Daniel Patterson
committed
---
yaml --- r: 22247 b: refs/heads/snap-stage3 c: 0b9a47a h: refs/heads/master i: 22245: 4c757c6 22243: 33a92b6 22239: 6e4f26e v: v3
1 parent fc1129d commit a1bbde7

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 92841793114d7e60e3227d9087dc8741e7592789
4+
refs/heads/snap-stage3: 0b9a47a18969f770f57b84f50a22e48b97d6ea28
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)