diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rs index 1852f4f44c..ecaa0d9bc2 100644 --- a/crates/util/src/paths.rs +++ b/crates/util/src/paths.rs @@ -169,7 +169,7 @@ impl> From for SanitizedPath { /// A delimiter to use in `path_query:row_number:column_number` strings parsing. pub const FILE_ROW_COLUMN_DELIMITER: char = ':'; -const ROW_COL_CAPTURE_REGEX: &str = r"(?x) +const ROW_COL_CAPTURE_REGEX: &str = r"(?xs) ([^\(]+)(?: \((\d+)[,:](\d+)\) # filename(row,column), filename(row:column) | @@ -624,6 +624,24 @@ mod tests { column: None } ); + + assert_eq!( + PathWithPosition::parse_str("ab\ncd"), + PathWithPosition { + path: PathBuf::from("ab\ncd"), + row: None, + column: None + } + ); + + assert_eq!( + PathWithPosition::parse_str("👋\nab"), + PathWithPosition { + path: PathBuf::from("👋\nab"), + row: None, + column: None + } + ); } #[test]