Detect more uppercase literals for --smart-case.

This changes the uppercase literal detection for the "smart case"
functionality. In particular, a character class is considered to have an
uppercase literal if at least one of its ranges starts or stops with an
uppercase literal.

Fixes #229
This commit is contained in:
Andrew Gallant
2016-11-28 17:57:26 -05:00
parent d12bdf35a5
commit 301a3fd71d
2 changed files with 25 additions and 1 deletions

View File

@@ -929,6 +929,13 @@ clean!(regression_228, "test", ".", |wd: WorkDir, mut cmd: Command| {
wd.assert_err(&mut cmd);
});
// See: https://github.com/BurntSushi/ripgrep/issues/229
clean!(regression_229, "[E]conomie", ".", |wd: WorkDir, mut cmd: Command| {
wd.create("foo", "economie");
cmd.arg("-S");
wd.assert_err(&mut cmd);
});
// See: https://github.com/BurntSushi/ripgrep/issues/7
sherlock!(feature_7, "-fpat", "sherlock", |wd: WorkDir, mut cmd: Command| {
wd.create("pat", "Sherlock\nHolmes");