()
| 237 | |
| 238 | #[test] |
| 239 | fn with_replacement_allows_duplicates() { |
| 240 | let weights = vec![1.0]; // Only one item. |
| 241 | let table = AliasTable::new(&weights).unwrap(); |
| 242 | let mut rng = SeedableRng::from_seed_str("replace"); |
| 243 | |
| 244 | let selected = table.sample_with_replacement(&mut rng, 5); |
| 245 | assert_eq!(selected.len(), 5); |
| 246 | assert!(selected.iter().all(|&i| i == 0)); |
| 247 | } |
| 248 | |
| 249 | #[test] |
| 250 | fn deterministic_with_seed() { |
nothing calls this directly
no test coverage detected