The wire bytes of `depth/ .json`, length-checked before anything reads them.
(d: usize)
| 29 | |
| 30 | /// The wire bytes of `depth/<d>.json`, length-checked before anything reads them. |
| 31 | fn wire(d: usize) -> Vec<u8> { |
| 32 | let path: PathBuf = Path::new(env!("CARGO_MANIFEST_DIR")) |
| 33 | .join("tests/vectors/ingest/depth") |
| 34 | .join(format!("{d}.json")); |
| 35 | let bytes = fs::read(&path).unwrap_or_else(|e| panic!("read {path:?}: {e}")); |
| 36 | assert_eq!( |
| 37 | bytes.len(), |
| 38 | 2 * d + 4, |
| 39 | "{path:?} must be {d} open brackets, null, {d} close brackets and nothing else" |
| 40 | ); |
| 41 | bytes |
| 42 | } |
| 43 | |
| 44 | /// The value `depth/<d>.json` denotes, built by a loop rather than by a parse. |
| 45 | fn nested(d: usize) -> Value { |
no test coverage detected