()
| 339 | |
| 340 | #[test] |
| 341 | fn stress() -> Result<()> { |
| 342 | let mut pool = StringPool::new(); |
| 343 | |
| 344 | let n = if cfg!(miri) { 100 } else { 10_000 }; |
| 345 | |
| 346 | for _ in 0..2 { |
| 347 | let atoms: TryVec<_> = (0..n).map(|i| pool.insert(&i.to_string())).try_collect()?; |
| 348 | |
| 349 | for atom in atoms { |
| 350 | assert!(pool.contains(atom)); |
| 351 | assert_eq!(&pool[atom], atom.index().to_string()); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | Ok(()) |
| 356 | } |
| 357 | |
| 358 | #[test] |
| 359 | fn roundtrip_serialize_deserialize() -> Result<()> { |