From 75b35e600287e422c6258dbefcc4f88053bb4a23 Mon Sep 17 00:00:00 2001 From: tilakpatidar Date: Sun, 28 Apr 2019 12:51:37 +0530 Subject: [PATCH] pr: remove not required tests --- tests/fixtures/pr/test_num_page.log.expected | 132 ------------------ .../pr/test_num_page_less_content.log | 7 - .../test_num_page_less_content.log.expected | 66 --------- tests/test_pr.rs | 69 ++------- 4 files changed, 12 insertions(+), 262 deletions(-) delete mode 100644 tests/fixtures/pr/test_num_page.log.expected delete mode 100644 tests/fixtures/pr/test_num_page_less_content.log delete mode 100644 tests/fixtures/pr/test_num_page_less_content.log.expected diff --git a/tests/fixtures/pr/test_num_page.log.expected b/tests/fixtures/pr/test_num_page.log.expected deleted file mode 100644 index 076d3f212..000000000 --- a/tests/fixtures/pr/test_num_page.log.expected +++ /dev/null @@ -1,132 +0,0 @@ - - -{last_modified_time} test_num_page.log Page 1 - - - 1 ntation processAirPortStateChanges]: pppConnectionState 0 - 2 Mon Dec 10 11:42:56.558 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 3 Mon Dec 10 11:42:56.705 Info: 802.1X changed - 4 Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 5 Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 6 Mon Dec 10 11:42:56.854 Info: 802.1X changed - 7 Mon Dec 10 11:42:56.855 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 8 Mon Dec 10 11:42:56.856 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 9 Mon Dec 10 11:42:57.002 Info: 802.1X changed - 10 Mon Dec 10 11:42:57.003 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 11 Mon Dec 10 11:42:57.003 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 12 Mon Dec 10 11:42:57.152 Info: 802.1X changed - 13 Mon Dec 10 11:42:57.154 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 14 Mon Dec 10 11:42:57.154 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 15 Mon Dec 10 11:42:57.302 Info: 802.1X changed - 16 Mon Dec 10 11:42:57.304 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 17 Mon Dec 10 11:42:57.304 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 18 Mon Dec 10 11:42:57.449 Info: 802.1X changed - 19 Mon Dec 10 11:42:57.451 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 20 Mon Dec 10 11:42:57.451 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 21 Mon Dec 10 11:42:57.600 Info: 802.1X changed - 22 Mon Dec 10 11:42:57.601 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 23 Mon Dec 10 11:42:57.602 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 24 Mon Dec 10 11:42:57.624 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 25 Mon Dec 10 11:42:57.624 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 26 Mon Dec 10 11:42:57.749 Info: 802.1X changed - 27 Mon Dec 10 11:42:57.750 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 28 Mon Dec 10 11:42:57.751 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 29 Mon Dec 10 11:42:57.896 Info: 802.1X changed - 30 Mon Dec 10 11:42:57.897 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 31 Mon Dec 10 11:42:57.897 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 32 Mon Dec 10 11:42:58.045 Info: 802.1X changed - 33 Mon Dec 10 11:42:58.047 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 34 Mon Dec 10 11:42:58.047 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 35 Mon Dec 10 11:42:58.193 Info: 802.1X changed - 36 Mon Dec 10 11:42:58.195 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 37 Mon Dec 10 11:42:58.195 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 38 Mon Dec 10 11:42:58.342 Info: 802.1X changed - 39 Mon Dec 10 11:42:58.343 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 40 Mon Dec 10 11:42:58.344 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 41 Mon Dec 10 11:42:58.491 Info: 802.1X changed - 42 Mon Dec 10 11:42:58.493 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 43 Mon Dec 10 11:42:58.494 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 44 Mon Dec 10 11:42:58.640 Info: 802.1X changed - 45 Mon Dec 10 11:42:58.642 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 46 Mon Dec 10 11:42:58.642 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 47 Mon Dec 10 11:42:58.805 Info: 802.1X changed - 48 Mon Dec 10 11:42:58.806 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 49 Mon Dec 10 11:42:58.806 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 50 Mon Dec 10 11:42:58.958 Info: 802.1X changed - 51 Mon Dec 10 11:42:58.959 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 52 Mon Dec 10 11:42:58.960 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 53 Mon Dec 10 11:42:59.155 Info: 802.1X changed - 54 Mon Dec 10 11:42:59.157 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 55 Mon Dec 10 11:42:59.159 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 56 Mon Dec 10 11:42:59.352 Info: 802.1X changed - - - - - - - -{last_modified_time} test_num_page.log Page 2 - - - 57 ntation processAirPortStateChanges]: pppConnectionState 0 - 58 Mon Dec 10 11:42:56.558 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 59 Mon Dec 10 11:42:56.705 Info: 802.1X changed - 60 Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 61 Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 62 Mon Dec 10 11:42:56.854 Info: 802.1X changed - 63 Mon Dec 10 11:42:56.855 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 64 Mon Dec 10 11:42:56.856 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 65 Mon Dec 10 11:42:57.002 Info: 802.1X changed - 66 Mon Dec 10 11:42:57.003 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 67 Mon Dec 10 11:42:57.003 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 68 Mon Dec 10 11:42:57.152 Info: 802.1X changed - 69 Mon Dec 10 11:42:57.154 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 70 Mon Dec 10 11:42:57.154 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 71 Mon Dec 10 11:42:57.302 Info: 802.1X changed - 72 Mon Dec 10 11:42:57.304 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 73 Mon Dec 10 11:42:57.304 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 74 Mon Dec 10 11:42:57.449 Info: 802.1X changed - 75 Mon Dec 10 11:42:57.451 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 76 Mon Dec 10 11:42:57.451 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 77 Mon Dec 10 11:42:57.600 Info: 802.1X changed - 78 Mon Dec 10 11:42:57.601 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 79 Mon Dec 10 11:42:57.602 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 80 Mon Dec 10 11:42:57.624 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 81 Mon Dec 10 11:42:57.624 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 82 Mon Dec 10 11:42:57.749 Info: 802.1X changed - 83 Mon Dec 10 11:42:57.750 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 84 Mon Dec 10 11:42:57.751 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 85 Mon Dec 10 11:42:57.896 Info: 802.1X changed - 86 Mon Dec 10 11:42:57.897 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 87 Mon Dec 10 11:42:57.897 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 88 Mon Dec 10 11:42:58.045 Info: 802.1X changed - 89 Mon Dec 10 11:42:58.047 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 90 Mon Dec 10 11:42:58.047 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 91 Mon Dec 10 11:42:58.193 Info: 802.1X changed - 92 Mon Dec 10 11:42:58.195 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 93 Mon Dec 10 11:42:58.195 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 94 Mon Dec 10 11:42:58.342 Info: 802.1X changed - 95 Mon Dec 10 11:42:58.343 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 96 Mon Dec 10 11:42:58.344 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 97 Mon Dec 10 11:42:58.491 Info: 802.1X changed - 98 Mon Dec 10 11:42:58.493 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 99 Mon Dec 10 11:42:58.494 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 100 Mon Dec 10 11:42:58.640 Info: 802.1X changed - 101 Mon Dec 10 11:42:58.642 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 102 Mon Dec 10 11:42:58.642 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 103 Mon Dec 10 11:42:58.805 Info: 802.1X changed - 104 Mon Dec 10 11:42:58.806 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 105 Mon Dec 10 11:42:58.806 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 106 Mon Dec 10 11:42:58.958 Info: 802.1X changed - 107 Mon Dec 10 11:42:58.959 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 108 Mon Dec 10 11:42:58.960 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 109 Mon Dec 10 11:42:59.155 Info: 802.1X changed - 110 Mon Dec 10 11:42:59.157 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 111 Mon Dec 10 11:42:59.159 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 112 Mon Dec 10 11:42:59.352 Info: 802.1X changed - - - - - diff --git a/tests/fixtures/pr/test_num_page_less_content.log b/tests/fixtures/pr/test_num_page_less_content.log deleted file mode 100644 index cf13a6862..000000000 --- a/tests/fixtures/pr/test_num_page_less_content.log +++ /dev/null @@ -1,7 +0,0 @@ -ntation processAirPortStateChanges]: pppConnectionState 0 -Mon Dec 10 11:42:56.558 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars -Mon Dec 10 11:42:56.705 Info: 802.1X changed -Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 -Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars -Mon Dec 10 11:42:56.854 Info: 802.1X changed -Mon Dec 10 11:42:56.855 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 \ No newline at end of file diff --git a/tests/fixtures/pr/test_num_page_less_content.log.expected b/tests/fixtures/pr/test_num_page_less_content.log.expected deleted file mode 100644 index 8cd3cf6bc..000000000 --- a/tests/fixtures/pr/test_num_page_less_content.log.expected +++ /dev/null @@ -1,66 +0,0 @@ - - -{last_modified_time} test_num_page_less_content.log Page 1 - - - 1 ntation processAirPortStateChanges]: pppConnectionState 0 - 2 Mon Dec 10 11:42:56.558 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 3 Mon Dec 10 11:42:56.705 Info: 802.1X changed - 4 Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - 5 Mon Dec 10 11:42:56.706 Info: -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars - 6 Mon Dec 10 11:42:56.854 Info: 802.1X changed - 7 Mon Dec 10 11:42:56.855 Info: -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/test_pr.rs b/tests/test_pr.rs index b4ff61ed7..61b9a647c 100644 --- a/tests/test_pr.rs +++ b/tests/test_pr.rs @@ -40,36 +40,6 @@ fn test_without_any_options() { ); } -#[test] -fn test_with_numbering_option() { - let test_file_path = "test_num_page.log"; - let expected_test_file_path = "test_num_page.log.expected"; - let mut scenario = new_ucmd!(); - let value = file_last_modified_time(&scenario, test_file_path); - scenario - .args(&["-n", test_file_path]) - .succeeds() - .stdout_is_templated_fixture( - expected_test_file_path, - vec![(&"{last_modified_time}".to_string(), &value)], - ); -} - -#[test] -fn test_with_numbering_option_when_content_is_less_than_page() { - let test_file_path = "test_num_page_less_content.log"; - let expected_test_file_path = "test_num_page_less_content.log.expected"; - let mut scenario = new_ucmd!(); - let value = file_last_modified_time(&scenario, test_file_path); - scenario - .args(&["-n", test_file_path]) - .succeeds() - .stdout_is_templated_fixture( - expected_test_file_path, - vec![(&"{last_modified_time}".to_string(), &value)], - ); -} - #[test] fn test_with_numbering_option_with_number_width() { let test_file_path = "test_num_page.log"; @@ -85,25 +55,6 @@ fn test_with_numbering_option_with_number_width() { ); } -#[test] -fn test_with_header_option() { - let test_file_path = "test_one_page.log"; - let expected_test_file_path = "test_one_page_header.log.expected"; - let mut scenario = new_ucmd!(); - let value = file_last_modified_time(&scenario, test_file_path); - let header = "new file"; - scenario - .args(&["-h", header, test_file_path]) - .succeeds() - .stdout_is_templated_fixture( - expected_test_file_path, - vec![ - (&"{last_modified_time}".to_string(), &value), - (&"{header}".to_string(), &header.to_string()), - ], - ); -} - #[test] fn test_with_long_header_option() { let test_file_path = "test_one_page.log"; @@ -121,6 +72,17 @@ fn test_with_long_header_option() { (&"{header}".to_string(), &header.to_string()), ], ); + + new_ucmd!() + .args(&["-h", header, test_file_path]) + .succeeds() + .stdout_is_templated_fixture( + expected_test_file_path, + vec![ + (&"{last_modified_time}".to_string(), &value), + (&"{header}".to_string(), &header.to_string()), + ], + ); } #[test] @@ -136,15 +98,8 @@ fn test_with_double_space_option() { expected_test_file_path, vec![(&"{last_modified_time}".to_string(), &value)], ); -} -#[test] -fn test_with_long_double_space_option() { - let test_file_path = "test_one_page.log"; - let expected_test_file_path = "test_one_page_double_line.log.expected"; - let mut scenario = new_ucmd!(); - let value = file_last_modified_time(&scenario, test_file_path); - scenario + new_ucmd!() .args(&["--double-space", test_file_path]) .succeeds() .stdout_is_templated_fixture(