This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -172,10 +172,33 @@ mod tests {
172172 ) ;
173173 }
174174
175+ #[ test]
176+ fn applying_unix_newlines_changes_nothing_for_unix_newlines ( ) {
177+ let formatted_text = "One\n Two\n Three" ;
178+ test_newlines_are_applied_correctly ( formatted_text, formatted_text, NewlineStyle :: Unix ) ;
179+ }
180+
181+ #[ test]
182+ fn applies_unix_newlines_to_string_with_unix_and_windows_newlines ( ) {
183+ test_newlines_are_applied_correctly (
184+ "One\r \n Two\r \n Three\n Four" ,
185+ "One\n Two\n Three\n Four" ,
186+ NewlineStyle :: Unix ,
187+ ) ;
188+ }
189+
190+ #[ test]
191+ fn applies_windows_newlines_to_string_with_unix_and_windows_newlines ( ) {
192+ test_newlines_are_applied_correctly (
193+ "One\n Two\n Three\r \n Four" ,
194+ "One\r \n Two\r \n Three\r \n Four" ,
195+ NewlineStyle :: Windows ,
196+ ) ;
197+ }
198+
175199 #[ test]
176200 fn applying_windows_newlines_changes_nothing_for_windows_newlines ( ) {
177201 let formatted_text = "One\r \n Two\r \n Three" ;
178-
179202 test_newlines_are_applied_correctly ( formatted_text, formatted_text, NewlineStyle :: Windows ) ;
180203 }
181204
You can’t perform that action at this time.
0 commit comments