()
| 310 | |
| 311 | #[test] |
| 312 | fn dynamic_limit_adjustment() { |
| 313 | let budget = Budget::new(1024); |
| 314 | budget.try_reserve(600); |
| 315 | |
| 316 | // Increase limit. |
| 317 | budget.set_limit(2048); |
| 318 | assert_eq!(budget.limit(), 2048); |
| 319 | assert!(budget.try_reserve(1000)); |
| 320 | |
| 321 | // Decrease limit — but not below current allocation. |
| 322 | budget.set_limit(100); |
| 323 | assert_eq!(budget.limit(), 1600); // max(100, 1600 allocated) |
| 324 | } |
| 325 | |
| 326 | #[test] |
| 327 | fn try_reserve_arc_returns_shared_counter() { |
nothing calls this directly
no test coverage detected