diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-05-24 17:53:36 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-05-26 09:21:49 -0400 |
commit | 83ee16b03f9f45f7f9bd1851606d8329f4976dec (patch) | |
tree | a2c0e234cecbec4852f92b3185a5020465568460 /src/tests | |
parent | 39706ed18dc0375e4a298201d1bc37d2b41efef3 (diff) |
Implement --{commit,file,hunk-header}-{style,decoration-style}
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test_example_diffs.rs | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs index fc68f4e9..ea98b0b1 100644 --- a/src/tests/test_example_diffs.rs +++ b/src/tests/test_example_diffs.rs @@ -2,7 +2,6 @@ mod tests { use console::strip_ansi_codes; - use crate::cli::SectionStyle; use crate::tests::ansi_test_utils::ansi_test_utils; use crate::tests::integration_test_utils::integration_test_utils; @@ -207,7 +206,7 @@ mod tests { #[test] fn test_commit_style_plain() { let mut options = integration_test_utils::get_command_line_options(); - options.commit_style = SectionStyle::Plain; + options.commit_style = "plain".to_string(); // TODO: --commit-color has no effect in conjunction with --commit-style plain let (output, _) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_no_color( @@ -226,8 +225,8 @@ commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e #[test] fn test_commit_style_box() { let mut options = integration_test_utils::get_command_line_options(); - options.commit_style = SectionStyle::Box; - options.commit_color = "blue".to_string(); + options.commit_style = "box".to_string(); + options.deprecated_commit_color = Some("blue".to_string()); let (output, config) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_foreground_color( &output, @@ -262,8 +261,8 @@ commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e ┃ #[test] fn test_commit_style_underline() { let mut options = integration_test_utils::get_command_line_options(); - options.commit_style = SectionStyle::Underline; - options.commit_color = "yellow".to_string(); + options.commit_style = "underline".to_string(); + options.deprecated_commit_color = Some("yellow".to_string()); let (output, config) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_foreground_color( &output, @@ -290,7 +289,7 @@ commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e #[test] fn test_file_style_plain() { let mut options = integration_test_utils::get_command_line_options(); - options.file_style = SectionStyle::Plain; + options.file_style = "plain".to_string(); // TODO: --file-color has no effect in conjunction with --file-style plain let (output, _) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); for (i, line) in vec![ @@ -318,8 +317,8 @@ index 8e37a9e..6ce4863 100644 #[test] fn test_file_style_box() { let mut options = integration_test_utils::get_command_line_options(); - options.file_style = SectionStyle::Box; - options.file_color = "green".to_string(); + options.file_style = "box".to_string(); + options.deprecated_file_color = Some("green".to_string()); let (output, config) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_foreground_color( &output, @@ -354,8 +353,8 @@ src/align.rs │ #[test] fn test_file_style_underline() { let mut options = integration_test_utils::get_command_line_options(); - options.file_style = SectionStyle::Underline; - options.file_color = "magenta".to_string(); + options.file_style = "underline".to_string(); + options.deprecated_file_color = Some("magenta".to_string()); let (output, config) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_foreground_color( &output, @@ -382,7 +381,7 @@ src/align.rs #[test] fn test_hunk_style_plain() { let mut options = integration_test_utils::get_command_line_options(); - options.hunk_style = SectionStyle::Plain; + options.deprecated_hunk_style = Some("plain".to_string()); // TODO: --hunk-color has no effect in conjunction with --hunk-style plain let (output, _) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_no_color( @@ -397,8 +396,8 @@ src/align.rs #[test] fn test_hunk_style_box() { let mut options = integration_test_utils::get_command_line_options(); - options.hunk_style = SectionStyle::Box; - options.hunk_color = "white".to_string(); + options.deprecated_hunk_style = Some("box".to_string()); + options.deprecated_hunk_color = Some("white".to_string()); let (output, config) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_foreground_color( &output, @@ -427,8 +426,8 @@ src/align.rs #[test] fn test_hunk_style_underline() { let mut options = integration_test_utils::get_command_line_options(); - options.hunk_style = SectionStyle::Underline; - options.hunk_color = "black".to_string(); + options.deprecated_hunk_style = Some("underline".to_string()); + options.deprecated_hunk_color = Some("black".to_string()); let (output, config) = integration_test_utils::run_delta(GIT_DIFF_SINGLE_HUNK, options); ansi_test_utils::assert_line_has_foreground_color( &output, |