@@ -40,7 +40,9 @@ public async Task ReaderOnly()
4040 Assert . Throws < InvalidOperationException > ( ( ) => pipe . Writer . GetSpan ( ) ) ;
4141 Assert . Throws < InvalidOperationException > ( ( ) => duplex . Output . GetSpan ( ) ) ;
4242
43- Assert . Throws < InvalidOperationException > ( ( ) => pipe . Writer . Advance ( 0 ) ) ;
43+ // System.IO.Pipelines stopped throwing when Advance(0) is called after completion,
44+ // But we still feel it's useful to throw since it's a read-only pipe.
45+ pipe . Writer . Advance ( 0 ) ;
4446 Assert . Throws < InvalidOperationException > ( ( ) => duplex . Output . Advance ( 0 ) ) ;
4547
4648 var flushResult = await pipe . Writer . FlushAsync ( ) ;
@@ -51,8 +53,10 @@ public async Task ReaderOnly()
5153 pipe . Writer . CancelPendingFlush ( ) ;
5254 duplex . Output . CancelPendingFlush ( ) ;
5355
56+ #pragma warning disable CS0618 // Type or member is obsolete
5457 pipe . Writer . OnReaderCompleted ( ( ex , s ) => { } , null ) ;
5558 duplex . Output . OnReaderCompleted ( ( ex , s ) => { } , null ) ;
59+ #pragma warning restore CS0618 // Type or member is obsolete
5660
5761 pipe . Writer . Complete ( ) ;
5862 duplex . Output . Complete ( ) ;
@@ -78,8 +82,10 @@ public async Task WriterOnly()
7882 pipe . Reader . CancelPendingRead ( ) ;
7983 duplex . Input . CancelPendingRead ( ) ;
8084
85+ #pragma warning disable CS0618 // Type or member is obsolete
8186 pipe . Reader . OnWriterCompleted ( ( ex , s ) => { } , null ) ;
8287 duplex . Input . OnWriterCompleted ( ( ex , s ) => { } , null ) ;
88+ #pragma warning restore CS0618 // Type or member is obsolete
8389
8490 pipe . Reader . Complete ( ) ;
8591 duplex . Input . Complete ( ) ;
0 commit comments