import test.util; import std.array : join; const len = 100_000; const phrase = cast(const(ubyte)[]) "Some very repetitive phrase.\n"; const input = generateRepetitiveData(len, phrase).join(); const squized = only(input) .compressZstd() .join(); const output = only(squized) .decompressZstd() .join(); assert(squized.length < input.length); assert(output == input); // for such long and repetitive data, ratio is around 0.047% const ratio = cast(double) squized.length / cast(double) input.length; assert(ratio < 0.0005);