Prepare to 0 byte flush change (#2442)

This commit is contained in:
Pavel Krymets 2018-03-29 20:27:54 -07:00 committed by GitHub
parent cc8c140cca
commit 7b3491e11e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -84,11 +84,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
[InlineData(null, new byte[0])]
public void EncodesAsAscii(string input, byte[] expected)
{
var writerBuffer = _pipe.Writer;
var writer = new BufferWriter<PipeWriter>(writerBuffer);
var pipeWriter = _pipe.Writer;
var writer = new BufferWriter<PipeWriter>(pipeWriter);
writer.WriteAsciiNoValidation(input);
writer.Commit();
writerBuffer.FlushAsync().GetAwaiter().GetResult();
pipeWriter.FlushAsync().GetAwaiter().GetResult();
pipeWriter.Complete();
var reader = _pipe.Reader.ReadAsync().GetAwaiter().GetResult();
if (expected.Length > 0)