max / makenotwork
- Co-Authored-By
- Claude Opus 5 (1M context) <noreply@anthropic.com>
1 file changed,
+17 insertions,
-0 deletions
| @@ -1412,6 +1412,23 @@ | |||
| 1412 | 1412 | oracle::check_plan(25 * MIB, MULTIPART_MAX_PART_SIZE as usize + 1); | |
| 1413 | 1413 | } | |
| 1414 | 1414 | ||
| 1415 | + | #[test] | |
| 1416 | + | fn the_limits_are_the_numbers_the_s3_contract_states() { | |
| 1417 | + | // Every one of these is written as an arithmetic expression, and an | |
| 1418 | + | // expression nothing asserts is a number nothing pins: mutation found | |
| 1419 | + | // that `5 * 1024 * 1024 * 1024` could become `5 + 1024 + 1024 + 1024` | |
| 1420 | + | // and no test noticed (infra `1498fe2a`). The plans built from them | |
| 1421 | + | // would still be self-consistent, which is exactly why the planner's | |
| 1422 | + | // own tests cannot catch it. Stated here in bytes, from the S3 API | |
| 1423 | + | // contract. | |
| 1424 | + | assert_eq!(MULTIPART_MIN_PART_SIZE, 5_242_880, "5 MiB"); | |
| 1425 | + | assert_eq!(MULTIPART_MAX_PARTS, 10_000); | |
| 1426 | + | assert_eq!(MULTIPART_MAX_PART_SIZE, 5_368_709_120, "5 GiB"); | |
| 1427 | + | assert_eq!(MULTIPART_MAX_OBJECT_SIZE, 5_497_558_138_880, "5 TiB"); | |
| 1428 | + | assert_eq!(MULTIPART_DEFAULT_PART_SIZE, 16_777_216, "16 MiB"); | |
| 1429 | + | assert_eq!(MAX_PRESIGN_EXPIRY_SECS, 604_800, "7 days, SigV4's maximum"); | |
| 1430 | + | } | |
| 1431 | + | ||
| 1415 | 1432 | #[test] | |
| 1416 | 1433 | #[should_panic(expected = "disagrees with div_ceil")] | |
| 1417 | 1434 | fn oracle_catches_a_part_count_the_client_would_reject() { |