Fix decoder tests
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Ben Harris 2020-04-28 21:16:38 -04:00
parent 8403fd8d0f
commit e2d93c593c
3 changed files with 4 additions and 4 deletions

View File

@ -60,7 +60,7 @@ namespace IrcTokens
_buffer = _buffer == null ? Array.Empty<byte>() : _buffer.Concat(data.Take(bytesReceived)).ToArray();
var listLines = _buffer.Split((byte) '\n').Select(l => l.Trim((byte) '\r')).ToList();
_buffer = listLines.Last();
_buffer = listLines.LastOrDefault() ?? Array.Empty<byte>();
var decodeLines = new List<Line>();
foreach (var line in listLines.SkipLast(1).Select(l => l.ToArray()))

View File

@ -66,7 +66,7 @@ namespace IrcTokens.Tests
public void TestEmpty()
{
var lines = _decoder.Push(string.Empty);
Assert.IsNull(lines);
Assert.AreEqual(0, lines.Count);
}
[TestMethod]
@ -74,7 +74,7 @@ namespace IrcTokens.Tests
{
_decoder.Push("PRIVMSG #channel hello");
var lines = _decoder.Push(string.Empty);
Assert.IsNull(lines);
Assert.AreEqual(0, lines.Count);
}
[TestMethod]

View File

@ -25,7 +25,7 @@ https://github.com/jesopo/irctokens)
### stateful
see the full example in [Sample/Client.cs](Sample/Client.cs)
see the full example in [TokensSample/Client.cs](TokensSample/Client.cs)
public class Client
{