From 8f608591bfb8115bf3b57a7173e33a028a19e108 Mon Sep 17 00:00:00 2001 From: sakno Date: Thu, 5 Dec 2024 19:18:06 +0200 Subject: [PATCH] Improved test coverage --- src/DotNext.Tests/Buffers/Binary/Leb128Tests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/DotNext.Tests/Buffers/Binary/Leb128Tests.cs b/src/DotNext.Tests/Buffers/Binary/Leb128Tests.cs index 8433f2395..9316f8f22 100644 --- a/src/DotNext.Tests/Buffers/Binary/Leb128Tests.cs +++ b/src/DotNext.Tests/Buffers/Binary/Leb128Tests.cs @@ -29,4 +29,11 @@ private static void EncodeDecode(ReadOnlySpan values) [Fact] public static void EncodeDecodeUInt32() => EncodeDecode([uint.MinValue, uint.MaxValue, 0x80U]); + + [Fact] + public static void EncodeDecodeEmptyBuffer() + { + False(Leb128.TryGetBytes(42, Span.Empty, out _)); + False(Leb128.TryParse(ReadOnlySpan.Empty, out _, out _)); + } } \ No newline at end of file