diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-17 09:33:46 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-17 15:07:56 -0400 |
commit | 7bea5722dfcca915a241b15ec0d4d8729e81565a (patch) | |
tree | 9d98a13667d7d1574803d3775aa0cfee1e547b02 /src | |
parent | c2c279b5fb8b79d5ce2991682ca6a0c5958f87c3 (diff) |
Add failing test that whitespace errors are highlighted
Diffstat (limited to 'src')
-rw-r--r-- | src/tests/test_example_diffs.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/test_example_diffs.rs b/src/tests/test_example_diffs.rs index 1e4bc1d0..885ba51c 100644 --- a/src/tests/test_example_diffs.rs +++ b/src/tests/test_example_diffs.rs @@ -1107,6 +1107,17 @@ impl<'a> Alignment<'a> { │ } } + #[test] + fn test_whitespace_error() { + let whitespace_error_style = "bold yellow magenta ul"; + let config = integration_test_utils::make_config(&[ + "--whitespace-error-style", + whitespace_error_style, + ]); + let output = integration_test_utils::run_delta(DIFF_WITH_WHITESPACE_ERROR, &config); + ansi_test_utils::assert_line_has_style(&output, 6, " ", whitespace_error_style, &config); + } + const GIT_DIFF_SINGLE_HUNK: &str = "\ commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e Author: Dan Davison <dandavison7@gmail.com> @@ -1560,4 +1571,14 @@ index e69de29..8b13789 100644 @@ -0,0 +1 @@ + "; + + const DIFF_WITH_WHITESPACE_ERROR: &str = r" +diff --git c/a i/a +new file mode 100644 +index 0000000..8d1c8b6 +--- /dev/null ++++ i/a +@@ -0,0 +1 @@ ++ +"; } |