1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2024-12-12 19:18:24 +02:00
ripgrep/tests
Mika Dede a7f2d48234
printer: fix path handling in summarizer
This commit fixes a bug where both of the following commands always
reported an error:

    rg --files-with-matches foo file
    rg --files-without-match foo file

In particular, the printer was erroneously respecting the `path` option
even the the summary kind was `PathWithMatch` or `PathWithoutMatch`. The
documented behavior is that those summary kinds always require a path,
and thus, the `path` option has no effect. We fix this by correcting the
case analysis.

This also fixes a bug where the exit code for `--files-without-match`
was not set correctly. We update the printer's `has_match` method to
report the correct value.

Fixes #1106, Closes #1130
2019-01-22 21:37:23 -05:00
..
data grep-cli: support Brotli/Zstd decompression 2019-01-22 20:56:16 -05:00
feature.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
hay.rs tests: re-tool integration tests 2018-08-20 07:10:19 -04:00
json.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
macros.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
misc.rs grep-cli: support Brotli/Zstd decompression 2019-01-22 20:56:16 -05:00
multiline.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
regression.rs printer: fix path handling in summarizer 2019-01-22 21:37:23 -05:00
tests.rs edition: move core ripgrep to Rust 2018 2019-01-19 10:44:30 -05:00
util.rs tests: touch up tests on Windows 2018-08-21 23:05:52 -04:00