Skip to content

Commit

Permalink
test(wit-parser): add a test for stream
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <[email protected]>
  • Loading branch information
rvolosatovs committed Jan 17, 2025
1 parent 4353686 commit 7b40966
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions crates/wit-parser/tests/ui/streams-and-futures.wit
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface streams-and-futures {
resource r1;
type t6 = stream<r1>;
type t7 = future<result<r1>>;
type t8 = stream;

foo: func(x: stream<u32>, y: t6) -> future<result<list<string>, string>>;
}
22 changes: 16 additions & 6 deletions crates/wit-parser/tests/ui/streams-and-futures.wit.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"t5": 8,
"r1": 9,
"t6": 11,
"t7": 13
"t7": 13,
"t8": 14
},
"functions": {
"foo": {
Expand All @@ -20,7 +21,7 @@
"params": [
{
"name": "x",
"type": 14
"type": 15
},
{
"name": "y",
Expand All @@ -29,7 +30,7 @@
],
"results": [
{
"type": 17
"type": 18
}
]
}
Expand Down Expand Up @@ -155,6 +156,15 @@
"interface": 0
}
},
{
"name": "t8",
"kind": {
"stream": null
},
"owner": {
"interface": 0
}
},
{
"name": null,
"kind": {
Expand All @@ -173,7 +183,7 @@
"name": null,
"kind": {
"result": {
"ok": 15,
"ok": 16,
"err": "string"
}
},
Expand All @@ -182,7 +192,7 @@
{
"name": null,
"kind": {
"future": 16
"future": 17
},
"owner": null
}
Expand All @@ -196,4 +206,4 @@
"worlds": {}
}
]
}
}

0 comments on commit 7b40966

Please sign in to comment.