From 500604287b004fe7ebcde974a420286e93dad2eb Mon Sep 17 00:00:00 2001 From: Jeffrey Finkelstein Date: Sun, 18 Jan 2026 09:48:42 -0500 Subject: [PATCH] pr: remove inaccurate unit test Remove unit test for `pr` that was enforcing incorrect behavior. These tests were ostensibly designed to match corresponding ones in the GNU test suite, but they don't match the current behavior of GNU `pr`, so it is not valuable to keep them. --- tests/by-util/test_pr.rs | 46 ---------------------------------------- 1 file changed, 46 deletions(-) diff --git a/tests/by-util/test_pr.rs b/tests/by-util/test_pr.rs index 19afb57bc..2220e9c39 100644 --- a/tests/by-util/test_pr.rs +++ b/tests/by-util/test_pr.rs @@ -478,52 +478,6 @@ fn test_with_date_format_env() { .stdout_matches(®ex); } -#[test] -fn test_with_pr_core_utils_tests() { - let test_cases = vec![ - ("", vec!["0Ft"], vec!["0F"], 0), - ("", vec!["0Fnt"], vec!["0Fnt-expected"], 0), - ("+3", vec!["0Ft"], vec!["3-0F"], 0), - ("+3 -f", vec!["0Ft"], vec!["3f-0F"], 0), - ("-a -3", vec!["0Ft"], vec!["a3-0F"], 0), - ("-a -3 -f", vec!["0Ft"], vec!["a3f-0F"], 0), - ("-a -3 -f", vec!["0Fnt"], vec!["a3f-0Fnt-expected"], 0), - ("+3 -a -3 -f", vec!["0Ft"], vec!["3a3f-0F"], 0), - ("-l 24", vec!["FnFn"], vec!["l24-FF"], 0), - ("-W 20 -l24 -f", vec!["tFFt-ll"], vec!["W20l24f-ll"], 0), - ]; - - for test_case in test_cases { - let (flags, input_file, expected_file, return_code) = test_case; - let mut scenario = new_ucmd!(); - let input_file_path = input_file.first().unwrap(); - let test_file_path = expected_file.first().unwrap(); - let value = file_last_modified_time(&scenario, input_file_path); - let mut arguments: Vec<&str> = flags - .split(' ') - .filter(|i| i.trim() != "") - .collect::>(); - - arguments.extend(input_file.clone()); - - let scenario_with_args = scenario.args(&arguments); - - let scenario_with_expected_status = if return_code == 0 { - scenario_with_args.succeeds() - } else { - scenario_with_args.fails() - }; - - scenario_with_expected_status.stdout_is_templated_fixture( - test_file_path, - &[ - ("{last_modified_time}", &value), - ("{file_name}", input_file_path), - ], - ); - } -} - #[test] fn test_with_join_lines_option() { let test_file_1 = "hosts.log";