Debian Codegraph @

src/tests/test_example_diffs.rs

raw symbols SCIP
1 #[cfg(test)]
2 mod testsrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ {
3 use craterust-analyzer cargo git-delta 0.19.2 crate/::ansirust-analyzer cargo git-delta 0.19.2 ansi/::{selfrust-analyzer cargo git-delta 0.19.2 ansi/, strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().};
4 use craterust-analyzer cargo git-delta 0.19.2 crate/::clirust-analyzer cargo git-delta 0.19.2 cli/::InspectRawLinesrust-analyzer cargo git-delta 0.19.2 cli/InspectRawLines#;
5 use craterust-analyzer cargo git-delta 0.19.2 crate/::deltarust-analyzer cargo git-delta 0.19.2 delta/::{DiffTyperust-analyzer cargo git-delta 0.19.2 delta/DiffType#, Staterust-analyzer cargo git-delta 0.19.2 delta/State#};
6 use craterust-analyzer cargo git-delta 0.19.2 crate/::handlersrust-analyzer cargo git-delta 0.19.2 handlers/::hunk_headerrust-analyzer cargo git-delta 0.19.2 handlers/hunk_header/::ParsedHunkHeaderrust-analyzer cargo git-delta 0.19.2 handlers/hunk_header/ParsedHunkHeader#;
7 use craterust-analyzer cargo git-delta 0.19.2 crate/::stylerust-analyzer cargo git-delta 0.19.2 style/;
8 use craterust-analyzer cargo git-delta 0.19.2 crate/::testsrust-analyzer cargo git-delta 0.19.2 tests/::ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/::ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/;
9 use craterust-analyzer cargo git-delta 0.19.2 crate/::testsrust-analyzer cargo git-delta 0.19.2 tests/::integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/;
10 use craterust-analyzer cargo git-delta 0.19.2 crate/::testsrust-analyzer cargo git-delta 0.19.2 tests/::integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#;
11 use instarust-analyzer cargo insta 1.39.0 crate/::assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!;
12
13 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
14 fn test_added_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_added_file().() {
15 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
16 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(ADDED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILE_INPUT.)
17 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("\nadded: a.py\n");
18 }
19
20 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
21 fn test_added_empty_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_added_empty_file().() {
22 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
23 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(ADDED_EMPTY_FILErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_EMPTY_FILE.)
24 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("\nadded: file\n");
25 }
26
27 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
28 fn test_added_file_directory_path_containing_spacerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_added_file_directory_path_containing_space().() {
29 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
30 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(ADDED_FILES_DIRECTORY_PATH_CONTAINING_SPACErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILES_DIRECTORY_PATH_CONTAINING_SPACE.)
31 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("\nadded: with space/file1\n")
32 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("\nadded: nospace/file2\n");
33 }
34
35 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
36 fn test_renamed_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_renamed_file().() {
37 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
38 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(RENAMED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/RENAMED_FILE_INPUT.)
39 .expect_contains_oncerust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains_once().("\nrenamed: a.py ⟶ b.py\n");
40 }
41
42 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
43 fn test_copied_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_copied_file().() {
44 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
45 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_WITH_COPIED_FILErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_WITH_COPIED_FILE.)
46 .expect_contains_oncerust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains_once().("\ncopied: first_file ⟶ copied_file\n");
47 }
48
49 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
50 fn test_renamed_file_with_changesrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_renamed_file_with_changes().() {
51 let t = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
52 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(RENAMED_FILE_WITH_CHANGES_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/RENAMED_FILE_WITH_CHANGES_INPUT.)
53 .expect_contains_oncerust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains_once().(
54 "\nrenamed: Casks/font-dejavusansmono-nerd-font.rb ⟶ Casks/font-dejavu-sans-mono-nerd-font.rb\n"
55 );
56 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", t.outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output.);
57 }
58
59 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
60 fn test_recognized_file_typerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_recognized_file_type().() {
61 // In addition to the background color, the code has language syntax highlighting.
62 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
63 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::get_line_of_code_from_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/get_line_of_code_from_delta().(
64 ADDED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILE_INPUT.,
65 14,
66 "class X:",
67 &config,
68 );
69 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_has_color_other_than_plus_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_has_color_other_than_plus_color().(&output, &config);
70 }
71
72 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
73 fn test_unrecognized_file_type_with_syntax_themerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_unrecognized_file_type_with_syntax_theme().() {
74 // In addition to the background color, the code has the foreground color using the default
75 // .txt syntax under the theme.
76 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
77 let input = ADDED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILE_INPUT..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().("a.py", "a");
78 let output =
79 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::get_line_of_code_from_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/get_line_of_code_from_delta().(&input, 14, "class X:", &config);
80 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_has_color_other_than_plus_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_has_color_other_than_plus_color().(&output, &config);
81 }
82
83 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
84 fn test_unrecognized_file_type_no_syntax_themerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_unrecognized_file_type_no_syntax_theme().() {
85 // The code has the background color only. (Since there is no theme, the code has no
86 // foreground ansi color codes.)
87 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
88 "--syntax-theme",
89 "none",
90 "--width",
91 "variable",
92 ]);
93 let input = ADDED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILE_INPUT..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().("a.py", "a");
94 let output =
95 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::get_line_of_code_from_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/get_line_of_code_from_delta().(&input, 14, "class X:", &config);
96 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_has_plus_color_onlyrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_has_plus_color_only().(&output, &config);
97 }
98
99 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
100 fn test_default_language_is_used_for_syntax_highlightingrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_default_language_is_used_for_syntax_highlighting().() {
101 // Note: default-language will be used for files with no extension, but also
102 // for files with an extension, but for which the language was not detected.
103 // Use color-only so that we can refer to the line numbers from the input diff.
104 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
105 "--color-only",
106 "--default-language",
107 "bash",
108 ]);
109 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(MODIFIED_BASH_AND_CSHARP_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/MODIFIED_BASH_AND_CSHARP_FILES., &config);
110 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_syntax_highlighted_substringrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_syntax_highlighted_substring().(
111 &output,
112 12,
113 1,
114 " rsync -avu --delete $src/ $dst",
115 "abc.bash",
116 Staterust-analyzer cargo git-delta 0.19.2 delta/State#::HunkZerorust-analyzer cargo git-delta 0.19.2 delta/State#HunkZero#(DiffTyperust-analyzer cargo git-delta 0.19.2 delta/DiffType#::Unifiedrust-analyzer cargo git-delta 0.19.2 delta/DiffType#Unified#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#),
117 &config,
118 );
119 }
120
121 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
122 fn test_default_language_is_not_used_when_other_language_is_detectedrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_default_language_is_not_used_when_other_language_is_detected().() {
123 // Use color-only so that we can refer to the line numbers from the input diff.
124 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
125 "--color-only",
126 "--default-language",
127 "bash",
128 ]);
129 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(MODIFIED_BASH_AND_CSHARP_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/MODIFIED_BASH_AND_CSHARP_FILES., &config);
130 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_syntax_highlighted_substringrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_syntax_highlighted_substring().(
131 &output,
132 19,
133 1,
134 " static void Main(string[] args)",
135 "abc.cs",
136 Staterust-analyzer cargo git-delta 0.19.2 delta/State#::HunkZerorust-analyzer cargo git-delta 0.19.2 delta/State#HunkZero#(DiffTyperust-analyzer cargo git-delta 0.19.2 delta/DiffType#::Unifiedrust-analyzer cargo git-delta 0.19.2 delta/DiffType#Unified#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#),
137 &config,
138 );
139 }
140
141 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
142 fn test_full_filename_used_to_detect_languagerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_full_filename_used_to_detect_language().() {
143 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
144 "--color-only",
145 "--default-language",
146 "txt",
147 ]);
148 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(MODIFIED_DOCKER_AND_RS_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/MODIFIED_DOCKER_AND_RS_FILES., &config);
149 let ansi = ansirust-analyzer cargo git-delta 0.19.2 ansi/::explain_ansirust-analyzer cargo git-delta 0.19.2 ansi/explain_ansi().(&output, false);
150
151 // Ensure presence and absence of highlighting. Do not use `assert_line_has_syntax_highlighted_substring`
152 // because it uses the same code path as the one to be tested here.
153 let expected = r"(normal)diff --git a/Dockerfile b/Dockerfile
154 index 0123456..1234567 100644
155 --- a/Dockerfile
156 +++ b/Dockerfile
157 @@ -0,0 +2 @@
158 (normal 22)+(203)FROM(231) foo(normal)
159 (normal 22)+(203)COPY(231) bar baz(normal)
160 diff --git a/rs b/rs
161 index 0123456..1234567 100644
162 --- a/rs
163 +++ b/rs
164 @@ -0,0 +2 @@
165 (normal 22)+(231)fn foobar() -> i8 {(normal)
166 (normal 22)+(231) 8(normal)
167 (normal 22)+(231)}(normal)
168 ";
169 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(expected, ansi);
170 }
171
172 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
173 fn test_diff_unified_two_filesrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_unified_two_files().() {
174 let config =
175 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--file-modified-label", "comparing:"]);
176 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_UNIFIED_TWO_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_UNIFIED_TWO_FILES., &config);
177 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
178 let mut lines = output.linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().();
179
180 // Header
181 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(1).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), "comparing: one.rs ⟶ src/two.rs");
182 // Change
183 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(7).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), "println!(\"Hello ruster\");");
184 // Unchanged in second chunk
185 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(7).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), "Unchanged");
186 }
187
188 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
189 fn test_diff_unified_two_directoriesrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_unified_two_directories().() {
190 let config =
191 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--width", "80", "--navigate"]);
192 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_UNIFIED_TWO_DIRECTORIESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_UNIFIED_TWO_DIRECTORIES., &config);
193 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
194 let mut lines = output.linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().();
195
196 // Header
197 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(1).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), "Δ a/different ⟶ b/different");
198 // Change
199 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(7).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), "This is different from b");
200 // File uniqueness
201 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(2).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(), "Only in a/: just_a");
202 // DiffHeader divider
203 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(lines.nextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Lines<'a>`][Iterator]next().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().().starts_withrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]starts_with().("───────"));
204 // Next hunk
205 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
206 lines.nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(4).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().(),
207 "Δ a/more_difference ⟶ b/more_difference"
208 );
209 }
210
211 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
212 fn test_diff_unified_concatenatedrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_unified_concatenated().() {
213 // See #1002. Line buffers were not being flushed correctly, leading to material from first
214 // file last hunk appearing at beginning of second file first hunk.
215 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
216 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(DIFF_UNIFIED_CONCATENATEDrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_UNIFIED_CONCATENATED.)
217 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("\nLINES.\n\n1/y 2022-03-06");
218 }
219
220 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
221 #[ignore] // Ideally, delta would make this test pass. See #121.
222 fn test_delta_ignores_non_diff_inputrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_delta_ignores_non_diff_input().() {
223 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
224 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(NOT_A_DIFF_OUTPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/NOT_A_DIFF_OUTPUT., &config);
225 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
226 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(output, NOT_A_DIFF_OUTPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/NOT_A_DIFF_OUTPUT..to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().() +rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String][`Add<&str>`]add(). "\n");
227 }
228
229 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
230 fn test_certain_bugs_are_not_presentrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_certain_bugs_are_not_present().() {
231 for input in [
232 DIFF_EXHIBITING_PARSE_FILE_NAME_BUGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_EXHIBITING_PARSE_FILE_NAME_BUG.,
233 DIFF_EXHIBITING_STATE_MACHINE_PARSER_BUGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_EXHIBITING_STATE_MACHINE_PARSER_BUG.,
234 DIFF_EXHIBITING_TRUNCATION_BUGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_EXHIBITING_TRUNCATION_BUG.,
235 ] {
236 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--raw"]);
237 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(input, &config);
238 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output), input);
239 assert_nerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_ne!!(output, input);
240 }
241 }
242
243 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
244 fn test_delta_paints_diff_when_there_is_unrecognized_initial_contentrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_delta_paints_diff_when_there_is_unrecognized_initial_content().() {
245 for input in [
246 DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_1rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_1.,
247 DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_2rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_2.,
248 ] {
249 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--raw"]);
250 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(input, &config);
251 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output), input);
252 assert_nerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_ne!!(output, input);
253 }
254 }
255
256 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
257 fn test_diff_with_merge_conflict_is_not_truncatedrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_with_merge_conflict_is_not_truncated().() {
258 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
259 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_MERGE_CONFLICTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_MERGE_CONFLICT., &config);
260 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output));
261 }
262
263 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
264 fn test_diff_with_merge_conflict_is_passed_on_unchanged_under_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_with_merge_conflict_is_passed_on_unchanged_under_raw().() {
265 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--raw"]);
266 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_MERGE_CONFLICTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_MERGE_CONFLICT., &config);
267 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output), DIFF_WITH_MERGE_CONFLICTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_MERGE_CONFLICT.);
268 }
269
270 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
271 fn test_simple_dirty_submodule_diffrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_simple_dirty_submodule_diff().() {
272 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--width", "30"])
273 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(SUBMODULE_DIRTYrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_DIRTY.)
274 .inspectrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]inspect().()
275 .expect_after_skiprust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_after_skip().(
276 1,
277 r#"
278 some_submodule
279 ──────────────────────────────
280 ca030fd1a022..803be42ca46a"#,
281 );
282 }
283
284 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
285 fn test_submodule_diff_logrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_submodule_diff_log().() {
286 // See etc/examples/662-submodules
287 // diff.submodule = log
288 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--width", "49"]);
289 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(SUBMODULE_DIFF_LOGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_DIFF_LOG., &config);
290 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
291 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(output, SUBMODULE_DIFF_LOG_EXPECTED_OUTPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_DIFF_LOG_EXPECTED_OUTPUT.);
292 }
293
294 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
295 fn test_submodule_contains_untracked_contentrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_submodule_contains_untracked_content().() {
296 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
297 let output =
298 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(SUBMODULE_CONTAINS_UNTRACKED_CONTENT_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_CONTAINS_UNTRACKED_CONTENT_INPUT., &config);
299 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
300 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("\nSubmodule x/y/z contains untracked content\n"));
301 }
302
303 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
304 fn test_triple_dash_at_beginning_of_line_in_coderust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_triple_dash_at_beginning_of_line_in_code().() {
305 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
306 let output =
307 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(TRIPLE_DASH_AT_BEGINNING_OF_LINE_IN_CODErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/TRIPLE_DASH_AT_BEGINNING_OF_LINE_IN_CODE., &config);
308 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
309 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("-- instance (Category p, Category q) => Category (p ∧ q) where\n"));
310 }
311
312 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
313 fn test_binary_files_differrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_binary_files_differ().() {
314 let output = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--file-modified-label", "modified:"])
315 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(BINARY_FILES_DIFFERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILES_DIFFER.)
316 .skip_headerrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]skip_header().();
317
318 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(output, @r###"
319
320 modified: foo (binary file)
321 ───────────────────────────────────────────
322 "###);
323 }
324
325 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
326 fn test_binary_file_addedrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_binary_file_added().() {
327 let output = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
328 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(BINARY_FILE_ADDEDrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILE_ADDED.)
329 .skip_headerrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]skip_header().();
330 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(output, @r###"
331
332 added: foo (binary file)
333 ───────────────────────────────────────────
334 "###);
335 }
336
337 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
338 fn test_binary_file_removedrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_binary_file_removed().() {
339 let output = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
340 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(BINARY_FILE_REMOVEDrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILE_REMOVED.)
341 .skip_headerrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]skip_header().();
342 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(output, @r###"
343
344 removed: foo (binary file)
345 ───────────────────────────────────────────
346 "###);
347 }
348
349 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
350 fn test_binary_files_differ_after_otherrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_binary_files_differ_after_other().() {
351 let output = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--file-modified-label", "modified:"])
352 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(BINARY_FILES_DIFFER_AFTER_OTHERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILES_DIFFER_AFTER_OTHER.)
353 .outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output.;
354 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(output, @r###"
355
356
357 renamed: foo ⟶ bar
358 ───────────────────────────────────────────
359
360 modified: qux (binary file)
361 ───────────────────────────────────────────
362 "###);
363 }
364
365 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
366 fn test_diff_in_diffrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_in_diff().() {
367 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
368 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_IN_DIFFrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_IN_DIFF., &config);
369 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
370 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("\n---\n"));
371 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("\nSubject: [PATCH] Init\n"));
372 }
373
374 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
375 fn test_standalone_diff_files_are_identicalrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_standalone_diff_files_are_identical().() {
376 let diff = "Files foo and bar are identical\n";
377 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
378 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(diff, &config);
379 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output), diff);
380 }
381
382 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
383 fn test_standalone_diff_binary_files_differrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_standalone_diff_binary_files_differ().() {
384 let diff = "Binary files foo and bar differ\n";
385 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
386 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(diff, &config);
387 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output), diff);
388 }
389
390 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
391 fn test_diff_no_index_binary_files_differrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_diff_no_index_binary_files_differ().() {
392 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
393 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_NO_INDEX_BINARY_FILES_DIFFERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_NO_INDEX_BINARY_FILES_DIFFER., &config);
394 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
395 strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output),
396 "Binary files foo bar and sub dir/foo bar baz differ\n"
397 );
398 }
399
400 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
401 fn test_commit_style_raw_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_raw_no_decoration().() {
402 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
403 "--commit-style",
404 "raw",
405 "--commit-decoration-style",
406 "omit",
407 ]);
408 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
409 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(
410 &output,
411 0,
412 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
413 );
414 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
415 "\
416 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
417 "
418 ));
419 }
420
421 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
422 fn test_commit_style_colored_input_color_is_stripped_under_normalrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_colored_input_color_is_stripped_under_normal().() {
423 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
424 "--commit-style",
425 "normal",
426 "--commit-decoration-style",
427 "omit",
428 ]);
429 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
430 GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.,
431 &config,
432 );
433 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(
434 &output,
435 0,
436 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
437 );
438 }
439
440 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
441 fn test_commit_style_colored_input_color_is_preserved_under_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_colored_input_color_is_preserved_under_raw().() {
442 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
443 "--commit-style",
444 "raw",
445 "--commit-decoration-style",
446 "omit",
447 ]);
448 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
449 GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.,
450 &config,
451 );
452 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_4_bit_color_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_4_bit_color_style().(
453 &output,
454 0,
455 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
456 "bold 31",
457 &config,
458 );
459 }
460
461 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
462 fn test_orphan_carriage_return_is_strippedrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_orphan_carriage_return_is_stripped().() {
463 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[]);
464 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
465 GIT_DIFF_SINGLE_HUNK_WITH_SEQUENCE_OF_CR_ESCAPE_SEQUENCES_LFrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_SEQUENCE_OF_CR_ESCAPE_SEQUENCES_LF.,
466 &config,
467 );
468 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]bytes().().allrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/iter/impl#[`Bytes<'_>`][Iterator]all().(|b: u8| b != b'\r'));
469 }
470
471 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
472 fn test_commit_decoration_style_omitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_decoration_style_omit().() {
473 _do_test_commit_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_no_decoration().(&[
474 "--commit-style",
475 "blue",
476 "--commit-decoration-style",
477 "omit",
478 ]);
479 }
480
481 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
482 fn test_commit_decoration_style_empty_stringrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_decoration_style_empty_string().() {
483 _do_test_commit_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_no_decoration().(&[
484 "--commit-style",
485 "blue",
486 "--commit-decoration-style",
487 "",
488 ]);
489 }
490
491 fn _do_test_commit_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_no_decoration().(args: &[&str]) {
492 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
493 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
494 if false {
495 // `--commit-style xxx` is not honored yet: always behaves like xxx=raw
496 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
497 &output,
498 0,
499 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
500 "blue",
501 &config,
502 );
503 }
504 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
505 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e"));
506 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │"));
507 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
508 "\
509 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
510 ───────────────────────────────────────────────"
511 ));
512 }
513
514 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
515 fn test_commit_style_omitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_omit().() {
516 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--commit-style", "omit"]);
517 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
518 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
519 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
520 "\
521 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
522 "
523 ));
524 }
525
526 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
527 fn test_commit_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_box().() {
528 _do_test_commit_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_box().(&[
529 "--commit-style",
530 "blue",
531 "--commit-decoration-style",
532 "blue box",
533 ]);
534 }
535
536 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
537 fn test_commit_style_box_ulrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_box_ul().() {
538 _do_test_commit_style_box_ulrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_box_ul().(&[
539 "--commit-style",
540 "blue",
541 "--commit-decoration-style",
542 "blue box ul",
543 "--width=64",
544 ]);
545 }
546
547 #[ignore]
548 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
549 fn test_commit_style_box_olrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_box_ol().() {
550 _do_test_commit_style_box_olrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_box_ol().(&[
551 "--commit-style",
552 "blue",
553 "--commit-decoration-style",
554 "blue box ol",
555 ]);
556 }
557
558 fn _do_test_commit_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_box().(args: &[&str]) {
559 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
560 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
561 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
562 &output,
563 0,
564 "────────────────────────────────────────────────┐",
565 "blue",
566 &config,
567 );
568 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
569 &output,
570 1,
571 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │",
572 "blue",
573 &config,
574 );
575 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
576 &output,
577 2,
578 "────────────────────────────────────────────────┘",
579 "blue",
580 &config,
581 );
582 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
583 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
584 "\
585 ────────────────────────────────────────────────┐
586 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │
587 ────────────────────────────────────────────────┘
588 "
589 ));
590 }
591
592 fn _do_test_commit_style_box_ulrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_box_ul().(args: &[&str]) {
593 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
594 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
595 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
596 &output,
597 0,
598 "────────────────────────────────────────────────┐",
599 "blue",
600 &config,
601 );
602 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
603 &output,
604 1,
605 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │",
606 "blue",
607 &config,
608 );
609 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
610 &output,
611 2,
612 "────────────────────────────────────────────────┴─",
613 "blue",
614 &config,
615 );
616 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
617 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
618 "\
619 ────────────────────────────────────────────────┐
620 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │
621 ────────────────────────────────────────────────┴─"
622 ));
623 }
624
625 fn _do_test_commit_style_box_olrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_box_ol().(args: &[&str]) {
626 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
627 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
628 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
629 &output,
630 0,
631 "────────────────────────────────────────────────┬─",
632 "blue",
633 &config,
634 );
635 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
636 &output,
637 1,
638 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │",
639 "blue",
640 &config,
641 );
642 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
643 &output,
644 2,
645 "────────────────────────────────────────────────┘",
646 "blue",
647 &config,
648 );
649 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
650 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
651 "\
652 ────────────────────────────────────────────────┬─
653 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │
654 ────────────────────────────────────────────────┘
655 "
656 ));
657 }
658
659 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
660 fn test_commit_style_box_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_box_raw().() {
661 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
662 "--commit-style",
663 "raw",
664 "--commit-decoration-style",
665 "box ul",
666 "--width=64",
667 ]);
668 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
669 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(
670 &output,
671 1,
672 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │",
673 );
674 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
675 "\
676 ────────────────────────────────────────────────┐
677 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e │
678 ────────────────────────────────────────────────┴─"
679 ));
680 }
681
682 // TODO: test overline
683
684 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
685 fn test_commit_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_underline().() {
686 _do_test_commit_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_underline().(&[
687 "--commit-style",
688 "yellow",
689 "--commit-decoration-style",
690 "yellow underline",
691 ]);
692 }
693
694 fn _do_test_commit_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_commit_style_underline().(args: &[&str]) {
695 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
696 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
697 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
698 &output,
699 0,
700 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
701 "yellow",
702 &config,
703 );
704 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
705 &output,
706 1,
707 "───────────────────────────────────────────────",
708 "yellow",
709 &config,
710 );
711 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
712 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
713 "\
714 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
715 ───────────────────────────────────────────────"
716 ));
717 }
718
719 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
720 fn test_file_style_raw_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_raw_no_decoration().() {
721 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
722 "--file-style",
723 "raw",
724 "--file-decoration-style",
725 "omit",
726 ]);
727 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
728 for (i, line) in [
729 "diff --git a/src/align.rs b/src/align.rs",
730 "index 8e37a9e..6ce4863 100644",
731 "--- a/src/align.rs",
732 "+++ b/src/align.rs",
733 ]
734 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
735 .enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().()
736 {
737 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(&output, 6 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i, line);
738 }
739 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
740 "
741 diff --git a/src/align.rs b/src/align.rs
742 index 8e37a9e..6ce4863 100644
743 --- a/src/align.rs
744 +++ b/src/align.rs
745 "
746 ));
747 }
748
749 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
750 fn test_file_style_colored_input_color_is_stripped_under_normalrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_colored_input_color_is_stripped_under_normal().() {
751 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
752 "--file-style",
753 "normal",
754 "--file-decoration-style",
755 "omit",
756 ]);
757 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
758 GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.,
759 &config,
760 );
761 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(&output, 7, "src/align.rs");
762 }
763
764 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
765 fn test_file_style_colored_input_color_is_preserved_under_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_colored_input_color_is_preserved_under_raw().() {
766 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
767 "--file-style",
768 "raw",
769 "--file-decoration-style",
770 "omit",
771 ]);
772 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
773 GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.,
774 &config,
775 );
776 for (i, line) in [
777 "diff --git a/src/align.rs b/src/align.rs",
778 "index 8e37a9e..6ce4863 100644",
779 "--- a/src/align.rs",
780 "+++ b/src/align.rs",
781 ]
782 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
783 .enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().()
784 {
785 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_4_bit_color_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_4_bit_color_style().(&output, 6 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().i, line, "31", &config)
786 }
787 }
788
789 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
790 fn test_file_decoration_style_omitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_decoration_style_omit().() {
791 _do_test_file_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_no_decoration().(&[
792 "--file-style",
793 "green",
794 "--file-decoration-style",
795 "omit",
796 ]);
797 }
798
799 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
800 fn test_file_decoration_style_empty_stringrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_decoration_style_empty_string().() {
801 _do_test_file_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_no_decoration().(&[
802 "--file-style",
803 "green",
804 "--file-decoration-style",
805 "",
806 ]);
807 }
808
809 fn _do_test_file_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_no_decoration().(args: &[&str]) {
810 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
811 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
812 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 7, "src/align.rs", "green", &config);
813 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
814 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("src/align.rs"));
815 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("src/align.rs │"));
816 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
817 "
818 src/align.rs
819 ────────────"
820 ));
821 }
822
823 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
824 fn test_file_style_omitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_omit().() {
825 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--file-style", "omit"]);
826 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
827 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("src/align.rs"));
828 }
829
830 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
831 fn test_file_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_box().() {
832 _do_test_file_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_box().(&[
833 "--file-style",
834 "green",
835 "--file-decoration-style",
836 "green box",
837 ]);
838 }
839
840 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
841 fn test_file_style_box_ulrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_box_ul().() {
842 _do_test_file_style_box_ulrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_box_ul().(&[
843 "--file-style",
844 "green",
845 "--file-decoration-style",
846 "green box ul",
847 ]);
848 }
849
850 #[ignore]
851 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
852 fn test_file_style_box_olrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_box_ol().() {
853 _do_test_file_style_box_olrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_box_ol().(&[
854 "--file-style",
855 "green",
856 "--file-decoration-style",
857 "green box ol",
858 ]);
859 }
860
861 fn _do_test_file_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_box().(args: &[&str]) {
862 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
863 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
864 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 7, "─────────────┐", "green", &config);
865 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, "src/align.rs │", "green", &config);
866 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 9, "─────────────┘", "green", &config);
867 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
868 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
869 "
870 ─────────────┐
871 src/align.rs │
872 ─────────────┘
873 "
874 ));
875 }
876
877 fn _do_test_file_style_box_ulrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_box_ul().(args: &[&str]) {
878 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
879 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
880 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 7, "─────────────┐", "green", &config);
881 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, "src/align.rs │", "green", &config);
882 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 9, "─────────────┴─", "green", &config);
883 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
884 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
885 "
886 ─────────────┐
887 src/align.rs │
888 ─────────────┴─"
889 ));
890 }
891
892 fn _do_test_file_style_box_olrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_box_ol().(args: &[&str]) {
893 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
894 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
895 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 7, "─────────────┬─", "green", &config);
896 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, "src/align.rs │", "green", &config);
897 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 9, "─────────────┘", "green", &config);
898 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
899 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
900 "
901 ─────────────┬─
902 src/align.rs │
903 ─────────────┘
904 "
905 ));
906 }
907
908 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
909 fn test_file_style_box_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_box_raw().() {
910 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
911 "--file-style",
912 "raw",
913 "--file-decoration-style",
914 "box ul",
915 ]);
916 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
917 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(&output, 8, "src/align.rs │");
918 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
919 "
920 ─────────────┐
921 src/align.rs │
922 ─────────────┴─"
923 ));
924 }
925
926 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
927 fn test_file_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_underline().() {
928 _do_test_file_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_underline().(&[
929 "--file-style",
930 "magenta",
931 "--file-decoration-style",
932 "magenta underline",
933 ]);
934 }
935
936 fn _do_test_file_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_file_style_underline().(args: &[&str]) {
937 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
938 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
939 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 7, "src/align.rs", "magenta", &config);
940 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, "────────────", "magenta", &config);
941 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
942 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
943 "
944 src/align.rs
945 ────────────"
946 ));
947 }
948
949 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
950 fn test_hunk_header_style_raw_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_raw_no_decoration().() {
951 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
952 "--hunk-header-style",
953 "raw",
954 "--hunk-header-decoration-style",
955 "omit",
956 ]);
957 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
958 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(
959 &output,
960 9,
961 "@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {",
962 );
963 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"));
964 }
965
966 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
967 fn test_hunk_header_style_raw_no_decoration_with_line_numbersrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_raw_no_decoration_with_line_numbers().() {
968 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
969 "--hunk-header-style",
970 "raw",
971 "--hunk-header-decoration-style",
972 "omit",
973 "--line-numbers",
974 ]);
975 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
976 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
977 "
978 @@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"
979 ));
980 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
981 "
982
983 @@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"
984 ));
985 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(
986 &output,
987 9,
988 "@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {",
989 );
990 }
991
992 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
993 fn test_color_only_output_is_in_one_to_one_correspondence_with_inputrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_color_only_output_is_in_one_to_one_correspondence_with_input().() {
994 let user_suppliable_configs: &[&[&str]] = &[
995 &["--color-only", "--light"],
996 &["--color-only", "--dark"],
997 &["--color-only", "--line-numbers"],
998 &["--color-only", "--side-by-side"],
999 &["--color-only", "--diff-highlight"],
1000 &["--color-only", "--diff-so-fancy"],
1001 &["--color-only", "--navigate"],
1002 &["--color-only", "--hyperlinks"],
1003 &["--color-only", "--keep-plus-minus-markers"],
1004 &["--color-only", "--raw"],
1005 &["--color-only", "--syntax-theme", "Monokai Extended"],
1006 &["--color-only", "--minus-style", "syntax bold auto"],
1007 &["--color-only", "--zero-style", "red strike"],
1008 &["--color-only", "--plus-style", "red blink"],
1009 &["--color-only", "--minus-emph-style", "red dim"],
1010 &["--color-only", "--minus-non-emph-style", "red hidden"],
1011 &["--color-only", "--plus-emph-style", "red reverse"],
1012 &["--color-only", "--plus-non-emph-style", "red bold ul"],
1013 &["--color-only", "--commit-style", "red bold ul"],
1014 &[
1015 "--color-only",
1016 "--commit-decoration-style",
1017 "bold yellow box ul",
1018 ],
1019 &["--color-only", "--file-style", "red bold ul"],
1020 &[
1021 "--color-only",
1022 "--file-decoration-style",
1023 "bold yellow box ul",
1024 ],
1025 &["--color-only", "--hunk-header-style", "red bold ul"],
1026 &[
1027 "--color-only",
1028 "--hunk-header-decoration-style",
1029 "bold yellow box ul",
1030 ],
1031 &[
1032 "--color-only",
1033 "--line-numbers",
1034 "--line-numbers-minus-style",
1035 "#444444",
1036 ],
1037 &[
1038 "--color-only",
1039 "--line-numbers",
1040 "--line-numbers-zero-style",
1041 "#444444",
1042 ],
1043 &[
1044 "--color-only",
1045 "--line-numbers",
1046 "--line-numbers-plus-style",
1047 "#444444",
1048 ],
1049 &[
1050 "--color-only",
1051 "--line-numbers",
1052 "--line-numbers-left-format",
1053 "{nm:>4}┊",
1054 ],
1055 &[
1056 "--color-only",
1057 "--line-numbers",
1058 "--line-numbers-right-format",
1059 "{np:>4}│",
1060 ],
1061 &[
1062 "--color-only",
1063 "--line-numbers",
1064 "--line-numbers-left-style",
1065 "blue",
1066 ],
1067 &[
1068 "--color-only",
1069 "--line-numbers",
1070 "--line-numbers-right-style",
1071 "blue",
1072 ],
1073 &["--color-only", "--file-modified-label", "hogehoge"],
1074 &["--color-only", "--file-removed-label", "hogehoge"],
1075 &["--color-only", "--file-added-label", "hogehoge"],
1076 &["--color-only", "--file-renamed-label", "hogehoge"],
1077 &["--color-only", "--max-line-length", "1"],
1078 &["--color-only", "--width", "1"],
1079 &["--color-only", "--tabs", "10"],
1080 &["--color-only", "--true-color", "always"],
1081 &["--color-only", "--inspect-raw-lines", "false"],
1082 &["--color-only", "--whitespace-error-style", "22 reverse"],
1083 ];
1084
1085 for config in user_suppliable_configs {
1086 _do_test_output_is_in_one_to_one_correspondence_with_inputrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_output_is_in_one_to_one_correspondence_with_input().(config);
1087 }
1088 }
1089
1090 fn _do_test_output_is_in_one_to_one_correspondence_with_inputrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_output_is_in_one_to_one_correspondence_with_input().(args: &[&str]) {
1091 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1092 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1093 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1094
1095 let input_lines: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<&str> = GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK..linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
1096 let output_lines: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<&str> = output.linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().().collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
1097 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(input_lines.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().(), output_lines.lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().());
1098
1099 // Although git patch options only checks the line counts of input and output,
1100 // we should check if they are identical as well to avoid unexpected decoration.
1101 if args.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]contains().(&"--max-line-length") {
1102 return;
1103 }
1104 for (n, input_line) in input_lines.into_iterrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][IntoIterator]into_iter().().enumeraterust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#enumerate().() {
1105 // If config.line_numbers is enabled,
1106 // we should remove line_numbers decoration while checking.
1107 let output_line = if config.line_numbersrust-analyzer cargo git-delta 0.19.2 config/Config#line_numbers. && n rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().11 {
1108 &output_lines[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().n]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().14..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFrom#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().
1109 } else {
1110 output_lines[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().n]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().
1111 };
1112 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(input_line, output_line);
1113 }
1114 }
1115
1116 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1117 fn test_file_style_with_color_only_has_stylerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_style_with_color_only_has_style().() {
1118 let config =
1119 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--color-only", "--file-style", "red"]);
1120 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1121
1122 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, "--- a/src/align.rs", "red", &config);
1123 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 9, "+++ b/src/align.rs", "red", &config);
1124 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1125 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1126 "\
1127 --- a/src/align.rs
1128 +++ b/src/align.rs
1129 "
1130 ));
1131 }
1132
1133 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1134 fn test_hunk_header_style_with_color_only_has_stylerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_with_color_only_has_style().() {
1135 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1136 "--color-only",
1137 "--hunk-header-style",
1138 "red",
1139 ]);
1140 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1141
1142 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1143 &output,
1144 10,
1145 "@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {",
1146 "red",
1147 &config,
1148 );
1149 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1150 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {"));
1151 }
1152
1153 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1154 fn test_hunk_header_style_with_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_with_file().() {
1155 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1156 "--hunk-header-file-style",
1157 "yellow",
1158 "--hunk-header-style",
1159 "file line-number red",
1160 "--hunk-header-decoration-style",
1161 "box",
1162 ]);
1163 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1164
1165 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1166 &output,
1167 11,
1168 "src/align.rs:71: impl<'a> Alignment<'a> {",
1169 "yellow",
1170 &config,
1171 );
1172 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1173 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1174 "
1175 ──────────────────────────────────────────┐
1176 src/align.rs:71: impl<'a> Alignment<'a> { │
1177 ──────────────────────────────────────────┘
1178 "
1179 ));
1180 }
1181
1182 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1183 fn test_hunk_header_style_with_file_no_fragrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_with_file_no_frag().() {
1184 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1185 "--hunk-header-file-style",
1186 "yellow",
1187 "--hunk-header-style",
1188 "file line-number red",
1189 "--hunk-header-decoration-style",
1190 "box",
1191 ]);
1192 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNK_NO_FRAGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_NO_FRAG., &config);
1193
1194 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 5, "src/delta.rs:1: ", "yellow", &config);
1195 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1196 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1197 "
1198 ────────────────┐
1199 src/delta.rs:1: │
1200 ────────────────┘
1201 "
1202 ));
1203 }
1204
1205 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1206 fn test_commit_style_with_color_only_has_stylerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_commit_style_with_color_only_has_style().() {
1207 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1208 "--color-only",
1209 "--commit-style",
1210 "red",
1211 ]);
1212 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1213
1214 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1215 &output,
1216 0,
1217 "commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e",
1218 "red",
1219 &config,
1220 );
1221 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1222 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e"));
1223 }
1224
1225 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1226 fn test_hunk_header_omit_code_fragmentrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_omit_code_fragment().() {
1227 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1228 "--hunk-header-style",
1229 "line-number omit-code-fragment",
1230 "--hunk-header-decoration-style",
1231 "none",
1232 ]);
1233 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
1234 GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK.,
1235 &config,
1236 ));
1237 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("\n71: \n"));
1238 }
1239
1240 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1241 fn test_hunk_header_style_colored_input_color_is_stripped_under_normalrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_colored_input_color_is_stripped_under_normal().() {
1242 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1243 "--hunk-header-style",
1244 "line-number normal",
1245 "--hunk-header-line-number-style",
1246 "normal",
1247 "--hunk-header-decoration-style",
1248 "omit",
1249 ]);
1250 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
1251 GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.,
1252 &config,
1253 );
1254 // An additional newline is inserted under anything other than `style=raw,
1255 // decoration-style=omit`, to better separate the hunks. Hence 9 + 1.
1256 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(&output, 9 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1, "71: impl<'a> Alignment<'a> {");
1257 }
1258
1259 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1260 fn test_hunk_header_style_colored_input_color_is_preserved_under_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_colored_input_color_is_preserved_under_raw().() {
1261 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1262 "--hunk-header-style",
1263 "raw",
1264 "--hunk-header-decoration-style",
1265 "omit",
1266 ]);
1267 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
1268 GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.,
1269 &config,
1270 );
1271 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_4_bit_color_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_4_bit_color_style().(
1272 &output,
1273 9,
1274 "@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {",
1275 "bold 31",
1276 &config,
1277 );
1278 }
1279
1280 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1281 fn test_hunk_header_decoration_style_omitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_decoration_style_omit().() {
1282 _do_test_hunk_header_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_no_decoration().(&["--hunk-header-decoration-style", "omit"]);
1283 }
1284
1285 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1286 fn test_hunk_header_decoration_style_nonerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_decoration_style_none().() {
1287 _do_test_hunk_header_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_no_decoration().(&["--hunk-header-decoration-style", "none"]);
1288 }
1289
1290 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1291 fn test_hunk_header_decoration_style_empty_stringrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_decoration_style_empty_string().() {
1292 _do_test_hunk_header_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_no_decoration().(&["--hunk-header-decoration-style", ""]);
1293 }
1294
1295 fn _do_test_hunk_header_style_no_decorationrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_no_decoration().(args: &[&str]) {
1296 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1297 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1298 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1299 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("impl<'a> Alignment<'a> {"));
1300 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("impl<'a> Alignment<'a> { │"));
1301 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1302 "
1303 impl<'a> Alignment<'a> {
1304 ────────────────────────"
1305 ));
1306 }
1307
1308 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1309 fn test_hunk_header_style_omitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_omit().() {
1310 let config =
1311 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--hunk-header-style", "omit"]);
1312 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1313 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1314 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("impl<'a> Alignment<'a> {"));
1315 }
1316
1317 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1318 fn test_hunk_header_style_empty_stringrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_empty_string().() {
1319 _do_test_hunk_header_empty_stylerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_empty_style().(&["--hunk-header-style", ""]);
1320 }
1321
1322 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1323 fn test_hunk_header_style_nonerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_none().() {
1324 _do_test_hunk_header_empty_stylerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_empty_style().(&["--hunk-header-style", "None"]);
1325 }
1326
1327 fn _do_test_hunk_header_empty_stylerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_empty_style().(args: &[&str]) {
1328 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1329 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1330 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("impl<'a> Alignment<'a> {"));
1331 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(!rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("@@"));
1332 }
1333
1334 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1335 fn test_hunk_header_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_box().() {
1336 _do_test_hunk_header_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box().(&["--hunk-header-decoration-style", "white box"]);
1337 }
1338
1339 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1340 fn test_hunk_header_style_box_line_numberrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_box_line_number().() {
1341 _do_test_hunk_header_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box().(&[
1342 "--hunk-header-style",
1343 "line-number",
1344 "--hunk-header-decoration-style",
1345 "white box",
1346 ]);
1347 }
1348
1349 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1350 fn test_hunk_header_style_box_file_line_numberrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_box_file_line_number().() {
1351 _do_test_hunk_header_style_box_file_line_numberrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box_file_line_number().(&[
1352 "--hunk-header-style",
1353 "file line-number",
1354 "--hunk-header-decoration-style",
1355 "white box",
1356 ]);
1357 }
1358
1359 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1360 fn test_hunk_header_style_box_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_box_file().() {
1361 _do_test_hunk_header_style_box_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box_file().(&[
1362 "--hunk-header-style",
1363 "file",
1364 "--hunk-header-decoration-style",
1365 "white box",
1366 ]);
1367 }
1368
1369 fn _do_test_hunk_header_style_boxrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box().(args: &[&str]) {
1370 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1371 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1372 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1373 &output,
1374 10,
1375 "─────────────────────────────┐",
1376 "white",
1377 &config,
1378 );
1379 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1380 &output,
1381 12,
1382 "─────────────────────────────┘",
1383 "white",
1384 &config,
1385 );
1386 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1387 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1388 "
1389 ─────────────────────────────┐
1390 71: impl<'a> Alignment<'a> { │
1391 ─────────────────────────────┘
1392 "
1393 ));
1394 }
1395
1396 fn _do_test_hunk_header_style_box_filerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box_file().(args: &[&str]) {
1397 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1398 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1399 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1400 &output,
1401 10,
1402 "───────────────────────────────────────┐",
1403 "white",
1404 &config,
1405 );
1406 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1407 &output,
1408 12,
1409 "───────────────────────────────────────┘",
1410 "white",
1411 &config,
1412 );
1413 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1414 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1415 "
1416 ───────────────────────────────────────┐
1417 src/align.rs: impl<'a> Alignment<'a> { │
1418 ───────────────────────────────────────┘
1419 "
1420 ));
1421 }
1422
1423 fn _do_test_hunk_header_style_box_file_line_numberrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_box_file_line_number().(args: &[&str]) {
1424 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1425 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1426 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1427 &output,
1428 10,
1429 "──────────────────────────────────────────┐",
1430 "white",
1431 &config,
1432 );
1433 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1434 &output,
1435 12,
1436 "──────────────────────────────────────────┘",
1437 "white",
1438 &config,
1439 );
1440 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1441 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1442 "
1443 ──────────────────────────────────────────┐
1444 src/align.rs:71: impl<'a> Alignment<'a> { │
1445 ──────────────────────────────────────────┘
1446 "
1447 ));
1448 }
1449
1450 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1451 fn test_hunk_header_style_box_rawrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_box_raw().() {
1452 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1453 "--hunk-header-style",
1454 "raw",
1455 "--hunk-header-decoration-style",
1456 "box",
1457 ]);
1458 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1459 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(
1460 &output,
1461 11,
1462 "@@ -71,11 +71,8 @@ impl<'a> Alignment<'a> { │",
1463 );
1464 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1465 "
1466 ────────────────────────────────────────────┐
1467 @@ -71,11 +71,8 @@ impl<'a> Alignment<'a> { │
1468 ────────────────────────────────────────────┘
1469 "
1470 ));
1471 }
1472
1473 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1474 fn test_hunk_header_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_underline().() {
1475 _do_test_hunk_header_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_underline().(&[
1476 "--hunk-header-decoration-style",
1477 "black underline",
1478 ]);
1479 }
1480
1481 fn _do_test_hunk_header_style_underlinerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_hunk_header_style_underline().(args: &[&str]) {
1482 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(args);
1483 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1484 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(
1485 &output,
1486 11,
1487 "─────────────────────────",
1488 "black",
1489 &config,
1490 );
1491 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1492 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1493 "
1494 71: impl<'a> Alignment<'a> {
1495 ────────────────────────────"
1496 ));
1497 }
1498
1499 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1500 fn test_hunk_header_style_box_with_syntax_highlightingrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hunk_header_style_box_with_syntax_highlighting().() {
1501 // For this test we are currently forced to disable styling of the decoration, since
1502 // otherwise it will confuse assert_line_is_syntax_highlighted.
1503 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1504 "--hunk-header-style",
1505 "line-number syntax",
1506 "--hunk-header-decoration-style",
1507 "box",
1508 ]);
1509 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1510 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(&output, 10, "─────────────────────────────┐");
1511 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_syntax_highlighted_substringrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_syntax_highlighted_substring().(
1512 &output,
1513 11,
1514 4,
1515 "impl<'a> Alignment<'a> { ",
1516 "a.rs",
1517 Staterust-analyzer cargo git-delta 0.19.2 delta/State#::HunkHeaderrust-analyzer cargo git-delta 0.19.2 delta/State#HunkHeader#(
1518 DiffTyperust-analyzer cargo git-delta 0.19.2 delta/DiffType#::Unifiedrust-analyzer cargo git-delta 0.19.2 delta/DiffType#Unified#,
1519 ParsedHunkHeaderrust-analyzer cargo git-delta 0.19.2 handlers/hunk_header/ParsedHunkHeader#::defaultrust-analyzer cargo git-delta 0.19.2 handlers/hunk_header/impl#[ParsedHunkHeader][Default]default().(),
1520 "".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
1521 "".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
1522 ),
1523 &config,
1524 );
1525 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_no_colorrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_no_color().(&output, 12, "─────────────────────────────┘");
1526 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1527 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1528 "
1529 ─────────────────────────────┐
1530 71: impl<'a> Alignment<'a> { │
1531 ─────────────────────────────┘
1532 "
1533 ));
1534 }
1535
1536 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1537 fn test_removed_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_removed_empty_line_highlight().() {
1538 let minus_empty_line_marker_style = "bold yellow magenta ul";
1539 _do_test_removed_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_removed_empty_line_highlight().(minus_empty_line_marker_style, "red reverse", true);
1540 _do_test_removed_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_removed_empty_line_highlight().(minus_empty_line_marker_style, "normal red", true);
1541 _do_test_removed_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_removed_empty_line_highlight().(minus_empty_line_marker_style, "red", false);
1542 _do_test_removed_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_removed_empty_line_highlight().(
1543 minus_empty_line_marker_style,
1544 "normal red reverse",
1545 false,
1546 );
1547 }
1548
1549 fn _do_test_removed_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_removed_empty_line_highlight().(
1550 empty_line_marker_style: &str,
1551 base_style: &str,
1552 base_style_has_background_color: bool,
1553 ) {
1554 _do_test_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_empty_line_highlight().(
1555 "--minus-empty-line-marker-style",
1556 empty_line_marker_style,
1557 "--minus-style",
1558 base_style,
1559 base_style_has_background_color,
1560 DIFF_WITH_REMOVED_EMPTY_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_REMOVED_EMPTY_LINE.,
1561 );
1562 }
1563
1564 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1565 fn test_added_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_added_empty_line_highlight().() {
1566 let plus_empty_line_marker_style = "bold yellow red ul";
1567 _do_test_added_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_added_empty_line_highlight().(plus_empty_line_marker_style, "green reverse", true);
1568 _do_test_added_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_added_empty_line_highlight().(plus_empty_line_marker_style, "normal green", true);
1569 _do_test_added_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_added_empty_line_highlight().(plus_empty_line_marker_style, "green", false);
1570 _do_test_added_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_added_empty_line_highlight().(
1571 plus_empty_line_marker_style,
1572 "normal green reverse",
1573 false,
1574 );
1575 }
1576
1577 fn _do_test_added_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_added_empty_line_highlight().(
1578 empty_line_marker_style: &str,
1579 base_style: &str,
1580 base_style_has_background_color: bool,
1581 ) {
1582 _do_test_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_empty_line_highlight().(
1583 "--plus-empty-line-marker-style",
1584 empty_line_marker_style,
1585 "--plus-style",
1586 base_style,
1587 base_style_has_background_color,
1588 DIFF_WITH_ADDED_EMPTY_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_ADDED_EMPTY_LINE.,
1589 );
1590 }
1591
1592 fn _do_test_empty_line_highlightrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/_do_test_empty_line_highlight().(
1593 empty_line_marker_style_name: &str,
1594 empty_line_marker_style: &str,
1595 base_style_name: &str,
1596 base_style: &str,
1597 base_style_has_background_color: bool,
1598 example_diff: &str,
1599 ) {
1600 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1601 base_style_name,
1602 base_style,
1603 empty_line_marker_style_name,
1604 empty_line_marker_style,
1605 ]);
1606 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(example_diff, &config);
1607 let line = output.linesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]lines().().nthrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#nth().(8).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap().();
1608 if base_style_has_background_color {
1609 let style = stylerust-analyzer cargo git-delta 0.19.2 style/::Stylerust-analyzer cargo git-delta 0.19.2 style/Style#::from_strrust-analyzer cargo git-delta 0.19.2 parse_style/impl#[Style]from_str().(base_style, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, true, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#);
1610 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(
1611 line,
1612 &style
1613 .ansi_term_stylerust-analyzer cargo git-delta 0.19.2 style/Style#ansi_term_style.
1614 .paintrust-analyzer cargo nu-ansi-term 0.50.3 display/impl#[Style]paint().(ansirust-analyzer cargo git-delta 0.19.2 ansi/::ANSI_CSI_CLEAR_TO_EOLrust-analyzer cargo git-delta 0.19.2 ansi/ANSI_CSI_CLEAR_TO_EOL.)
1615 .to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()
1616 );
1617 } else {
1618 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(line, "");
1619 }
1620 }
1621
1622 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1623 fn test_whitespace_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_whitespace_error().() {
1624 let whitespace_error_style = "bold yellow red ul";
1625 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1626 "--whitespace-error-style",
1627 whitespace_error_style,
1628 ]);
1629 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_WHITESPACE_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_ERROR., &config);
1630 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, " ", whitespace_error_style, &config);
1631 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_REMOVED_WHITESPACE_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_REMOVED_WHITESPACE_ERROR., &config);
1632 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_have_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_have_style().(
1633 &output,
1634 8,
1635 " ",
1636 whitespace_error_style,
1637 &config,
1638 );
1639 }
1640
1641 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1642 fn test_whitespace_unrelated_edit_text_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_whitespace_unrelated_edit_text_error().() {
1643 let whitespace_error_style = "bold yellow red ul";
1644 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1645 "--whitespace-error-style",
1646 whitespace_error_style,
1647 ]);
1648 let output =
1649 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_WHITESPACE_UNRELATED_EDIT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_UNRELATED_EDIT_ERROR., &config);
1650 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1651 &output,
1652 9,
1653 "some new",
1654 " ",
1655 whitespace_error_style,
1656 &config,
1657 );
1658 }
1659
1660 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1661 fn test_whitespace_edit_text_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_whitespace_edit_text_error().() {
1662 let whitespace_error_style = "bold yellow red ul";
1663 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1664 "--whitespace-error-style",
1665 whitespace_error_style,
1666 ]);
1667 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_WHITESPACE_EDIT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_EDIT_ERROR., &config);
1668 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1669 &output,
1670 9,
1671 "same ",
1672 " ",
1673 whitespace_error_style,
1674 &config,
1675 );
1676 }
1677
1678 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1679 fn test_whitespace_added_empty_line_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_whitespace_added_empty_line_error().() {
1680 let whitespace_error_style = "bold yellow red ul";
1681 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1682 "--whitespace-error-style",
1683 whitespace_error_style,
1684 ]);
1685 let output =
1686 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_ADDED_WHITESPACE_EMPTY_LINE_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_ADDED_WHITESPACE_EMPTY_LINE_ERROR., &config);
1687 // TODO is this the first style ?
1688 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 9, " ", whitespace_error_style, &config);
1689 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1690 &output,
1691 9,
1692 "",
1693 " ",
1694 whitespace_error_style,
1695 &config,
1696 );
1697 }
1698
1699 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1700 fn test_whitespace_after_text_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_whitespace_after_text_error().() {
1701 let whitespace_error_style = "bold yellow red ul";
1702 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1703 "--whitespace-error-style",
1704 whitespace_error_style,
1705 ]);
1706 let output =
1707 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_WHITESPACE_AFTER_TEXT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_AFTER_TEXT_ERROR., &config);
1708 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1709 &output,
1710 8,
1711 "foo bar",
1712 " ",
1713 whitespace_error_style,
1714 &config,
1715 );
1716 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
1717 DIFF_WITH_REMOVED_WHITESPACE_AFTER_TEXT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_REMOVED_WHITESPACE_AFTER_TEXT_ERROR.,
1718 &config,
1719 );
1720 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_contain_substring_style().(
1721 &output,
1722 8,
1723 "foo bar",
1724 whitespace_error_style,
1725 &config,
1726 );
1727 }
1728
1729 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1730 fn test_whitespace_complex_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_whitespace_complex_error().() {
1731 let whitespace_error_style = "bold yellow red ul";
1732 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1733 "--whitespace-error-style",
1734 whitespace_error_style,
1735 ]);
1736 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_WHITESPACE_COMPLEX_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_COMPLEX_ERROR., &config);
1737 // `minus` line should not display whitespace error
1738 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_have_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_have_style().(
1739 &output,
1740 8,
1741 " ",
1742 whitespace_error_style,
1743 &config,
1744 );
1745 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_have_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_have_style().(
1746 &output,
1747 9,
1748 " ",
1749 whitespace_error_style,
1750 &config,
1751 );
1752 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_contain_substring_style().(
1753 &output,
1754 10,
1755 " foo0 ",
1756 whitespace_error_style,
1757 &config,
1758 );
1759 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_contain_substring_style().(
1760 &output,
1761 11,
1762 " foo1 ",
1763 whitespace_error_style,
1764 &config,
1765 );
1766 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_does_not_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_does_not_contain_substring_style().(
1767 &output,
1768 12,
1769 " bar ",
1770 whitespace_error_style,
1771 &config,
1772 );
1773
1774 // `plus` line should display whitespace error
1775 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1776 &output,
1777 13,
1778 " ",
1779 " ",
1780 whitespace_error_style,
1781 &config,
1782 );
1783 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1784 &output,
1785 14,
1786 " ",
1787 " ",
1788 whitespace_error_style,
1789 &config,
1790 );
1791 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1792 &output,
1793 15,
1794 " foo0",
1795 " ",
1796 whitespace_error_style,
1797 &config,
1798 );
1799 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1800 &output,
1801 16,
1802 " foo1",
1803 " ",
1804 whitespace_error_style,
1805 &config,
1806 );
1807 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_contain_substring_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_contain_substring_style().(
1808 &output,
1809 17,
1810 " bAr",
1811 " ",
1812 whitespace_error_style,
1813 &config,
1814 );
1815 }
1816
1817 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1818 fn test_added_empty_line_is_not_whitespace_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_added_empty_line_is_not_whitespace_error().() {
1819 let plus_style = "bold yellow red ul";
1820 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1821 "--light",
1822 "--keep-plus-minus-markers",
1823 "--plus-style",
1824 plus_style,
1825 ]);
1826 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_ADDED_EMPTY_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_ADDED_EMPTY_LINE., &config);
1827 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 8, "", plus_style, &config)
1828 }
1829
1830 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1831 fn test_single_character_line_is_not_whitespace_errorrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_single_character_line_is_not_whitespace_error().() {
1832 let plus_style = "bold yellow red ul";
1833 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&[
1834 "--light",
1835 "--keep-plus-minus-markers",
1836 "--plus-style",
1837 plus_style,
1838 ]);
1839 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(DIFF_WITH_SINGLE_CHARACTER_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_SINGLE_CHARACTER_LINE., &config);
1840 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_stylerust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_style().(&output, 14, "+}", plus_style, &config)
1841 }
1842
1843 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1844 fn test_color_only_moderust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_color_only_mode().() {
1845 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--color-only"]);
1846 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK., &config);
1847 ansi_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/::assert_line_has_syntax_highlighted_substringrust-analyzer cargo git-delta 0.19.2 tests/ansi_test_utils/ansi_test_utils/assert_line_has_syntax_highlighted_substring().(
1848 &output,
1849 12,
1850 1,
1851 " for (i, x_i) in self.x.iter().enumerate() {",
1852 "align.rs",
1853 Staterust-analyzer cargo git-delta 0.19.2 delta/State#::HunkZerorust-analyzer cargo git-delta 0.19.2 delta/State#HunkZero#(DiffTyperust-analyzer cargo git-delta 0.19.2 delta/DiffType#::Unifiedrust-analyzer cargo git-delta 0.19.2 delta/DiffType#Unified#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#),
1854 &config,
1855 );
1856 }
1857
1858 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1859 fn test_git_diff_is_unchanged_under_color_onlyrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_git_diff_is_unchanged_under_color_only().() {
1860 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--color-only"]);
1861 let input = DIFF_WITH_TWO_ADDED_LINESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_TWO_ADDED_LINES.;
1862 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(input, &config);
1863 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1864 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(output, input);
1865 }
1866
1867 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1868 #[allow(non_snake_case)]
1869 fn test_git_diff_U0_is_unchanged_under_color_onlyrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_git_diff_U0_is_unchanged_under_color_only().() {
1870 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--color-only"]);
1871 let input = DIFF_WITH_TWO_ADDED_LINES_CREATED_BY_GIT_DIFF_U0rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_TWO_ADDED_LINES_CREATED_BY_GIT_DIFF_U0.;
1872 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(input, &config);
1873 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1874 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(output, input);
1875 }
1876
1877 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1878 fn test_git_diff_binary_is_unchanged_under_color_onlyrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_git_diff_binary_is_unchanged_under_color_only().() {
1879 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--color-only"]);
1880 let input = BINARY_FILES_DIFFER_BETWEEN_OTHERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILES_DIFFER_BETWEEN_OTHER.;
1881 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(input, &config);
1882 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1883 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(output, input);
1884 }
1885
1886 // See https://github.com/dandavison/delta/issues/371#issuecomment-720173435
1887 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1888 fn test_keep_plus_minus_markers_under_inspect_raw_linesrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_keep_plus_minus_markers_under_inspect_raw_lines().() {
1889 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--keep-plus-minus-markers"]);
1890 assert_eqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/assert_eq!!(config.inspect_raw_linesrust-analyzer cargo git-delta 0.19.2 config/Config#inspect_raw_lines., InspectRawLinesrust-analyzer cargo git-delta 0.19.2 cli/InspectRawLines#::Truerust-analyzer cargo git-delta 0.19.2 cli/InspectRawLines#True#);
1891 let output = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(
1892 GIT_DIFF_UNDER_COLOR_MOVED_DIMMED_ZEBRA_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_UNDER_COLOR_MOVED_DIMMED_ZEBRA_WITH_ANSI_ESCAPE_SEQUENCES.,
1893 &config,
1894 );
1895 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1896 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().(
1897 r#"
1898 - "stddev": 0.004157057519168492,
1899 "#
1900 ));
1901 }
1902
1903 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1904 fn test_file_mode_change_with_renamerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_mode_change_with_rename().() {
1905 let config = integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::make_config_from_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/make_config_from_args().(&["--right-arrow=->"]);
1906 let output =
1907 integration_test_utilsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/::run_deltarust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/run_delta().(GIT_DIFF_FILE_MODE_CHANGE_WITH_RENAMErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_WITH_RENAME., &config);
1908 let output = strip_ansi_codesrust-analyzer cargo git-delta 0.19.2 ansi/strip_ansi_codes().(&output);
1909 assertrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/assert!!(output.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().("renamed: old-longer-name -> shorter-name (mode +x)"));
1910 }
1911
1912 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1913 fn test_file_mode_change_gain_executable_bitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_mode_change_gain_executable_bit().() {
1914 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
1915 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_FILE_MODE_CHANGE_GAIN_EXECUTABLE_BITrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_GAIN_EXECUTABLE_BIT.)
1916 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("src/delta.rs (mode +x)");
1917 }
1918
1919 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1920 fn test_file_mode_change_lose_executable_bitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_mode_change_lose_executable_bit().() {
1921 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
1922 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_FILE_MODE_CHANGE_LOSE_EXECUTABLE_BITrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_LOSE_EXECUTABLE_BIT.)
1923 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("src/delta.rs (mode -x)");
1924 }
1925
1926 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1927 fn test_file_mode_change_unexpected_bitsrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_mode_change_unexpected_bits().() {
1928 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--navigate", "--right-arrow=->"])
1929 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_FILE_MODE_CHANGE_UNEXPECTED_BITSrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_UNEXPECTED_BITS.)
1930 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("Δ src/delta.rs (mode 100700 -> 100644)");
1931 }
1932
1933 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1934 fn test_file_deleted_without_preimagerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_deleted_without_preimage().() {
1935 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
1936 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_FILE_DELETED_WITHOUT_PREIMAGErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_DELETED_WITHOUT_PREIMAGE.)
1937 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("removed: foo.bar");
1938 }
1939
1940 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1941 fn test_files_deleted_without_preimagerust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_files_deleted_without_preimage().() {
1942 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
1943 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_FILES_DELETED_WITHOUT_PREIMAGErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILES_DELETED_WITHOUT_PREIMAGE.)
1944 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("removed: foo")
1945 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("removed: bar");
1946 }
1947
1948 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1949 fn test_file_mode_change_with_diffrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_mode_change_with_diff().() {
1950 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--navigate", "--keep-plus-minus-markers"])
1951 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_FILE_MODE_CHANGE_WITH_DIFFrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_WITH_DIFF.)
1952 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("Δ src/script (mode +x)")
1953 .expect_after_skiprust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_after_skip().(
1954 5,
1955 "
1956 ─────┐
1957 • 1: │
1958 ─────┘
1959 -#!/bin/sh
1960 +#!/bin/bash",
1961 );
1962 }
1963
1964 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1965 fn test_hyperlinks_commit_link_formatrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_hyperlinks_commit_link_format().() {
1966 // If commit-style is not set then the commit line is handled in raw
1967 // mode, in which case we only format hyperlinks if output is a tty;
1968 // this causes the test to fail on GitHub Actions, but pass locally
1969 // if output is left going to the screen.
1970 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[
1971 "--commit-style",
1972 "blue",
1973 "--hyperlinks",
1974 "--hyperlinks-commit-link-format",
1975 "https://invent.kde.org/utilities/konsole/-/commit/{commit}",
1976 ])
1977 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK.)
1978 .expect_raw_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_raw_contains().(
1979 r"https://invent.kde.org/utilities/konsole/-/commit/94907c0f136f46dc46ffae2dc92dca9af7eb7c2e"
1980 );
1981 }
1982
1983 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1984 fn test_filenames_with_spacesrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_filenames_with_spaces().() {
1985 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
1986 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_NO_INDEX_FILENAMES_WITH_SPACESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_NO_INDEX_FILENAMES_WITH_SPACES.)
1987 .expect_containsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_contains().("a b ⟶ c d\n");
1988 }
1989
1990 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1991 fn test_file_removal_in_log_outputrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_file_removal_in_log_output().() {
1992 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[])
1993 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_LOG_FILE_REMOVAL_IN_FIRST_COMMITrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_LOG_FILE_REMOVAL_IN_FIRST_COMMIT.)
1994 .expect_after_headerrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[DeltaTestOutput]expect_after_header().("#partial\n\nremoved: a");
1995 }
1996
1997 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
1998 fn test_lines_with_syntax_width_limitrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_lines_with_syntax_width_limit().() {
1999 let result = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[
2000 "--max-line-length=42",
2001 "--max-syntax-highlighting-length=18",
2002 ])
2003 .explain_ansirust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]explain_ansi().()
2004 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK.);
2005 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(result.outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output., @r###"
2006 (normal)commit 94907c0f136f46dc46ffae2dc92dca9af7(reverse normal)→(normal)
2007 Author: Dan Davison <[email protected](reverse normal)→(normal)
2008 Date: Thu May 14 11:13:17 2020 -0400
2009
2010 rustfmt
2011
2012
2013 (blue)src/align.rs(normal)
2014 (blue)───────────────────────────────────────────(normal)
2015
2016 (blue)─────────────────────────────(blue)┐(normal)
2017 (blue)71(normal):(231) (81)impl(231)<(203)'a(231)> (149)Alignmen(normal)t<'a> { (blue)│(normal)
2018 (blue)─────────────────────────────(blue)┘(normal)
2019
2020 (231) (203)for(231) (i, x_(normal)i) in self.x.iter().en→
2021 (231) (203)for(231) (j(normal), y_j) in self.y.iter(→
2022 (normal 52) let (left, diag, up) =(normal 124) ((normal)
2023 (normal 52) self.index(i, j + 1(normal 124)),(normal)
2024 (normal 52) self.index(i, j),(normal)
2025 (normal 52) self.index(i + 1, j),(normal)
2026 (normal 52) );(normal)
2027 (231 22) le(normal 22)t (left, diag, up) =(normal)
2028 (231 22) (normal 22) (normal 28)((normal 22)self.index(i, j + 1(normal 28)→(normal)
2029 (231) le(normal)t candidates = [
2030 (231) (normal) Cell {
2031 (231) (normal) parent: left,
2032 "###);
2033 }
2034
2035 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
2036 fn test_lines_with_syntax_width_limit_wrappingrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_lines_with_syntax_width_limit_wrapping().() {
2037 let result = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[
2038 "--side-by-side",
2039 "--width=55",
2040 "--wrap-max-lines=1",
2041 "--max-line-length=10", // this gets ignored!
2042 "--max-syntax-highlighting-length=22",
2043 ])
2044 .explain_ansirust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]explain_ansi().()
2045 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK.);
2046
2047 // eprintln!("{}", result.raw_output);
2048 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(result.outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output., @r###"
2049 (normal)commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
2050 Author: Dan Davison <[email protected]>
2051 Date: Thu May 14 11:13:17 2020 -0400
2052
2053 rustfmt
2054
2055
2056 (blue)src/align.rs(normal)
2057 (blue)───────────────────────────────────────────────────────(normal)
2058
2059 (blue)─────────────────────────────(blue)┐(normal)
2060 (blue)71(normal):(231) (81)impl(231)<(203)'a(231)> (149)Alignment(231)<(203)'a(normal)> { (blue)│(normal)
2061 (blue)─────────────────────────────(blue)┘(normal)
2062
2063 (blue)│(238) 71 (blue)│(231) (203)for(231) (i, x_i)(blue)↵(blue) │(238) 71 (blue)│(231) (203)for(231) (i, x_i)(blue)↵(normal)
2064 (blue)│(238) (blue)│(231) i(normal)n self.x.iter().en(reverse normal)→(blue) │(238) (blue)│(231) i(normal)n self.x.iter().en(reverse normal)→(normal)
2065 (blue)│(238) 72 (blue)│(231) (203)for(231) (j, (blue)↵(blue) │(238) 72 (blue)│(231) (203)for(231) (j, (blue)↵(normal)
2066 (blue)│(238) (blue)│(231)y_(normal)j) in self.y.iter((reverse normal)→(blue) │(238) (blue)│(231)y_(normal)j) in self.y.iter((reverse normal)→(normal)
2067 (blue)│(88) 73 (blue)│(231 52) (81)let(231) (blue)↵(blue) │(28) 73 (blue)│(231 22) (81)let(231) (blue)↵(normal)
2068 (blue)│(88) (blue)│(231 52)(l(normal 52)eft, diag, up) =(normal 124) ((normal 52) (blue) │(28) (blue)│(231 22)(l(normal 22)eft, diag, up) =(normal)
2069 (blue)│(88) 74 (blue)│(231 52) (blue)↵(blue) │(28) 74 (blue)│(231 22) (blue)↵(normal)
2070 (blue)│(88) (blue)│(231 52)se(normal 52)lf.index(i, j + 1),(blue) │(28) (blue)│(231 28)((normal 22)s(normal 22)elf.index(i, j + 1(reverse normal)→(normal)
2071 (blue)│(88) 75 (blue)│(231 52) (blue)↵(blue) │(28) (blue)│(normal)
2072 (blue)│(88) (blue)│(231 52)se(normal 52)lf.index(i, j),(normal 52) (blue) │(28) (blue)│(normal)
2073 (blue)│(88) 76 (blue)│(231 52) (blue)↵(blue) │(28) (blue)│(normal)
2074 (blue)│(88) (blue)│(231 52)se(normal 52)lf.index(i + 1, j),(blue) │(28) (blue)│(normal)
2075 (blue)│(88) 77 (blue)│(231 52) );(normal 52) (blue) │(28) (blue)│(normal)
2076 (blue)│(238) 78 (blue)│(231) (81)let(231) (blue)↵(blue) │(238) 75 (blue)│(231) (81)let(231) (blue)↵(normal)
2077 (blue)│(238) (blue)│(231)ca(normal)ndidates = [ (blue) │(238) (blue)│(231)ca(normal)ndidates = [
2078 (blue)│(238) 79 (blue)│(231) (blue)↵(blue) │(238) 76 (blue)│(231) (blue)↵(normal)
2079 (blue)│(238) (blue)│(231)Ce(normal)ll { (blue) │(238) (blue)│(231)Ce(normal)ll {
2080 (blue)│(238) 80 (blue)│(231) (blue)↵(blue) │(238) 77 (blue)│(231) (blue)↵(normal)
2081 (blue)│(238) (blue)│(231) (normal) parent: left, (blue) │(238) (blue)│(231) (normal) parent: left,
2082 "###);
2083 }
2084
2085 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
2086 fn test_lines_with_syntax_width_unicoderust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_lines_with_syntax_width_unicode().() {
2087 let result = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--max-syntax-highlighting-length=11"])
2088 .explain_ansirust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]explain_ansi().()
2089 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_ALL_UNICODE_W_FULLWIDTHrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_ALL_UNICODE_W_FULLWIDTH.);
2090
2091 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(result.outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output., @r###"
2092 (normal)
2093
2094 (blue)src/a(normal)
2095 (blue)───────────────────────────────────────────(normal)
2096
2097 (blue)───(blue)┐(normal)
2098 (blue)1(normal): (blue)│(normal)
2099 (blue)───(blue)┘(normal)
2100 (231)一æäöø€ÆÄÖ(normal)〇Øß一
2101 (231)一æäöø€ÆÄÖ(normal)〇Øß一
2102 (normal 52)二æäöø(normal 124)¢(normal 52)ÆÄÖ〇Øß二(normal)
2103 (normal 52)二æäöø(normal 124)¢(normal 52)ÆÄÖ〇Øß二(normal)
2104 (231 22)二æäöø(normal 28)€(normal 22)ÆÄÖ(normal 22)〇Øß二(normal)
2105 (231 22)二æäöø(normal 28)€(normal 22)ÆÄÖ(normal 22)〇Øß二(normal)
2106 (231)三æäöø€ÆÄÖ(normal)〇Øß三
2107 (231)三æäöø€ÆÄÖ(normal)〇Øß三
2108 (231)¶(normal)
2109 "###);
2110
2111 let result = DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&[
2112 "--max-syntax-highlighting-length=10",
2113 "--max-line-length=16",
2114 ])
2115 .explain_ansirust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]explain_ansi().()
2116 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_ALL_UNICODE_W_FULLWIDTHrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_ALL_UNICODE_W_FULLWIDTH.);
2117
2118 // eprintln!("{}", result.raw_output);
2119 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(result.outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output., @r###"
2120 (normal)
2121
2122 (blue)src/a(normal)
2123 (blue)───────────────────────────────────────────(normal)
2124
2125 (blue)───(blue)┐(normal)
2126 (blue)1(normal): (blue)│(normal)
2127 (blue)───(blue)┘(normal)
2128 (231)一æäöø€ÆÄÖ(normal)〇Øß→
2129 (231)一æäöø€ÆÄÖ(normal)〇Øß→
2130 (normal 52)二æäöø(normal 124)¢(normal 52)ÆÄÖ〇Øß→(normal)
2131 (normal 52)二æäöø(normal 124)¢(normal 52)ÆÄÖ〇Øß→(normal)
2132 (231 22)二æäöø(normal 28)€(normal 22)ÆÄÖ(normal 22)〇Øß→(normal)
2133 (231 22)二æäöø(normal 28)€(normal 22)ÆÄÖ(normal 22)〇Øß→(normal)
2134 (231)三æäöø€ÆÄÖ(normal)〇Øß→
2135 (231)三æäöø€ÆÄÖ(normal)〇Øß→
2136 (231)¶(normal)
2137 "###);
2138 }
2139
2140 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
2141 fn test_color_only_diff_filter_zero_style_bgrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/test_color_only_diff_filter_zero_style_bg().() {
2142 let result =
2143 DeltaTestrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTest#::with_argsrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_args().(&["--color-only", r##"--zero-style='syntax "#1d1f21" dim'"##])
2144 .set_configrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]set_config().(|c| c.available_terminal_widthrust-analyzer cargo git-delta 0.19.2 config/Config#available_terminal_width. = 80)
2145 .explain_ansirust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]explain_ansi().()
2146 .with_inputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/impl#[`DeltaTest<'a>`]with_input().(GIT_DIFF_OF_WIDTH_81rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_OF_WIDTH_81.);
2147
2148 assert_snapshotrust-analyzer cargo insta 1.39.0 macros/assert_snapshot!!(result.outputrust-analyzer cargo git-delta 0.19.2 tests/integration_test_utils/DeltaTestOutput#output., @r###"
2149 (normal)
2150 --- a.rs
2151 +++ b.rs
2152 @@ -1,3 +1,3 @@
2153 (normal 22)+(231) (203)if(231) (81)let(231) (149)Ok(231)(foo) { (242)// Works fine with plus hunk lines which are longer 81(normal)
2154 (normal 52)-// and it works fine with minus lines, however 81(normal)
2155 (dim normal 234) (242)// styled(!) zero lines can only be as long as the width fallback of 80(normal)
2156 (dim normal 234) (231)panic!(); (242)/* if no tty can be queried, and delta crashes on longer lines: 81(normal)
2157 "###);
2158 }
2159
2160 const GIT_DIFF_OF_WIDTH_81rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_OF_WIDTH_81.: &str = r#"
2161 --- a.rs
2162 +++ b.rs
2163 @@ -1,3 +1,3 @@
2164 + if let Ok(foo) { // Works fine with plus hunk lines which are longer 81
2165 -// and it works fine with minus lines, however 81
2166 // styled(!) zero lines can only be as long as the width fallback of 80
2167 panic!(); /* if no tty can be queried, and delta crashes on longer lines: 81
2168 "#;
2169
2170 const GIT_DIFF_SINGLE_HUNKrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK.: &str = "\
2171 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
2172 Author: Dan Davison <[email protected]>
2173 Date: Thu May 14 11:13:17 2020 -0400
2174
2175 rustfmt
2176
2177 diff --git a/src/align.rs b/src/align.rs
2178 index 8e37a9e..6ce4863 100644
2179 --- a/src/align.rs
2180 +++ b/src/align.rs
2181 @@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {
2182
2183 for (i, x_i) in self.x.iter().enumerate() {
2184 for (j, y_j) in self.y.iter().enumerate() {
2185 - let (left, diag, up) = (
2186 - self.index(i, j + 1),
2187 - self.index(i, j),
2188 - self.index(i + 1, j),
2189 - );
2190 + let (left, diag, up) =
2191 + (self.index(i, j + 1), self.index(i, j), self.index(i + 1, j));
2192 let candidates = [
2193 Cell {
2194 parent: left,
2195 ";
2196
2197 const GIT_DIFF_SINGLE_HUNK_NO_FRAGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_NO_FRAG.: &str = "\
2198 diff --git a/src/delta.rs b/src/delta.rs
2199 index e401e269..e5304e01 100644
2200 --- a/src/delta.rs
2201 +++ b/src/delta.rs
2202 @@ -1,4 +1,3 @@
2203 -use std::borrow::Cow;
2204 use std::fmt::Write as FmtWrite;
2205 use std::io::BufRead;
2206 use std::io::Write;
2207 ";
2208
2209 const GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_ANSI_ESCAPE_SEQUENCES.: &str = "\
2210 commit 94907c0f136f46dc46ffae2dc92dca9af7eb7c2e
2211 Author: Dan Davison <[email protected]>
2212 Date: Thu May 14 11:13:17 2020 -0400
2213
2214 rustfmt
2215
2216 diff --git a/src/align.rs b/src/align.rs
2217 index 8e37a9e..6ce4863 100644
2218 --- a/src/align.rs
2219 +++ b/src/align.rs
2220 @@ -71,11 +71,8 @@ impl<'a> Alignment<'a> {
2221 
2222 for (i, x_i) in self.x.iter().enumerate() {
2223 for (j, y_j) in self.y.iter().enumerate() {
2224 - let (left, diag, up) = (
2225 - self.index(i, j + 1),
2226 - self.index(i, j),
2227 - self.index(i + 1, j),
2228 - );
2229 + let (left, diag, up) =
2230 + (self.index(i, j + 1), self.index(i, j), self.index(i + 1, j));
2231 let candidates = [
2232 Cell {
2233 parent: left,
2234 diff --git a/src/bat/mod.rs b/src/bat/mod.rs
2235 index 362ba77..7812e7c 100644
2236 --- a/src/bat/mod.rs
2237 +++ b/src/bat/mod.rs
2238 @@ -1,5 +1,5 @@
2239 pub mod assets;
2240 pub mod dirs;
2241 +mod less;
2242 pub mod output;
2243 pub mod terminal;
2244 -mod less;
2245 diff --git a/src/bat/output.rs b/src/bat/output.rs
2246 index d23f5e8..e4ed702 100644
2247 --- a/src/bat/output.rs
2248 +++ b/src/bat/output.rs
2249 @@ -8,8 +8,8 @@ use std::process::{Child, Command, Stdio};
2250 
2251 use shell_words;
2252 
2253 -use crate::env;
2254 use super::less::retrieve_less_version;
2255 +use crate::env;
2256 
2257 #[derive(Debug, Clone, Copy, PartialEq)]
2258 #[allow(dead_code)]
2259 ";
2260
2261 const GIT_DIFF_SINGLE_HUNK_WITH_SEQUENCE_OF_CR_ESCAPE_SEQUENCES_LFrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_SINGLE_HUNK_WITH_SEQUENCE_OF_CR_ESCAPE_SEQUENCES_LF.: &str = "\
2262 diff --git a/src/main.rs b/src/main.rs
2263 index f346a8c..e443b63 100644
2264 --- a/src/main.rs
2265 +++ b/src/main.rs
2266 @@ -1,5 +1,4 @@
2267 -deleted line\r
2268 -\r
2269 fn main() {\r
2270 println!(\"existing line\");\r
2271 + println!(\"added line\");\r
2272 }\r
2273 ";
2274
2275 const DIFF_IN_DIFFrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_IN_DIFF.: &str = "\
2276 diff --git a/0001-Init.patch b/0001-Init.patch
2277 deleted file mode 100644
2278 index 5e35a67..0000000
2279 --- a/0001-Init.patch
2280 +++ /dev/null
2281 @@ -1,22 +0,0 @@
2282 -From d3a8fe3e62be67484729c19e9d8db071f8b1d60c Mon Sep 17 00:00:00 2001
2283 -From: Maximilian Bosch <[email protected]>
2284 -Date: Sat, 28 Dec 2019 15:51:48 +0100
2285 -Subject: [PATCH] Init
2286 -
2287 ----
2288 - README.md | 3 +++
2289 - 1 file changed, 3 insertions(+)
2290 - create mode 100644 README.md
2291 -
2292 -diff --git a/README.md b/README.md
2293 -new file mode 100644
2294 -index 0000000..2e6ca05
2295 ---- /dev/null
2296 -+++ b/README.md
2297 -@@ -0,0 +1,3 @@
2298 -+# Test
2299 -+
2300 -+abc
2301 ---
2302 -2.23.1
2303 -
2304 diff --git a/README.md b/README.md
2305 index 2e6ca05..8ae0569 100644
2306 --- a/README.md
2307 +++ b/README.md
2308 @@ -1,3 +1 @@
2309 # Test
2310 -
2311 -abc
2312 ";
2313
2314 const ADDED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILE_INPUT.: &str = "\
2315 commit d28dc1ac57e53432567ec5bf19ad49ff90f0f7a5
2316 Author: Dan Davison <[email protected]>
2317 Date: Thu Jul 11 10:41:11 2019 -0400
2318
2319 .
2320
2321 diff --git a/a.py b/a.py
2322 new file mode 100644
2323 index 0000000..8c55b7d
2324 --- /dev/null
2325 +++ b/a.py
2326 @@ -0,0 +1,3 @@
2327 +# hello
2328 +class X:
2329 + pass";
2330
2331 const ADDED_EMPTY_FILErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_EMPTY_FILE.: &str = "
2332 commit c0a18433cb6e0ca8f796bfae9e31d95b06b91597 (HEAD -> master)
2333 Author: Dan Davison <[email protected]>
2334 Date: Sun Apr 26 16:32:58 2020 -0400
2335
2336 Initial commit
2337
2338 diff --git a/file b/file
2339 new file mode 100644
2340 index 0000000..e69de29
2341 ";
2342
2343 const ADDED_FILES_DIRECTORY_PATH_CONTAINING_SPACErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/ADDED_FILES_DIRECTORY_PATH_CONTAINING_SPACE.: &str = "
2344 commit 654e180c8d5329904d584c44b661149f68bd2911 (HEAD -> master)
2345 Author: Dan Davison <[email protected]>
2346 Date: Sun Apr 26 16:30:58 2020 -0400
2347
2348 Initial commit
2349
2350 diff --git a/nospace/file2 b/nospace/file2
2351 new file mode 100644
2352 index 0000000..af1b8ae
2353 --- /dev/null
2354 +++ b/nospace/file2
2355 @@ -0,0 +1 @@
2356 +file2 contents
2357 diff --git a/with space/file1 b/with space/file1
2358 new file mode 100644
2359 index 0000000..84d55c5
2360 --- /dev/null
2361 +++ b/with space/file1
2362 @@ -0,0 +1 @@
2363 +file1 contents
2364 ";
2365
2366 const MODIFIED_BASH_AND_CSHARP_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/MODIFIED_BASH_AND_CSHARP_FILES.: &str = "\
2367 diff --git a/a b/a
2368 index 8c4ae06..0a37de7 100644
2369 --- a/a
2370 +++ b/a
2371 @@ -9,7 +9,7 @@ foobar()
2372 dst=$(winpath $2)
2373
2374 # List the directory.
2375 - ls -l $src
2376 + ls -la $src
2377
2378 echo $src '->' $dst
2379 rsync -avu --delete $src/ $dst
2380 diff --git a/b.cs b/b.cs
2381 index 2e73468..8d8b89d 100644
2382 --- a/b.cs
2383 +++ b/b.cs
2384 @@ -6,7 +6,7 @@ class Program
2385 {
2386 static void Main(string[] args)
2387 {
2388 - int message = 123;
2389 + int message = 456;
2390
2391 Console.WriteLine(message);
2392 }
2393 ";
2394
2395 const MODIFIED_DOCKER_AND_RS_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/MODIFIED_DOCKER_AND_RS_FILES.: &str = "\
2396 diff --git a/Dockerfile b/Dockerfile
2397 index 0123456..1234567 100644
2398 --- a/Dockerfile
2399 +++ b/Dockerfile
2400 @@ -0,0 +2 @@
2401 +FROM foo
2402 +COPY bar baz
2403 diff --git a/rs b/rs
2404 index 0123456..1234567 100644
2405 --- a/rs
2406 +++ b/rs
2407 @@ -0,0 +2 @@
2408 +fn foobar() -> i8 {
2409 + 8
2410 +}
2411 ";
2412
2413 const RENAMED_FILE_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/RENAMED_FILE_INPUT.: &str = "\
2414 commit 1281650789680f1009dfff2497d5ccfbe7b96526
2415 Author: Dan Davison <[email protected]>
2416 Date: Wed Jul 17 20:40:23 2019 -0400
2417
2418 rename
2419
2420 diff --git a/a.py b/b.py
2421 similarity index 100%
2422 rename from a.py
2423 rename to b.py
2424 ";
2425
2426 const RENAMED_FILE_WITH_CHANGES_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/RENAMED_FILE_WITH_CHANGES_INPUT.: &str = "\
2427 commit 5a6dd572797813525199c32e26471e88732cae1f
2428 Author: Waldir Pimenta <[email protected]>
2429 Date: Sat Jul 11 19:14:43 2020 +0100
2430
2431 Rename font-dejavusansmono-nerd-font→font-dejavu-sans-mono-nerd-font
2432
2433 This makes the filename more readable, and is consistent with `font-dejavu-sans-mono-for-powerline`.
2434
2435 diff --git a/Casks/font-dejavusansmono-nerd-font.rb b/Casks/font-dejavu-sans-mono-nerd-font.rb
2436 similarity index 95%
2437 rename from Casks/font-dejavusansmono-nerd-font.rb
2438 rename to Casks/font-dejavu-sans-mono-nerd-font.rb
2439 index 2c8b440f..d1c1b0f3 100644
2440 --- a/Casks/font-dejavusansmono-nerd-font.rb
2441 +++ b/Casks/font-dejavu-sans-mono-nerd-font.rb
2442 @@ -1,4 +1,4 @@
2443 -cask 'font-dejavusansmono-nerd-font' do
2444 +cask 'font-dejavu-sans-mono-nerd-font' do
2445 version '2.1.0'
2446 sha256 '3fbcc4904c88f68d24c8b479784a1aba37f2d78b1162d21f6fc85a58ffcc0e0f'
2447
2448 ";
2449
2450 const DIFF_UNIFIED_TWO_FILESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_UNIFIED_TWO_FILES.: &str = "\
2451 --- one.rs 2019-11-20 06:16:08.000000000 +0100
2452 +++ src/two.rs 2019-11-18 18:41:16.000000000 +0100
2453 @@ -5,3 +5,3 @@
2454 println!(\"Hello world\");
2455 -println!(\"Hello rust\");
2456 +println!(\"Hello ruster\");
2457
2458 @@ -43,6 +43,6 @@
2459 // Some more changes
2460 -Change one
2461 Unchanged
2462 +Change two
2463 Unchanged
2464 -Change three
2465 +Change four
2466 Unchanged
2467 ";
2468
2469 const DIFF_UNIFIED_TWO_DIRECTORIESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_UNIFIED_TWO_DIRECTORIES.: &str = "\
2470 diff -u a/different b/different
2471 --- a/different 2019-11-20 06:47:56.000000000 +0100
2472 +++ b/different 2019-11-20 06:47:56.000000000 +0100
2473 @@ -1,3 +1,3 @@
2474 A simple file for testing
2475 the diff command in unified mode
2476 -This is different from b
2477 +This is different from a
2478 Only in a/: just_a
2479 Only in b/: just_b
2480 --- a/more_difference 2019-11-20 06:47:56.000000000 +0100
2481 +++ b/more_difference 2019-11-20 06:47:56.000000000 +0100
2482 @@ -1,3 +1,3 @@
2483 Another different file
2484 with a name that start with 'm' making it come after the 'Only in'
2485 -This is different from b
2486 +This is different from a
2487 ";
2488
2489 const DIFF_UNIFIED_CONCATENATEDrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_UNIFIED_CONCATENATED.: &str = "\
2490 --- 1/x 2022-03-06 11:16:06.313403500 -0800
2491 +++ 2/x 2022-03-06 11:18:14.083403500 -0800
2492 @@ -1,5 +1,5 @@
2493 This
2494 -is
2495 +IS
2496 a
2497 few
2498 -lines.
2499 +LINES.
2500 --- 1/y 2022-03-06 11:16:44.483403500 -0800
2501 +++ 2/y 2022-03-06 11:16:55.213403500 -0800
2502 @@ -1,4 +1,4 @@
2503 This
2504 is
2505 -another
2506 +ANOTHER
2507 test.
2508 ";
2509
2510 const NOT_A_DIFF_OUTPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/NOT_A_DIFF_OUTPUT.: &str = "\
2511 Hello world
2512 This is a regular file that contains:
2513 --- some/file/here 06:47:56.000000000 +0100
2514 +++ some/file/there 06:47:56.000000000 +0100
2515 Some text here
2516 -Some text with a minus
2517 +Some text with a plus
2518 ";
2519
2520 const SUBMODULE_DIRTYrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_DIRTY.: &str = "\
2521 diff --git a/some_submodule b/some_submodule
2522 index ca030fd1a0..803be42ca4 160000
2523 --- a/some_submodule
2524 +++ b/some_submodule
2525 @@ -1 +1 @@
2526 -Subproject commit ca030fd1a02225a6fc1a834c480276d9c97a8c6f
2527 +Subproject commit 803be42ca46af0fbc65b54a9abfb499389516939-dirty
2528 ";
2529
2530 // See etc/examples/662-submodules
2531 // diff.submodule = log
2532 const SUBMODULE_DIFF_LOGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_DIFF_LOG.: &str = "\
2533 commit ccb444baa861fdcb14d411b471a74614ed28776d
2534 Author: Dan Davison <[email protected]>
2535 Date: Sat Aug 21 18:56:34 2021 -0700
2536
2537 Update all submodules
2538
2539 Submodule submoduleA f4f55af..310b551 (rewind):
2540 < Submodule A extra change 2
2541 < Submodule A extra change 1
2542 < Submodule A initial commit 4
2543 < Submodule A initial commit 3
2544 Submodule submoduleB 0ffa700..0c8b00d:
2545 > Submodule B stage change 3
2546 > Submodule B stage change 2
2547 > Submodule B stage change 1
2548 Submodule submoduleC 9f3b744...e04f848:
2549 > Submodule C stage change 3
2550 > Submodule C stage change 2
2551 < Submodule C extra change 2
2552 > Submodule C stage change 1
2553 < Submodule C extra change 1
2554 ";
2555
2556 const SUBMODULE_DIFF_LOG_EXPECTED_OUTPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_DIFF_LOG_EXPECTED_OUTPUT.: &str = "\
2557 commit ccb444baa861fdcb14d411b471a74614ed28776d
2558 Author: Dan Davison <[email protected]>
2559 Date: Sat Aug 21 18:56:34 2021 -0700
2560
2561 Update all submodules
2562
2563
2564 Submodule submoduleA f4f55af..310b551 (rewind):
2565 ─────────────────────────────────────────────────
2566 < Submodule A extra change 2
2567 < Submodule A extra change 1
2568 < Submodule A initial commit 4
2569 < Submodule A initial commit 3
2570
2571 Submodule submoduleB 0ffa700..0c8b00d:
2572 ─────────────────────────────────────────────────
2573 > Submodule B stage change 3
2574 > Submodule B stage change 2
2575 > Submodule B stage change 1
2576
2577 Submodule submoduleC 9f3b744...e04f848:
2578 ─────────────────────────────────────────────────
2579 > Submodule C stage change 3
2580 > Submodule C stage change 2
2581 < Submodule C extra change 2
2582 > Submodule C stage change 1
2583 < Submodule C extra change 1
2584 ";
2585
2586 const SUBMODULE_CONTAINS_UNTRACKED_CONTENT_INPUTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/SUBMODULE_CONTAINS_UNTRACKED_CONTENT_INPUT.: &str = "\
2587 --- a
2588 +++ b
2589 @@ -2,3 +2,4 @@
2590 x
2591 y
2592 z
2593 -a
2594 +b
2595 z
2596 y
2597 x
2598 Submodule x/y/z contains untracked content
2599 ";
2600
2601 const TRIPLE_DASH_AT_BEGINNING_OF_LINE_IN_CODErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/TRIPLE_DASH_AT_BEGINNING_OF_LINE_IN_CODE.: &str = "\
2602 commit d481eaa8a249c6daecb05a97e8af1b926b0c02be
2603 Author: FirstName LastName <[email protected]>
2604 Date: Thu Feb 6 14:02:49 2020 -0500
2605
2606 Reorganize
2607
2608 diff --git a/src/Category/Coproduct.hs b/src/Category/Coproduct.hs
2609 deleted file mode 100644
2610 index ba28bfd..0000000
2611 --- a/src/Category/Coproduct.hs
2612 +++ /dev/null
2613 @@ -1,18 +0,0 @@
2614 -{-# LANGUAGE InstanceSigs #-}
2615 -module Category.Coproduct where
2616 -
2617 -import Prelude hiding ((.), id)
2618 -
2619 -import Control.Category
2620 -
2621 -import Category.Hacks
2622 -
2623 --- data (p ∨ q) (a :: (k, k)) (b :: (k, k)) where
2624 --- (:<:) :: p a b -> (∨) p q '(a, c) '(b, d)
2625 --- (:>:) :: q c d -> (∨) p q '(a, c) '(b, d)
2626 ---
2627 --- instance (Category p, Category q) => Category (p ∧ q) where
2628 --- (p1 :×: q1) . (p2 :×: q2) = (p1 . p2) :×: (q1 . q2)
2629 ---
2630 --- id :: forall a. (p ∧ q) a a
2631 --- id | IsTup <- isTup @a = id :×: id
2632 ";
2633
2634 const BINARY_FILES_DIFFERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILES_DIFFER.: &str = "
2635 commit 7d58b736b09788d65392cef1bf3dcc647165f7e7 (HEAD -> main)
2636 Author: Sondeyy <[email protected]>
2637 Date: Sat Aug 5 16:22:38 2023 +0200
2638
2639 modified bin file
2640
2641 diff --git a/foo b/foo
2642 index c9bbb35..5fc172d 100644
2643 Binary files a/foo and b/foo differ
2644 ";
2645
2646 const BINARY_FILE_ADDEDrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILE_ADDED.: &str = "
2647 commit 7d58b736b09788d65392cef1bf3dcc647165f7e7 (HEAD -> main)
2648 Author: Sondeyy <[email protected]>
2649 Date: Sat Aug 5 16:22:38 2023 +0200
2650
2651 added binary file
2652
2653 diff --git a/foo b/foo
2654 new file mode 100644
2655 index c9bbb35..5fc172d 100644
2656 Binary files /dev/null and b/foo differ
2657 ";
2658
2659 const BINARY_FILE_REMOVEDrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILE_REMOVED.: &str = "
2660 commit 7d58b736b09788d65392cef1bf3dcc647165f7e7 (HEAD -> main)
2661 Author: Sondeyy <[email protected]>
2662 Date: Sat Aug 5 16:22:38 2023 +0200
2663
2664 removed binary file
2665
2666 diff --git a/foo b/foo
2667 deleted file mode 100644
2668 index c9bbb35..5fc172d 100644
2669 Binary files a/foo and /dev/null differ
2670 ";
2671
2672 const BINARY_FILES_DIFFER_AFTER_OTHERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILES_DIFFER_AFTER_OTHER.: &str = "
2673 diff --git a/foo b/bar
2674 similarity index 100%
2675 rename from foo
2676 rename to bar
2677 diff --git a/qux b/qux
2678 index 00de669..d47cd84 100644
2679 Binary files a/qux and b/qux differ
2680 ";
2681
2682 const BINARY_FILES_DIFFER_BETWEEN_OTHERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/BINARY_FILES_DIFFER_BETWEEN_OTHER.: &str = "\
2683 diff --git a/foo b/foo
2684 index 7b57bd29ea8a..4d3b8c11a4a2 100644
2685 --- a/foo
2686 +++ b/foo
2687 @@ -1 +1 @@
2688 -abc
2689 +def
2690 diff --git a/qux b/qux
2691 index 00de669..d47cd84 100644
2692 Binary files a/qux and b/qux differ
2693 diff --git a/bar b/bar
2694 index 7b57bd29ea8a..4d3b8c11a4a2 100644
2695 --- a/bar
2696 +++ b/bar
2697 @@ -1 +1 @@
2698 -123
2699 +456
2700 ";
2701
2702 const DIFF_NO_INDEX_BINARY_FILES_DIFFERrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_NO_INDEX_BINARY_FILES_DIFFER.: &str = "\
2703 diff --git foo bar sub dir/foo bar baz
2704 index 329fbf5..481817c 100644
2705 Binary files foo bar and sub dir/foo bar baz differ
2706 ";
2707
2708 const GIT_DIFF_WITH_COPIED_FILErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_WITH_COPIED_FILE.: &str = "
2709 commit f600ed5ced4d98295ffa97571ed240cd86c34ac6 (HEAD -> master)
2710 Author: Dan Davison <[email protected]>
2711 Date: Fri Nov 20 20:18:30 2020 -0500
2712
2713 copy
2714
2715 diff --git a/first_file b/copied_file
2716 similarity index 100%
2717 copy from first_file
2718 copy to copied_file
2719 ";
2720
2721 // git --no-pager show -p --cc --format= --numstat --stat
2722 // #121
2723 const DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_1rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_1.: &str = "
2724 1 5 src/delta.rs
2725 src/delta.rs | 6 +-----
2726 1 file changed, 1 insertion(+), 5 deletions(-)
2727
2728 diff --git a/src/delta.rs b/src/delta.rs
2729 index da10d2b..39cff42 100644
2730 --- a/src/delta.rs
2731 +++ b/src/delta.rs
2732 @@ -67,11 +67,6 @@ where
2733 let source = detect_source(&mut lines_peekable);
2734
2735 for raw_line in lines_peekable {
2736 - if source == Source::Unknown {
2737 - writeln!(painter.writer, \"{}\", raw_line)?;
2738 - continue;
2739 - }
2740 -
2741 let line = strip_ansi_codes(&raw_line).to_string();
2742 if line.starts_with(\"commit \") {
2743 painter.paint_buffered_lines();
2744 @@ -674,6 +669,7 @@ mod tests {
2745 }
2746
2747 #[test]
2748 + #[ignore] // Ideally, delta would make this test pass.
2749 fn test_delta_ignores_non_diff_input() {
2750 let options = get_command_line_options();
2751 let output = strip_ansi_codes(&run_delta(NOT_A_DIFF_OUTPUT, &options)).to_string();
2752 ";
2753
2754 // git stash show --stat --patch
2755 // #100
2756 const DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_2rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_UNRECOGNIZED_PRECEDING_MATERIAL_2.: &str = "
2757 src/cli.rs | 2 ++
2758 src/config.rs | 4 +++-
2759 2 files changed, 5 insertions(+), 1 deletion(-)
2760
2761 diff --git a/src/cli.rs b/src/cli.rs
2762 index bd5f1d5..55ba315 100644
2763 --- a/src/cli.rs
2764 +++ b/src/cli.rs
2765 @@ -286,6 +286,8 @@ pub fn process_command_line_arguments<'a>(
2766 }
2767 };
2768
2769 + println!(\"true_color is {}\", true_color);
2770 +
2771 config::get_config(
2772 opt,
2773 &assets.syntax_set,
2774 diff --git a/src/config.rs b/src/config.rs
2775 index cba6064..ba1a4de 100644
2776 --- a/src/config.rs
2777 +++ b/src/config.rs
2778 @@ -181,7 +181,9 @@ fn color_from_rgb_or_ansi_code(s: &str) -> Color {
2779 process::exit(1);
2780 };
2781 if s.starts_with(\"#\") {
2782 - Color::from_str(s).unwrap_or_else(|_| die())
2783 + let col = Color::from_str(s).unwrap_or_else(|_| die());
2784 + println!(\"{} => {} {} {} {}\", s, col.r, col.g, col.b, col.a);
2785 + col
2786 } else {
2787 s.parse::<u8>()
2788 .ok()
2789 ";
2790
2791 const DIFF_WITH_MERGE_CONFLICTrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_MERGE_CONFLICT.: &str = r#"
2792 diff --cc Makefile
2793 index 759070d,3daf9eb..0000000
2794 --- a/Makefile
2795 +++ b/Makefile
2796 @@@ -4,13 -4,16 +4,37 @@@ build
2797 lint:
2798 cargo clippy
2799
2800 ++<<<<<<< Updated upstream
2801 +test: unit-test end-to-end-test
2802 +
2803 +unit-test:
2804 + cargo test
2805 +
2806 +end-to-end-test: build
2807 + bash -c "diff -u <(git log -p) <(git log -p | target/release/delta --color-only | perl -pe 's/\e\[[0-9;]*m//g')"
2808 ++||||||| constructed merge base
2809 ++test:
2810 ++ cargo test
2811 ++ bash -c "diff -u <(git log -p) \
2812 ++ <(git log -p | delta --width variable \
2813 ++ --tabs 0 \
2814 ++ --retain-plus-minus-markers \
2815 ++ --commit-style plain \
2816 ++ --file-style plain \
2817 ++ --hunk-style plain \
2818 ++ | ansifilter)"
2819 ++=======
2820 + test:
2821 + cargo test --release
2822 + bash -c "diff -u <(git log -p) \
2823 + <(git log -p | target/release/delta --width variable \
2824 + --tabs 0 \
2825 + --retain-plus-minus-markers \
2826 + --commit-style plain \
2827 + --file-style plain \
2828 + --hunk-style plain \
2829 + | ansifilter)" > /dev/null
2830 ++>>>>>>> Stashed changes
2831
2832 release:
2833 @make -f release.Makefile release
2834 "#;
2835
2836 // A bug appeared with the change to the tokenization regex in
2837 // b5d87819a1f76de9ef8f16f1bfb413468af50b62. The bug was triggered by this diff.
2838 const DIFF_EXHIBITING_TRUNCATION_BUGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_EXHIBITING_TRUNCATION_BUG.: &str = r#"
2839 diff --git a/a.rs b/b.rs
2840 index cba6064..ba1a4de 100644
2841 --- a/a.rs
2842 +++ b/b.rs
2843 @@ -1,1 +1,1 @@
2844 - Co
2845 + let col = Co
2846 "#;
2847
2848 // A bug appeared with the change to the state machine parser in
2849 // 5adc445ec38142046fc4cc4518e7019fe54f2e35. The bug was triggered by this diff. The bug was
2850 // present prior to that commit.
2851 const DIFF_EXHIBITING_STATE_MACHINE_PARSER_BUGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_EXHIBITING_STATE_MACHINE_PARSER_BUG.: &str = r"
2852 diff --git a/src/delta.rs b/src/delta.rs
2853 index 20aef29..20416c0 100644
2854 --- a/src/delta.rs
2855 +++ b/src/delta.rs
2856 @@ -994,0 +1014,2 @@ index cba6064..ba1a4de 100644
2857 +++ a
2858 +++ b
2859 ";
2860
2861 const DIFF_EXHIBITING_PARSE_FILE_NAME_BUGrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_EXHIBITING_PARSE_FILE_NAME_BUG.: &str = r"
2862 diff --git c/a i/a
2863 new file mode 100644
2864 index 0000000..eea55b6
2865 --- /dev/null
2866 +++ i/a
2867 @@ -0,0 +1 @@
2868 +++ a
2869 ";
2870
2871 const DIFF_WITH_REMOVED_EMPTY_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_REMOVED_EMPTY_LINE.: &str = r"
2872 diff --git i/a w/a
2873 index 8b13789..e69de29 100644
2874 --- i/a
2875 +++ w/a
2876 @@ -1 +0,0 @@
2877 -
2878 ";
2879
2880 const DIFF_WITH_ADDED_EMPTY_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_ADDED_EMPTY_LINE.: &str = r"
2881 diff --git i/a w/a
2882 index e69de29..8b13789 100644
2883 --- i/a
2884 +++ w/a
2885 @@ -0,0 +1 @@
2886 +
2887 ";
2888
2889 const DIFF_WITH_SINGLE_CHARACTER_LINErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_SINGLE_CHARACTER_LINE.: &str = r"
2890 diff --git a/Person.java b/Person.java
2891 new file mode 100644
2892 index 0000000..c6c830c
2893 --- /dev/null
2894 +++ b/Person.java
2895 @@ -0,0 +1,7 @@
2896 +import lombok.Data;
2897 +
2898 +@Data
2899 +public class Person {
2900 + private Long id;
2901 + private String name;
2902 +}
2903 ";
2904
2905 const DIFF_WITH_WHITESPACE_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_ERROR.: &str = r"
2906 diff --git c/a i/a
2907 new file mode 100644
2908 index 0000000..8d1c8b6
2909 --- /dev/null
2910 +++ i/a
2911 @@ -0,0 +1 @@
2912 +
2913 ";
2914
2915 const DIFF_WITH_REMOVED_WHITESPACE_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_REMOVED_WHITESPACE_ERROR.: &str = r"
2916 diff --git i/a w/a
2917 index 8d1c8b6..8b13789 100644
2918 --- i/a
2919 +++ w/a
2920 @@ -1 +1 @@
2921 -
2922 +
2923 ";
2924
2925 const DIFF_WITH_WHITESPACE_UNRELATED_EDIT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_UNRELATED_EDIT_ERROR.: &str = r"
2926 diff --git a/foo b/foo
2927 index 8d1c8b6..8b13789 100644
2928 --- a/foo
2929 +++ b/foo
2930 @@ -1 +1 @@
2931 -some line with trailing spaces
2932 +some new line with trailing spaces
2933 ";
2934
2935 const DIFF_WITH_WHITESPACE_EDIT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_EDIT_ERROR.: &str = r"
2936 diff --git a/foo b/foo
2937 index 8d1c8b6..8b13789 100644
2938 --- a/foo
2939 +++ b/foo
2940 @@ -1 +1 @@
2941 -same line with different number of trailing spaces
2942 +same line with different number of trailing spaces
2943 ";
2944
2945 const DIFF_WITH_WHITESPACE_AFTER_TEXT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_AFTER_TEXT_ERROR.: &str = r"
2946 diff --git c/a i/a
2947 new file mode 100644
2948 index 0000000..8d1c8b6
2949 --- /dev/null
2950 +++ i/a
2951 @@ -0,0 +1 @@
2952 +foo bar
2953 ";
2954
2955 const DIFF_WITH_REMOVED_WHITESPACE_AFTER_TEXT_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_REMOVED_WHITESPACE_AFTER_TEXT_ERROR.: &str = r"
2956 diff --git i/a w/a
2957 index 8d1c8b6..8b13789 100644
2958 --- i/a
2959 +++ w/a
2960 @@ -1 +0,0 @@
2961 -foo bar
2962 ";
2963 const DIFF_WITH_ADDED_WHITESPACE_EMPTY_LINE_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_ADDED_WHITESPACE_EMPTY_LINE_ERROR.: &str = r"
2964 diff --git a/a b/a
2965 index 0ec702f..8c75341 100644
2966 --- a/a
2967 +++ b/a
2968 @@ -1,0 +1,0 @@
2969 -
2970 +
2971 ";
2972
2973 // Delta handling is different for each of theses cases:
2974 // * Only space in the line is added or partially removed
2975 // * Space after text added or partially removed
2976 // * Space in a unmodified part of the line
2977 // This test regroup theses 5 cases.
2978 const DIFF_WITH_WHITESPACE_COMPLEX_ERRORrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_WHITESPACE_COMPLEX_ERROR.: &str = r"
2979 diff --git a/a b/a
2980 index 0ec702f..8c75341 100644
2981 --- a/a
2982 +++ b/a
2983 @@ -1,5 +1,5 @@
2984 -
2985 -
2986 - foo0
2987 - foo1
2988 - bar
2989 +
2990 +
2991 + foo0
2992 + foo1
2993 + bAr
2994 ";
2995
2996 const DIFF_WITH_TWO_ADDED_LINESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_TWO_ADDED_LINES.: &str = r#"
2997 diff --git a/example.c b/example.c
2998 index 386f291a..22666f79 100644
2999 --- a/example.c
3000 +++ b/example.c
3001 @@ -1,6 +1,8 @@
3002 int other_routine() {
3003 + return 0;
3004 }
3005
3006 int main() {
3007 puts("Hello, world!");
3008 + return 0;
3009 }
3010 "#;
3011
3012 const DIFF_WITH_TWO_ADDED_LINES_CREATED_BY_GIT_DIFF_U0rust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/DIFF_WITH_TWO_ADDED_LINES_CREATED_BY_GIT_DIFF_U0.: &str = r#"
3013 diff --git a/example.c b/example.c
3014 index 386f291a..22666f79 100644
3015 --- a/example.c
3016 +++ b/example.c
3017 @@ -1,0 +2 @@ int other_routine() {
3018 + return 0;
3019 @@ -5,0 +7 @@ int main() {
3020 + return 0;
3021 "#;
3022
3023 const GIT_DIFF_UNDER_COLOR_MOVED_DIMMED_ZEBRA_WITH_ANSI_ESCAPE_SEQUENCESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_UNDER_COLOR_MOVED_DIMMED_ZEBRA_WITH_ANSI_ESCAPE_SEQUENCES.: &str = r#"
3024 commit 8406b1996daa176ca677ac33b18f071b766c87a5
3025 Author: Dan Davison <[email protected]>
3026 Date: Sun Nov 1 15:28:53 2020 -0500
3027
3028 A change to investigate color-moved behavior, see #371
3029
3030 diff --git a/etc/performance/all-benchmarks.json b/etc/performance/all-benchmarks.json
3031 index f86240e7..f707e5fd 100644
3032 --- a/etc/performance/all-benchmarks.json
3033 +++ b/etc/performance/all-benchmarks.json
3034 @@ -7,9 +7,9 @@
3035 "median": 0.004928057465000001,
3036 "message": "cargo new delta\n",
3037 "min": 0.003220796465,
3038 - "stddev": 0.004157057519168492,
3039 "system": 0.0016010150000000001,
3040 "time": 0.013288195465,
3041 + "stddev": 0.004157057519168492,
3042 "user": 0.0013687749999999996
3043 },
3044 {
3045 @@ -26649,4 +26649,4 @@
3046 "time": 1.8524859272050003,
3047 "user": 1.8240279649999998
3048 }
3049 -]
3050 \ No newline at end of file
3051 +]
3052 "#;
3053
3054 const GIT_DIFF_FILE_MODE_CHANGE_WITH_RENAMErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_WITH_RENAME.: &str = "
3055 diff --git a/old-longer-name b/shorter-name
3056 old mode 100644
3057 new mode 100755
3058 similarity index 100%
3059 rename from old-longer-name
3060 rename to shorter-name
3061 ";
3062
3063 const GIT_DIFF_FILE_MODE_CHANGE_GAIN_EXECUTABLE_BITrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_GAIN_EXECUTABLE_BIT.: &str = "
3064 diff --git a/src/delta.rs b/src/delta.rs
3065 old mode 100644
3066 new mode 100755
3067 ";
3068
3069 const GIT_DIFF_FILE_MODE_CHANGE_LOSE_EXECUTABLE_BITrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_LOSE_EXECUTABLE_BIT.: &str = "
3070 diff --git a/src/delta.rs b/src/delta.rs
3071 old mode 100755
3072 new mode 100644
3073 ";
3074
3075 const GIT_DIFF_FILE_MODE_CHANGE_UNEXPECTED_BITSrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_UNEXPECTED_BITS.: &str = "
3076 diff --git a/src/delta.rs b/src/delta.rs
3077 old mode 100700
3078 new mode 100644
3079 ";
3080
3081 // This output can be generated with `git diff -D`
3082 const GIT_DIFF_FILE_DELETED_WITHOUT_PREIMAGErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_DELETED_WITHOUT_PREIMAGE.: &str = "
3083 diff --git a/foo.bar b/foo.bar
3084 deleted file mode 100644
3085 index e019be0..0000000
3086 ";
3087
3088 // This output can be generated with `git diff -D`
3089 const GIT_DIFF_FILES_DELETED_WITHOUT_PREIMAGErust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILES_DELETED_WITHOUT_PREIMAGE.: &str = "
3090 diff --git a/foo b/foo
3091 deleted file mode 100644
3092 index e019be0..0000000
3093 diff --git a/bar b/bar
3094 deleted file mode 100644
3095 index e019be0..0000000
3096 ";
3097
3098 const GIT_DIFF_FILE_MODE_CHANGE_WITH_DIFFrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_FILE_MODE_CHANGE_WITH_DIFF.: &str = "
3099 diff --git a/src/script b/src/script
3100 old mode 100644
3101 new mode 100755
3102 index d00491f..0cfbf08 100644
3103 --- a/src/script
3104 +++ b/src/script
3105 @@ -1 +1 @@
3106 -#!/bin/sh
3107 +#!/bin/bash
3108 ";
3109
3110 const GIT_DIFF_NO_INDEX_FILENAMES_WITH_SPACESrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_NO_INDEX_FILENAMES_WITH_SPACES.: &str = "
3111 diff --git a/a b b/c d
3112 index d00491f..0cfbf08 100644
3113 --- a/a b
3114 +++ b/c d
3115 @@ -1 +1 @@
3116 -1
3117 +2
3118 ";
3119
3120 const GIT_LOG_FILE_REMOVAL_IN_FIRST_COMMITrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_LOG_FILE_REMOVAL_IN_FIRST_COMMIT.: &str = "
3121 commit 4117f616160180c0c57ea64840eadd08b7fa32a4
3122 Author: Björn Steinbrink <[email protected]>
3123 Date: Tue Jun 21 14:51:59 2022 +0200
3124
3125 remove file
3126
3127 diff --git a a
3128 deleted file mode 100644
3129 index e69de29..0000000
3130
3131 commit 190cce5dffeb9050fd6a27780f16d84b19c07dc0
3132 Author: Björn Steinbrink <[email protected]>
3133 Date: Tue Jun 21 14:48:20 2022 +0200
3134
3135 add file
3136
3137 diff --git a a
3138 new file mode 100644
3139 index 0000000..e69de29
3140 ";
3141
3142 const GIT_DIFF_ALL_UNICODE_W_FULLWIDTHrust-analyzer cargo git-delta 0.19.2 tests/test_example_diffs/tests/GIT_DIFF_ALL_UNICODE_W_FULLWIDTH.: &str = "
3143 diff --git a/src/a b/src/a
3144 index 53f98b6..14d6caa 100644
3145 --- a/src/a
3146 +++ b/src/a
3147 @@ -1,7 +1,7 @@
3148 一æäöø€ÆÄÖ〇Øß一
3149 一æäöø€ÆÄÖ〇Øß一
3150 -二æäöø¢ÆÄÖ〇Øß二
3151 -二æäöø¢ÆÄÖ〇Øß二
3152 +二æäöø€ÆÄÖ〇Øß二
3153 +二æäöø€ÆÄÖ〇Øß二
3154 三æäöø€ÆÄÖ〇Øß三
3155 三æäöø€ÆÄÖ〇Øß三
3156
3157 ";
3158 }