diff options
| author | Noah Lev <camelidcamel@gmail.com> | 2021-08-26 16:34:43 -0700 |
|---|---|---|
| committer | Joshua Nelson <github@jyn.dev> | 2021-08-26 18:53:17 -0500 |
| commit | 352185d7784e9bff513d63c60ecef665894e76aa (patch) | |
| tree | a6f1b6a910d905123555bd1008d17656d48851cd /src/doc | |
| parent | 97f6dfef2e07467078f2f2d967a08a90307e7766 (diff) | |
| download | rust-352185d7784e9bff513d63c60ecef665894e76aa.tar.gz rust-352185d7784e9bff513d63c60ecef665894e76aa.zip | |
date-check: Recognize capitalized 'Date' as well
Now, if people use 'Date' instead of 'date', it won't be ignored.
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustc-dev-guide/ci/date-check/src/main.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/ci/date-check/src/main.rs b/src/doc/rustc-dev-guide/ci/date-check/src/main.rs index d78b430b5c7..bbea2bf38d9 100644 --- a/src/doc/rustc-dev-guide/ci/date-check/src/main.rs +++ b/src/doc/rustc-dev-guide/ci/date-check/src/main.rs @@ -39,7 +39,7 @@ fn make_date_regex() -> Regex { Regex::new( r"(?x) # insignificant whitespace mode <!--\s* - date:\s* + [dD]ate:\s* (?P<y>\d{4}) # year - (?P<m>\d{2}) # month @@ -187,6 +187,12 @@ mod tests { } #[test] + fn test_date_regex_capitalized() { + let regex = make_date_regex(); + assert!(regex.is_match("foo <!-- Date: 2021-08 --> bar")); + } + + #[test] fn test_collect_dates_from_file() { let text = "Test1\n<!-- date: 2021-01 -->\nTest2\nFoo<!-- date: 2021-02 \ -->\nTest3\nTest4\nFoo<!-- date: 2021-03 -->Bar\n<!-- date: 2021-04 \ |
