()
| 227 | |
| 228 | #[test] |
| 229 | fn without_replacement_all() { |
| 230 | let weights = vec![1.0, 1.0, 1.0]; |
| 231 | let table = AliasTable::new(&weights).unwrap(); |
| 232 | let mut rng = SeedableRng::from_seed_str("all"); |
| 233 | |
| 234 | let selected = table.sample_without_replacement(&mut rng, 10); // More than n. |
| 235 | assert_eq!(selected.len(), 3); |
| 236 | } |
| 237 | |
| 238 | #[test] |
| 239 | fn with_replacement_allows_duplicates() { |
nothing calls this directly
no test coverage detected