diff --git a/tests/require/tests/modules/self_alias/init.luau b/tests/require/tests/modules/self_alias/init.luau index b8c85b9..5003e13 100644 --- a/tests/require/tests/modules/self_alias/init.luau +++ b/tests/require/tests/modules/self_alias/init.luau @@ -1,5 +1,5 @@ -local outer = require("./module") local inner = require("@self/module") +local outer = require("./module") assert(type(outer) == "table", "Outer module is not a table") assert(type(inner) == "table", "Inner module is not a table") diff --git a/tests/serde/compression/files.luau b/tests/serde/compression/files.luau index 6f32ed0..7c94cc8 100644 --- a/tests/serde/compression/files.luau +++ b/tests/serde/compression/files.luau @@ -1,3 +1,22 @@ +--[[ + The "compress" tests are currently disabled, and may not ever be enabled again. + + Unit testing that our compression implementation produces the exact result saved + in test files is very fragile and prone to breakage whenever one of the crates + we depend on for compression algorithms updates, be it to improve compression + ratio, speed, memory usage, or any other metric. + + Instead, we should focus on the correctness of the implementation, ensuring that + any files we know are good from other sources can be decompressed without issues. + + In the future, it is probably a good idea to rewrite these compression tests so + that they do not rely on any exact output, but instead call some external program + to verify that others can decompress without issues. This is a challenge in and of + itself since finding CLI programs for testing compression is near-impossible, but alas. +]] +local TEST_COMPRESS = false +local TEST_DECOMPRESS = true + local fs = require("@lune/fs") local process = require("@lune/process") local serde = require("@lune/serde") @@ -81,12 +100,22 @@ for _, test in TESTS do local target = fs.readFile(test.Target) -- Compression - testOperation("Compress", serde.compress, test.Format, source, target) - testOperation("Compress", serde.compress, test.Format, buffer.fromstring(source), target) + if TEST_COMPRESS then + testOperation("Compress", serde.compress, test.Format, source, target) + testOperation("Compress", serde.compress, test.Format, buffer.fromstring(source), target) + end -- Decompression - testOperation("Decompress", serde.decompress, test.Format, target, source) - testOperation("Decompress", serde.decompress, test.Format, buffer.fromstring(target), source) + if TEST_DECOMPRESS then + testOperation("Decompress", serde.decompress, test.Format, target, source) + testOperation( + "Decompress", + serde.decompress, + test.Format, + buffer.fromstring(target), + source + ) + end end if failed then