diff options
author | dana <dana@dana.is> | 2017-07-29 10:54:10 -0500 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-07-30 17:55:24 -0400 |
commit | 6dce04963d4ee2d1bd6c17559d237f6dc88e048e (patch) | |
tree | de76da553c1a37ad4dbf650d069f2d5de63a1df3 /tests/tests.rs | |
parent | d4b790fd8d979591cee058e7014957b9f579380d (diff) |
Allow options with non-numeric arguments to accept leading hyphens in arguments (fixes #568)
Diffstat (limited to 'tests/tests.rs')
-rw-r--r-- | tests/tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 8e0c9e0b..86fab015 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1705,6 +1705,7 @@ fn regression_483_non_matching_exit_code() { wd.assert_err(&mut cmd); } + // See: https://github.com/BurntSushi/ripgrep/issues/506 #[test] fn regression_506_word_boundaries_not_parenthesized() { @@ -1720,7 +1721,19 @@ fn regression_506_word_boundaries_not_parenthesized() { let expected = "min\nmax\n"; assert_eq!(lines, expected); +} + +// See: https://github.com/BurntSushi/ripgrep/issues/568 +#[test] +fn regression_568_leading_hyphen_option_arguments() { + let wd = WorkDir::new("regression_568_leading_hyphen_option_arguments"); + let path = "file"; + wd.create(path, "foo bar baz\n"); + let mut cmd = wd.command(); + cmd.arg("-r").arg("-n").arg("-i").arg("bar").arg(path); + let lines: String = wd.stdout(&mut cmd); + assert_eq!(lines, "foo -n baz\n"); } #[test] |