Files
moli/moli-protocol-cdp/tests/protocol_metadata.rs
T
ldm0 c5d91d50d0 perf(cdp): compact protocol metadata at build time
Parse the vendored schema with serde_json::Value and serialize compact JSON
in build.rs. Embed the generated bytes without request-time processing.
Verify the embedded protocol matches the complete vendored schema.

Validation on the unchanged final source tree: cargo fmt --all;
cargo clippy --workspace --all-targets --all-features -- -D warnings;
cargo nextest run --no-fail-fast (20,505 passed, 18 existing skips).
2026-10-21 23:16:23 +08:00

12 lines
473 B
Rust

use moli_protocol_cdp::CDP_PROTOCOL_JSON;
use serde_json::Value;
#[test]
fn embedded_protocol_preserves_the_complete_vendored_schema() {
let source = include_str!("../../vendor/v8-152.2.0/v8/include/js_protocol-1.3.json");
let original: Value = serde_json::from_str(source).expect("valid vendored CDP protocol");
let embedded: Value =
serde_json::from_str(CDP_PROTOCOL_JSON).expect("valid embedded CDP protocol");
assert_eq!(embedded, original);
}