()
| 396 | |
| 397 | #[test] |
| 398 | fn test_try_allocate() { |
| 399 | let budget = MemoryBudget::new(1000); |
| 400 | |
| 401 | assert!(budget.try_allocate(500)); |
| 402 | assert_eq!(budget.allocated(), 500); |
| 403 | |
| 404 | assert!(!budget.try_allocate(600)); // Would exceed limit |
| 405 | assert_eq!(budget.allocated(), 500); // No change |
| 406 | } |
| 407 | |
| 408 | #[test] |
| 409 | fn test_available_memory() { |
nothing calls this directly
no outgoing calls
no test coverage detected