diff --git a/crates/util/src/paths.rs b/crates/util/src/paths.rs index 39b4064a1bd9d3c4c240abf9665b17151066e9ef..3ff07c67a8d2def75e4e7f756c4a466ea2b68ed0 100644 --- a/crates/util/src/paths.rs +++ b/crates/util/src/paths.rs @@ -601,6 +601,7 @@ const ROW_COL_CAPTURE_REGEX: &str = r"(?xs) | \((\d+)\)() # filename(row) ) + \:*$ | (.+?)(?: \:+(\d+)\:(\d+)\:*$ # filename:row:column @@ -2097,6 +2098,15 @@ mod tests { column: Some(9), } ); + + assert_eq!( + PathWithPosition::parse_str("main (1).log"), + PathWithPosition { + path: PathBuf::from("main (1).log"), + row: None, + column: None + } + ); } #[perf] @@ -2175,6 +2185,15 @@ mod tests { column: None } ); + + assert_eq!( + PathWithPosition::parse_str("C:\\Users\\someone\\main (1).log"), + PathWithPosition { + path: PathBuf::from("C:\\Users\\someone\\main (1).log"), + row: None, + column: None + } + ); } #[perf]