mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-07-26 01:31:57 -07:00
ripgrep: add support for lz4 decompression
This uses the lz4 binary for decompression. Closes #898
This commit is contained in:
committed by
Andrew Gallant
parent
02f08f3800
commit
1d09d4d31b
@@ -1792,6 +1792,26 @@ be, to a very large extent, the result of luck. Sherlock Holmes
|
||||
assert_eq!(lines, expected);
|
||||
}
|
||||
|
||||
#[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") {
|
||||
|
Reference in New Issue
Block a user