diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-09-28 16:30:57 -0400 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2016-09-28 16:32:29 -0400 |
commit | 925d0db9f032be79bfcd9cf618063dbe6ffc4f93 (patch) | |
tree | 8f535034121c0e2c2adc5d2d14948ce388e681bf /tests | |
parent | 316ffd87b3b521ecea555b80042ff5182eca5e6f (diff) |
Add -s/--case-sensitive flag.
This flag overrides both --smart-case and --ignore-case.
Closes #124.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tests.rs | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index 660b3523..62fc55a0 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -754,7 +754,8 @@ clean!(regression_105_part2, "test", ".", |wd: WorkDir, mut cmd: Command| { }); // See: https://github.com/BurntSushi/ripgrep/issues/20 -sherlock!(feature_20, "Sherlock", ".", |wd: WorkDir, mut cmd: Command| { +sherlock!(feature_20_no_filename, "Sherlock", ".", +|wd: WorkDir, mut cmd: Command| { cmd.arg("--no-filename"); let lines: String = wd.stdout(&mut cmd); @@ -766,7 +767,7 @@ be, to a very large extent, the result of luck. Sherlock Holmes }); // See: https://github.com/BurntSushi/ripgrep/issues/68 -clean!(feature_68, "test", ".", |wd: WorkDir, mut cmd: Command| { +clean!(feature_68_no_ignore_vcs, "test", ".", |wd: WorkDir, mut cmd: Command| { wd.create(".gitignore", "foo"); wd.create(".ignore", "bar"); wd.create("foo", "test"); @@ -778,7 +779,8 @@ clean!(feature_68, "test", ".", |wd: WorkDir, mut cmd: Command| { }); // See: https://github.com/BurntSushi/ripgrep/issues/70 -sherlock!(feature_70, "sherlock", ".", |wd: WorkDir, mut cmd: Command| { +sherlock!(feature_70_smart_case, "sherlock", ".", +|wd: WorkDir, mut cmd: Command| { cmd.arg("--smart-case"); let lines: String = wd.stdout(&mut cmd); @@ -832,7 +834,7 @@ sherlock\x00can extract a clew from a wisp of straw or a flake of cigar ash; }); // See: https://github.com/BurntSushi/ripgrep/issues/109 -clean!(max_depth, "far", ".", |wd: WorkDir, mut cmd: Command| { +clean!(feature_109_max_depth, "far", ".", |wd: WorkDir, mut cmd: Command| { wd.create_dir("one"); wd.create("one/pass", "far"); wd.create_dir("one/too"); @@ -842,10 +844,25 @@ clean!(max_depth, "far", ".", |wd: WorkDir, mut cmd: Command| { let lines: String = wd.stdout(&mut cmd); let expected = path("one/pass:far\n"); - assert_eq!(lines, expected); }); +// See: https://github.com/BurntSushi/ripgrep/issues/124 +clean!(feature_109_case_sensitive_part1, "test", ".", +|wd: WorkDir, mut cmd: Command| { + wd.create("foo", "tEsT"); + cmd.arg("--smart-case").arg("--case-sensitive"); + wd.assert_err(&mut cmd); +}); + +// See: https://github.com/BurntSushi/ripgrep/issues/124 +clean!(feature_109_case_sensitive_part2, "test", ".", +|wd: WorkDir, mut cmd: Command| { + wd.create("foo", "tEsT"); + cmd.arg("--ignore-case").arg("--case-sensitive"); + wd.assert_err(&mut cmd); +}); + #[test] fn binary_nosearch() { let wd = WorkDir::new("binary_nosearch"); |