diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-20 17:05:26 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-20 17:05:26 -0400 |
commit | 7d36236e929d24a84fcac02985ab607a5eef4806 (patch) | |
tree | e9769759f0d9306baa0570c5b3d1ec30f4f960b4 | |
parent | be655baa7454c4d0dbc5cb3bb48e40eb5ac4f629 (diff) |
Add failing test: navigate key overridden in main section
-rw-r--r-- | src/features/navigate.rs | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/features/navigate.rs b/src/features/navigate.rs index ab2ed9a4..111f9167 100644 --- a/src/features/navigate.rs +++ b/src/features/navigate.rs @@ -27,6 +27,30 @@ mod tests { use crate::features; #[test] + fn test_navigate_with_overriden_key_in_main_section() { + let git_config_contents = b" +[delta] + features = navigate + file-modified-label = \"modified: \" +"; + let git_config_path = "delta__test_navigate_with_overriden_key_in_main_section.gitconfig"; + + assert_eq!(features::tests::make_config(&[], None, None).file_modified_label, ""); + assert_eq!( + features::tests::make_config(&["--features", "navigate"], None, None) + .file_modified_label, + "Δ" + ); + assert_eq!( + features::tests::make_config(&[], Some(git_config_contents), Some(git_config_path)) + .file_modified_label, + "modified: " + ); + + remove_file(git_config_path).unwrap(); + } + + #[test] fn test_navigate_with_overriden_key_in_custom_navigate_section() { let git_config_contents = b" [delta] @@ -38,7 +62,10 @@ mod tests { let git_config_path = "delta__test_navigate_with_overriden_key_in_custom_navigate_section.gitconfig"; - assert_eq!(features::tests::make_config(&[], None, None).file_modified_label, ""); + assert_eq!( + features::tests::make_config(&[], None, None).file_modified_label, + "" + ); assert_eq!( features::tests::make_config(&["--features", "navigate"], None, None) .file_modified_label, |