|
2 | 2 | // |
3 | 3 | // For the full copyright and license information, please view the LICENSE |
4 | 4 | // file that was distributed with this source code. |
| 5 | + |
| 6 | +// spell-checker:ignore defg |
| 7 | + |
5 | 8 | use crate::common::util::TestScenario; |
6 | 9 |
|
7 | 10 | static INPUT: &str = "lists.txt"; |
@@ -288,7 +291,7 @@ fn test_newline_delimited() { |
288 | 291 | .args(&["-f", "1", "-d", "\n"]) |
289 | 292 | .pipe_in("a:1\nb:") |
290 | 293 | .succeeds() |
291 | | - .stdout_only_bytes("a:1\n"); |
| 294 | + .stdout_only_bytes("a:1\nb:\n"); |
292 | 295 | } |
293 | 296 |
|
294 | 297 | #[test] |
@@ -329,3 +332,31 @@ fn test_8bit_non_utf8_delimiter() { |
329 | 332 | .succeeds() |
330 | 333 | .stdout_check(|out| out == "b_c\n".as_bytes()); |
331 | 334 | } |
| 335 | + |
| 336 | +#[test] |
| 337 | +fn test_newline_preservation_with_f1_option() { |
| 338 | + let (at, mut ucmd) = at_and_ucmd!(); |
| 339 | + at.write("1", "a\nb"); |
| 340 | + let expected = "a\nb\n"; |
| 341 | + ucmd.args(&["-f1-", "1"]).succeeds().stdout_is(expected); |
| 342 | +} |
| 343 | + |
| 344 | +#[ignore = "Not yet implemented"] |
| 345 | +#[test] |
| 346 | +fn test_output_delimiter_with_character_ranges() { |
| 347 | + new_ucmd!() |
| 348 | + .args(&["-c2-3,4-", "--output-delim=:"]) |
| 349 | + .pipe_in("abcdefg\n") |
| 350 | + .succeeds() |
| 351 | + .stdout_only("bc:defg\n"); |
| 352 | +} |
| 353 | + |
| 354 | +#[ignore = "Not yet implemented"] |
| 355 | +#[test] |
| 356 | +fn test_output_delimiter_with_adjacent_ranges() { |
| 357 | + new_ucmd!() |
| 358 | + .args(&["-b1-2,3-4", "--output-d=:"]) |
| 359 | + .pipe_in("abcd\n") |
| 360 | + .succeeds() |
| 361 | + .stdout_only("ab:cd\n"); |
| 362 | +} |
0 commit comments