summaryrefslogtreecommitdiffstats
path: root/src/features/diff_highlight.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/diff_highlight.rs')
-rw-r--r--src/features/diff_highlight.rs57
1 files changed, 16 insertions, 41 deletions
diff --git a/src/features/diff_highlight.rs b/src/features/diff_highlight.rs
index 35b71c4b..fa4cba1e 100644
--- a/src/features/diff_highlight.rs
+++ b/src/features/diff_highlight.rs
@@ -59,27 +59,14 @@ mod test_utils {
#[test]
fn test_diff_highlight_defaults() {
- let config = features::tests::make_config(&["--features", "diff-highlight"], None, None);
-
- assert_eq!(config.minus_style, features::tests::make_style("red"));
- assert_eq!(
- config.minus_non_emph_style,
- features::tests::make_style("red")
- );
- assert_eq!(
- config.minus_emph_style,
- features::tests::make_emph_style("red reverse")
- );
- assert_eq!(config.zero_style, features::tests::make_style(""));
- assert_eq!(config.plus_style, features::tests::make_style("green"));
- assert_eq!(
- config.plus_non_emph_style,
- features::tests::make_style("green")
- );
- assert_eq!(
- config.plus_emph_style,
- features::tests::make_emph_style("green reverse")
- );
+ let opt = features::tests::make_options(&["--features", "diff-highlight"], None, None);
+ assert_eq!(opt.minus_style, "red");
+ assert_eq!(opt.minus_non_emph_style, "red");
+ assert_eq!(opt.minus_emph_style, "red reverse");
+ assert_eq!(opt.zero_style, "normal");
+ assert_eq!(opt.plus_style, "green");
+ assert_eq!(opt.plus_non_emph_style, "green");
+ assert_eq!(opt.plus_emph_style, "green reverse");
}
#[test]
@@ -97,31 +84,19 @@ mod test_utils {
";
let git_config_path = "delta__test_diff_highlight.gitconfig";
- let config = features::tests::make_config(
+ let opt = features::tests::make_options(
&["--features", "diff-highlight"],
Some(git_config_contents),
Some(git_config_path),
);
- assert_eq!(config.minus_style, features::tests::make_style("red bold"));
- assert_eq!(
- config.minus_non_emph_style,
- features::tests::make_style("ul red bold")
- );
- assert_eq!(
- config.minus_emph_style,
- features::tests::make_emph_style("red bold 52")
- );
- assert_eq!(config.zero_style, features::tests::make_style(""));
- assert_eq!(config.plus_style, features::tests::make_style("green bold"));
- assert_eq!(
- config.plus_non_emph_style,
- features::tests::make_style("ul green bold")
- );
- assert_eq!(
- config.plus_emph_style,
- features::tests::make_emph_style("green bold 22")
- );
+ assert_eq!(opt.minus_style, "red bold");
+ assert_eq!(opt.minus_non_emph_style, "ul red bold");
+ assert_eq!(opt.minus_emph_style, "red bold 52");
+ assert_eq!(opt.zero_style, "normal");
+ assert_eq!(opt.plus_style, "green bold");
+ assert_eq!(opt.plus_non_emph_style, "ul green bold");
+ assert_eq!(opt.plus_emph_style, "green bold 22");
remove_file(git_config_path).unwrap();
}