mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-28 09:21:55 +01:00
The four tests of the pre-open stream scan and the page hash test asserted elapsed time (5 s and 60 s), so a loaded machine could fail them and a slower but still bounded scan could pass them. - streams.rs: a test-only counter adds up the bytes the scan looks at: in each helper that walks the file, in each charge to the scan's budget, and once for each step of the main reading. The tests assert at most 32 bytes looked at for each byte of the file. The largest case today looks at 21. - editing.rs: a test-only counter adds up the page content the hash decodes. The test asserts no more than the hash limit plus the one stream that goes past it. Each counter assertion fails on a broken version: strings read to the end of the file instead of 64 bytes (131,076 bytes a byte), each stream keyword reading back 64 KiB (7,937 bytes a byte), and every page decoding the shared stream again (300 MiB decoded).