summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKalle Samuels <charles@derkarl.org>2018-04-27 09:37:53 +0000
committerAndrew Gallant <jamslam@gmail.com>2018-07-21 16:26:39 -0400
commit1d09d4d31ba3ac2eb09edf31e8ec46b2b5cec388 (patch)
treef1f9696f5a37500d3b4ae0b6d6f452ab77a1d7b4 /tests
parent02f08f3800611c214f8f51cd3bf8fcc9b24de331 (diff)
ripgrep: add support for lz4 decompression
This uses the lz4 binary for decompression. Closes #898
Diffstat (limited to 'tests')
-rw-r--r--tests/data/sherlock.lz4bin0 -> 365 bytes
-rw-r--r--tests/tests.rs20
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/data/sherlock.lz4 b/tests/data/sherlock.lz4
new file mode 100644
index 00000000..5913dbba
--- /dev/null
+++ b/tests/data/sherlock.lz4
Binary files differ
diff --git a/tests/tests.rs b/tests/tests.rs
index f3cc8f06..9920c118 100644
--- a/tests/tests.rs
+++ b/tests/tests.rs
@@ -1793,6 +1793,26 @@ be, to a very large extent, the result of luck. Sherlock Holmes
}
#[test]
+fn compressed_lz4() {
+ if !cmd_exists("lz4") {
+ return;
+ }
+ let lz4_file = include_bytes!("./data/sherlock.lz4");
+
+ let wd = WorkDir::new("feature_search_compressed");
+ wd.create_bytes("sherlock.lz4", lz4_file);
+
+ let mut cmd = wd.command();
+ cmd.arg("-z").arg("Sherlock").arg("sherlock.lz4");
+ let lines: String = wd.stdout(&mut cmd);
+ let expected = "\
+For the Doctor Watsons of this world, as opposed to the Sherlock
+be, to a very large extent, the result of luck. Sherlock Holmes
+";
+ assert_eq!(lines, expected);
+}
+
+#[test]
fn compressed_lzma() {
if !cmd_exists("xz") {
return;