diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/libutil/compression.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unit/libutil/compression.cc b/tests/unit/libutil/compression.cc index 0542e7d33..3b40db0cd 100644 --- a/tests/unit/libutil/compression.cc +++ b/tests/unit/libutil/compression.cc @@ -66,6 +66,16 @@ namespace nix { ASSERT_THROW(decompress(method, str), CompressionError); } + TEST(decompress, veryLongBrotli) { + auto method = "br"; + auto str = std::string(65536, 'a'); + auto o = decompress(method, compress(method, str)); + + // This is just to not print 64k of "a" for most failures + ASSERT_EQ(o.length(), str.length()); + ASSERT_EQ(o, str); + } + /* ---------------------------------------------------------------------------- * compression sinks * --------------------------------------------------------------------------*/ |