summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/parse.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 8e93dd6a..eb82a2e2 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -258,6 +258,28 @@ mod tests {
use super::*;
#[test]
+ fn test_get_file_paths_from_diff_line() {
+ assert_eq!(
+ get_file_paths_from_diff_line("diff --git a/src/main.rs b/src/main.rs"),
+ (
+ Some("src/main.rs".to_string()),
+ Some("src/main.rs".to_string())
+ )
+ )
+ }
+
+ #[test]
+ fn test_get_file_paths_from_diff_line_with_spaces_in_file_paths() {
+ assert_eq!(
+ get_file_paths_from_diff_line("diff --git a/.config/Code - Insiders/User/settings.json b/.config/Code - Insiders/User/settings.json"),
+ (
+ Some(".config/Code - Insiders/User/settings.json".to_string()),
+ Some(".config/Code - Insiders/User/settings.json".to_string())
+ )
+ )
+ }
+
+ #[test]
fn test_get_file_extension_from_marker_line() {
assert_eq!(
get_file_extension_from_marker_line(