File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,6 +123,12 @@ impl use_stream_async::Guest for Component {
123123 ) -> Vec < Vec < [ u32 ; 5 ] > > {
124124 read_async_values ( rx) . await
125125 }
126+
127+ async fn read_stream_values_list_record (
128+ rx : StreamReader < Vec < ExampleRecord > > ,
129+ ) -> Vec < Vec < ExampleRecord > > {
130+ read_async_values ( rx) . await
131+ }
126132}
127133
128134async fn read_async_values < T > ( mut rx : StreamReader < T > ) -> Vec < T > {
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ interface use-stream-async {
229229 read-stream-values-list-u8 : async func (s : stream <list <u8 >>) -> list <list <u8 >>;
230230 read-stream-values-list-string : async func (s : stream <list <string >>) -> list <list <string >>;
231231 read-stream-values-fixed-list-u32 : async func (s : stream <list <list <u32 , 5 >>>) -> list <list <list <u32 , 5 >>>;
232- // read-stream-values-list-record: async func(s: stream<list<example-record>>) -> list<list<example-record>>;
232+ read-stream-values-list-record : async func (s : stream <list <example-record >>) -> list <list <example-record >>;
233233
234234 // // NOTE: the check here will be whether the resources are disposed inside the component properly
235235 // read-stream-values-example-resource-own: async func(s: stream<example-resource>);
Original file line number Diff line number Diff line change @@ -372,4 +372,22 @@ suite("stream<T> lowers", () => {
372372 ] ,
373373 ] ) ;
374374 } ) ;
375+
376+ test . concurrent ( "list<example-record>" , async ( ) => {
377+ assert . instanceOf ( instance [ "jco:test-components/use-stream-async" ] . readStreamValuesListRecord , AsyncFunction ) ;
378+
379+ let vals = [
380+ [ { id : 3 , idStr : "three" } ,
381+ { id : 2 , idStr : "two" } ,
382+ { id : 1 , idStr : "one" } , ] ,
383+ [ { id : 1 , idStr : "one-one" } ,
384+ { id : 2 , idStr : "two-two" } ,
385+ { id : 3 , idStr : "three-three" } , ] ,
386+ ] ;
387+ let returnedVals = await instance [ "jco:test-components/use-stream-async" ] . readStreamValuesListRecord (
388+ createReadableStreamFromValues ( vals ) ,
389+ ) ;
390+ assert . deepEqual ( returnedVals , vals ) ;
391+ } ) ;
392+
375393} ) ;
You can’t perform that action at this time.
0 commit comments