Skip to content

Commit

Permalink
tests/csplit: modified test test_up_to_match_offset_option_suppress_m…
Browse files Browse the repository at this point in the history
…atched according to issue #7052 and modified also test_up_to_match_negative_offset_option_suppress_matched
  • Loading branch information
Felle33 committed Jan 7, 2025
1 parent 49ae68d commit 000981f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/by-util/test_csplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,29 +469,29 @@ fn test_up_to_match_offset_option_suppress_matched() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["numbers50.txt", "--suppress-matched", "/10/+4"])
.succeeds()
.stdout_only("27\n111\n");
.stdout_only("30\n108\n");

let count = glob(&at.plus_as_string("xx*"))
.expect("there should be splits created")
.count();
assert_eq!(count, 2);
assert_eq!(at.read("xx00"), generate(1, 10) + &generate(11, 14));
assert_eq!(at.read("xx01"), generate(14, 51));
assert_eq!(at.read("xx00"), generate(1, 14));
assert_eq!(at.read("xx01"), generate(15, 51));
}

#[test]
fn test_up_to_match_negative_offset_option_suppress_matched() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.args(&["numbers50.txt", "--suppress-matched", "/10/-4"])
.succeeds()
.stdout_only("10\n128\n");
.stdout_only("10\n129\n");

let count = glob(&at.plus_as_string("xx*"))
.expect("there should be splits created")
.count();
assert_eq!(count, 2);
assert_eq!(at.read("xx00"), generate(1, 6));
assert_eq!(at.read("xx01"), generate(6, 10) + &generate(11, 51));
assert_eq!(at.read("xx01"), generate(7, 51));
}

#[test]
Expand Down

0 comments on commit 000981f

Please sign in to comment.