Skip to content

Commit 78fb894

Browse files
committed
---
yaml --- r: 170794 b: refs/heads/try c: 6ca1f0c h: refs/heads/master v: v3
1 parent 26f0429 commit 78fb894

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 73a25f55ad748b4d3516417c711b99ce446591af
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: f677deeab397c8672c74fa134978df9aa10e0ff3
5+
refs/heads/try: 6ca1f0c6ea61760138c7e3cb4c14fa3be71c7414
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librand/chacha.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,5 +281,15 @@ mod test {
281281
0x11cfa18e, 0xd3c50049, 0x75c775f6, 0x434c6530,
282282
0x2c5bad8f, 0x898881dc, 0x5f1c86d9, 0xc1f8e7f4));
283283
}
284+
285+
#[test]
286+
fn test_rng_clone() {
287+
let seed : &[_] = &[0u32, ..8];
288+
let mut rng: ChaChaRng = SeedableRng::from_seed(seed);
289+
let mut clone = rng.clone();
290+
for _ in range(0u, 16) {
291+
assert_eq!(rng.next_u64(), clone.next_u64());
292+
}
293+
}
284294
}
285295

branches/try/src/librand/isaac.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,4 +609,14 @@ mod test {
609609
596345674630742204, 9947027391921273664, 11788097613744130851,
610610
10391409374914919106));
611611
}
612+
613+
#[test]
614+
fn test_rng_clone() {
615+
let seed: &[_] = &[1, 23, 456, 7890, 12345];
616+
let mut rng: Isaac64Rng = SeedableRng::from_seed(seed);
617+
let mut clone = rng.clone();
618+
for _ in range(0u, 16) {
619+
assert_eq!(rng.next_u64(), clone.next_u64());
620+
}
621+
}
612622
}

0 commit comments

Comments
 (0)