Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cdp/moon.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "moonbit-community/proton_cdp"

version = "0.9.0"
version = "0.9.1"

readme = "README.mbt.md"

Expand Down
6 changes: 3 additions & 3 deletions cdp/src/client/client_transport_wbtest.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
async test "response diagnostics precede consumption and cancellation clears state" {
@async.with_task_group(group => {
let server = @http.Server(@socket.Addr::parse("127.0.0.1:0"))
let port = server.addr.port()
let port = server.addr.port
let peer_closed = Ref(false)
let server_task = group.spawn(() => {
defer server.close()
Expand Down Expand Up @@ -73,7 +73,7 @@ async test "response diagnostics precede consumption and cancellation clears sta
async test "send failure clears registered command state" {
@async.with_task_group(group => {
let server = @http.Server(@socket.Addr::parse("127.0.0.1:0"))
let port = server.addr.port()
let port = server.addr.port
let server_task = group.spawn(() => {
defer server.close()
let (connection, _) = server.accept()
Expand Down Expand Up @@ -106,7 +106,7 @@ async test "send failure clears registered command state" {
async test "task group exit closes client after cancelling reader" {
@async.with_task_group(outer => {
let server = @http.Server(@socket.Addr::parse("127.0.0.1:0"))
let port = server.addr.port()
let port = server.addr.port
let peer_closed = Ref(false)
let server_task = outer.spawn(() => {
defer server.close()
Expand Down
4 changes: 2 additions & 2 deletions cdp/src/client/discovery.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -525,11 +525,11 @@ fn parse_discovered_target(
// Fetch a JSON discovery endpoint and reject non-2xx HTTP statuses.
async fn fetch_discovery_json(base_url : String, path : String) -> Json {
let url = "\{strip_trailing_slash(base_url)}\{path}"
let (response, body) = @http.get_binary(url)
let (response, body) = @http.get(url)
if response.code < 200 || response.code >= 300 {
raise HttpStatus(response.code, response.reason)
}
@json.parse(@utf8.decode(body))
body.json()
}

///|
Expand Down
32 changes: 16 additions & 16 deletions cdp/src/protocol/manifest_test.mbt
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ test "remote schema command builder reports unsupported local-only commands" {
}
guard unsupported
is Err(
@protocol.ProtocolSchemaError::UnsupportedRemoteCommand("Page.navigate")
@protocol.ProtocolSchemaError::UnsupportedRemoteCommand("Page.navigate"),
) else {
fail("expected UnsupportedRemoteCommand")
}
Expand Down Expand Up @@ -275,7 +275,7 @@ test "schema-aware command builder rejects invalid params" {
}
guard missing
is Err(
@protocol.ProtocolSchemaError::MissingParameter("Page.navigate", "url")
@protocol.ProtocolSchemaError::MissingParameter("Page.navigate", "url"),
) else {
fail("expected missing url")
}
Expand All @@ -289,7 +289,7 @@ test "schema-aware command builder rejects invalid params" {
}
guard unknown
is Err(
@protocol.ProtocolSchemaError::UnknownParameter("Page.navigate", "bad")
@protocol.ProtocolSchemaError::UnknownParameter("Page.navigate", "bad"),
) else {
fail("expected unknown param")
}
Expand All @@ -302,7 +302,7 @@ test "schema-aware command builder rejects invalid params" {
}
guard bad_shape
is Err(
@protocol.ProtocolSchemaError::ExpectedParamsObject("Runtime.enable")
@protocol.ProtocolSchemaError::ExpectedParamsObject("Runtime.enable"),
) else {
fail("expected params object")
}
Expand All @@ -327,8 +327,8 @@ test "schema-aware command builder rejects invalid params" {
@protocol.ProtocolSchemaError::InvalidParameterType(
"Runtime.evaluate",
"expression",
"string"
)
"string",
),
) else {
fail("expected invalid expression type")
}
Expand All @@ -339,7 +339,7 @@ test "schema-aware command builder rejects invalid params" {
}
guard empty_params
is Err(
@protocol.ProtocolSchemaError::MissingParameter("Page.navigate", "url")
@protocol.ProtocolSchemaError::MissingParameter("Page.navigate", "url"),
) else {
fail("expected missing url from empty params")
}
Expand All @@ -360,7 +360,7 @@ test "schema-aware response validator rejects invalid returns" {
}
guard missing_result
is Err(
@protocol.ProtocolSchemaError::MissingReturn("Page.navigate", "frameId")
@protocol.ProtocolSchemaError::MissingReturn("Page.navigate", "frameId"),
) else {
fail("expected missing frameId")
}
Expand Down Expand Up @@ -400,8 +400,8 @@ test "schema-aware response validator rejects invalid returns" {
@protocol.ProtocolSchemaError::InvalidReturnType(
"Page.navigate",
"frameId",
"FrameId"
)
"FrameId",
),
) else {
fail("expected invalid frameId type")
}
Expand All @@ -422,7 +422,7 @@ test "schema-aware response validator rejects invalid returns" {
}
guard bad_shape_result
is Err(
@protocol.ProtocolSchemaError::ExpectedResultObject("Runtime.enable")
@protocol.ProtocolSchemaError::ExpectedResultObject("Runtime.enable"),
) else {
fail("expected result object")
}
Expand Down Expand Up @@ -461,7 +461,7 @@ test "schema-aware response validator rejects invalid returns" {
}
guard no_required_result
is Err(
@protocol.ProtocolSchemaError::MissingReturn("Page.navigate", "frameId")
@protocol.ProtocolSchemaError::MissingReturn("Page.navigate", "frameId"),
) else {
fail("expected missing frameId without result")
}
Expand Down Expand Up @@ -490,8 +490,8 @@ test "schema-aware event builder rejects invalid params" {
is Err(
@protocol.ProtocolSchemaError::MissingParameter(
"Page.loadEventFired",
"timestamp"
)
"timestamp",
),
) else {
fail("expected missing timestamp")
}
Expand All @@ -507,8 +507,8 @@ test "schema-aware event builder rejects invalid params" {
@protocol.ProtocolSchemaError::InvalidParameterType(
"Page.loadEventFired",
"timestamp",
"Network.MonotonicTime"
)
"Network.MonotonicTime",
),
) else {
fail("expected invalid event timestamp")
}
Expand Down
Loading
Loading