changeset 44893:be6401a25726

rust-regex: add test for verbatim regex syntax This makes sure it's not modified. Differential Revision: https://phab.mercurial-scm.org/D8508
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 07 May 2020 23:54:37 +0200
parents 1e9bfeaec9ba
children 09da5cf44772
files rust/hg-core/src/filepatterns.rs
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/filepatterns.rs	Thu May 07 23:53:12 2020 +0200
+++ b/rust/hg-core/src/filepatterns.rs	Thu May 07 23:54:37 2020 +0200
@@ -625,6 +625,15 @@
             .unwrap(),
             Some(br"(?:.*/)?rust/target(?:/|$)".to_vec()),
         );
+        assert_eq!(
+            build_single_regex(&IgnorePattern::new(
+                PatternSyntax::Regexp,
+                br"rust/target/\d+",
+                Path::new("")
+            ))
+            .unwrap(),
+            Some(br"rust/target/\d+".to_vec()),
+        );
     }
 
     #[test]