v8: include CRDTP bindings in 147 Bazel builds

Add the `crdtp_binding.cc` source and CRDTP headers to the 147 Bazel V8
binding target so Windows GNU builds provide the symbols required by the
`v8::crdtp` Rust APIs.

Add a regression test that exercises CRDTP JSON conversion and dispatchable
message parsing.
This commit is contained in:
Channing Conger
2026-05-12 04:12:32 +00:00
parent 2f79c7ad9d
commit ca7d8f9a78
4 changed files with 56 additions and 2 deletions
+11
View File
@@ -78,4 +78,15 @@ mod tests {
fn evaluates_string_concatenation() {
assert_eq!(evaluate_expression("'hello ' + 'world'"), "hello world");
}
#[test]
fn parses_crdtp_dispatchable_messages() {
let cbor = v8::crdtp::json_to_cbor(br#"{"id":7,"method":"Runtime.evaluate","params":{}}"#)
.expect("JSON should convert to CBOR");
let dispatchable = v8::crdtp::Dispatchable::new(&cbor);
assert!(dispatchable.ok());
assert_eq!(dispatchable.call_id(), 7);
assert_eq!(dispatchable.method(), b"Runtime.evaluate");
}
}