pr: add test for -t -l -r option

pr: Add test for -l option

pr: Add test for -r suppress error option
This commit is contained in:
Tilak Patidar 2018-12-16 22:54:09 +05:30 committed by Max Semenik
parent b742230dbb
commit b578bb6563
5 changed files with 327 additions and 12 deletions

View file

@ -302,7 +302,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
let maybe_file = matches.opt_str(NUMBERING_MODE_OPTION).unwrap();
let is_afile = is_a_file(&maybe_file);
if !is_afile {
writeln!(&mut stderr(), "{}", PrError::NotExists(maybe_file));
print_error(&matches, PrError::NotExists(maybe_file));
return 1;
} else {
files.push(maybe_file);
@ -321,15 +321,13 @@ pub fn uumain(args: Vec<String>) -> i32 {
for f in files {
let result_options = build_options(&matches, &f);
if result_options.is_err() {
writeln!(&mut stderr(), "{}", result_options.err().unwrap());
print_error(&matches, result_options.err().unwrap());
return 1;
}
let options = &result_options.unwrap();
let status: i32 = match pr(&f, options) {
Err(error) => {
if !options.suppress_errors {
writeln!(&mut stderr(), "{}", error);
}
print_error(&matches, error);
1
}
_ => 0
@ -345,6 +343,12 @@ fn is_a_file(could_be_file: &String) -> bool {
File::open(could_be_file).is_ok()
}
fn print_error(matches: &Matches, err: PrError) {
if !matches.opt_present(SUPPRESS_PRINTING_ERROR) {
writeln!(&mut stderr(), "{}", err);
}
}
fn print_usage(opts: &mut Options, matches: &Matches) -> i32 {
println!("{} {} -- print files", NAME, VERSION);
println!();
@ -476,11 +480,15 @@ fn build_options(matches: &Matches, path: &String) -> Result<OutputOptions, PrEr
Some(res) => res?,
_ => LINES_PER_PAGE
};
let page_length_le_ht = page_length < (HEADER_LINES_PER_PAGE + TRAILER_LINES_PER_PAGE);
let content_lines_per_page = page_length - (HEADER_LINES_PER_PAGE + TRAILER_LINES_PER_PAGE);
let display_header_and_trailer = !(page_length_le_ht) && !matches.opt_present(NO_HEADER_TRAILER_OPTION);
let display_header_and_trailer = !(page_length < (HEADER_LINES_PER_PAGE + TRAILER_LINES_PER_PAGE))
&& !matches.opt_present(NO_HEADER_TRAILER_OPTION);
let content_lines_per_page = if page_length_le_ht {
page_length
} else {
page_length - (HEADER_LINES_PER_PAGE + TRAILER_LINES_PER_PAGE)
};
let suppress_errors = matches.opt_present(SUPPRESS_PRINTING_ERROR);

View file

@ -0,0 +1,56 @@
ntation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:56.558 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:56.705 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:56.706 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:56.706 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:56.854 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:56.855 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:56.856 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.002 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.003 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.003 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.152 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.154 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.154 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.302 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.304 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.304 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.449 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.451 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.451 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.600 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.601 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.602 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.624 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.624 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.749 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.750 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.751 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:57.896 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:57.897 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:57.897 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.045 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.047 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.047 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.193 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.195 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.195 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.342 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.343 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.344 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.491 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.493 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.494 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.640 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.642 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.642 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.805 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.806 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.806 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:58.958 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:58.959 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:58.960 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:59.155 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
Mon Dec 10 11:42:59.157 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
Mon Dec 10 11:42:59.159 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
Mon Dec 10 11:42:59.352 Info: <Wi-Fi Menu Extra[335]> 802.1X changed

View file

@ -0,0 +1,200 @@
{last_modified_time} test.log Page 2
1 ntation processAirPortStateChanges]: pppConnectionState 0
2 Mon Dec 10 11:42:56.558 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
3 Mon Dec 10 11:42:56.705 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
4 Mon Dec 10 11:42:56.706 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
5 Mon Dec 10 11:42:56.706 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
6 Mon Dec 10 11:42:56.854 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
7 Mon Dec 10 11:42:56.855 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
8 Mon Dec 10 11:42:56.856 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
9 Mon Dec 10 11:42:57.002 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
10 Mon Dec 10 11:42:57.003 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
11 Mon Dec 10 11:42:57.003 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
12 Mon Dec 10 11:42:57.152 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
13 Mon Dec 10 11:42:57.154 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
14 Mon Dec 10 11:42:57.154 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
15 Mon Dec 10 11:42:57.302 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
16 Mon Dec 10 11:42:57.304 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
17 Mon Dec 10 11:42:57.304 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
18 Mon Dec 10 11:42:57.449 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
19 Mon Dec 10 11:42:57.451 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
20 Mon Dec 10 11:42:57.451 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
21 Mon Dec 10 11:42:57.600 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
22 Mon Dec 10 11:42:57.601 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
23 Mon Dec 10 11:42:57.602 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
24 Mon Dec 10 11:42:57.624 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
25 Mon Dec 10 11:42:57.624 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
26 Mon Dec 10 11:42:57.749 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
27 Mon Dec 10 11:42:57.750 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
28 Mon Dec 10 11:42:57.751 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
29 Mon Dec 10 11:42:57.896 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
30 Mon Dec 10 11:42:57.897 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
31 Mon Dec 10 11:42:57.897 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
32 Mon Dec 10 11:42:58.045 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
33 Mon Dec 10 11:42:58.047 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
34 Mon Dec 10 11:42:58.047 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
35 Mon Dec 10 11:42:58.193 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
36 Mon Dec 10 11:42:58.195 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
37 Mon Dec 10 11:42:58.195 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
38 Mon Dec 10 11:42:58.342 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
39 Mon Dec 10 11:42:58.343 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
40 Mon Dec 10 11:42:58.344 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
41 Mon Dec 10 11:42:58.491 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
42 Mon Dec 10 11:42:58.493 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
43 Mon Dec 10 11:42:58.494 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
44 Mon Dec 10 11:42:58.640 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
45 Mon Dec 10 11:42:58.642 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
46 Mon Dec 10 11:42:58.642 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
47 Mon Dec 10 11:42:58.805 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
48 Mon Dec 10 11:42:58.806 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
49 Mon Dec 10 11:42:58.806 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
50 Mon Dec 10 11:42:58.958 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
51 Mon Dec 10 11:42:58.959 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
52 Mon Dec 10 11:42:58.960 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
53 Mon Dec 10 11:42:59.155 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
54 Mon Dec 10 11:42:59.157 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
55 Mon Dec 10 11:42:59.159 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
56 Mon Dec 10 11:42:59.352 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
57 Mon Dec 10 11:42:59.354 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
58 Mon Dec 10 11:42:59.354 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
59 Mon Dec 10 11:42:59.372 Driver Event: <airportd[160]> _bsd_80211_event_callback: APPLE80211_M_ROAM_END (en0)
60 Mon Dec 10 11:42:59.372 Info: <airportd[160]> Roaming ended on interface en0
61 Mon Dec 10 11:42:59.372 Driver Event: <airportd[160]> _bsd_80211_event_callback: RSN_HANDSHAKE_DONE (en0)
62 Mon Dec 10 11:42:59.373 Info: <airportd[160]> -[CWXPCInterfaceContext setRoamInProgress:reason:]_block_invoke: roam status metric data: CWAWDMetricRoamStatus: status:0 security: 4 profile:5 origin:<34fcb9>(-69) target:<6cf37f>(-56) latency:6.083439s
63 Mon Dec 10 11:42:59.373 Info: <airportd[160]> -[CWAWDManager submitMetric:]: submitting metric id 0x90046
64 Mon Dec 10 11:42:59.373 Info: <airportd[160]> RESUME AWDL for interface en0, reason=Roam token=2685
65 Mon Dec 10 11:42:59.373 Info: <airportd[160]> PRIORITY LOCK REMOVED [client=airportd, type=4, interface=en0, priority=5]
66 Mon Dec 10 11:42:59.374 Info: <airportd[160]> -[CWXPCInterfaceContext __setAWDLOperatingMode:interface:error:]: attempting to set AWDL mode to 0
67 Mon Dec 10 11:43:01.072 SC: <airportd[160]> airportdProcessSystemConfigurationEvent: Processing 'State:/Network/Service/18E14EA7-4641-4104-B315-A9315814912A/DHCP'
68 Mon Dec 10 11:43:01.072 SC: <airportd[160]> _processDHCPChanges: State:/Network/Service/18E14EA7-4641-4104-B315-A9315814912A/DHCP
69 Mon Dec 10 11:43:01.072 SC: <airportd[160]> _processDHCPChanges: DHCP airport_changed = 1
70 Mon Dec 10 11:43:01.073 Info: <airportd[160]> -[CWXPCSubsystem internal_submitIPConfigLatencyMetric:leaseDuration:]: IPConfig Latency metric data: CWAWDMetricIPConfigLatencyData: DHCP latency: 29010 msecs, duration: 480 mins, security: 4
71 Mon Dec 10 11:43:01.073 Info: <airportd[160]> -[CWAWDManager submitMetric:]: submitting metric id 0x90007
72 Mon Dec 10 11:43:01.073 SC: <airportd[160]> _setDHCPMessage: dhcpInfoKey "State:/Network/Interface/en0/AirPort/DHCP Message" = (null)
73 Mon Dec 10 11:43:10.369 Driver Event: <airportd[160]> _bsd_80211_event_callback: LINK_QUALITY (en0)
74 Mon Dec 10 11:43:10.369 Info: <airportd[160]> _bsd_80211_event_callback: <en0> link quality: RSSI=-57 dBm TxRate=162 Mbps
75 Mon Dec 10 11:43:10.369 Info: <Wi-Fi Menu Extra[335]> link quality changed
76 Mon Dec 10 11:43:23.376 Driver Event: <airportd[160]> _bsd_80211_event_callback: LINK_QUALITY (en0)
77 Mon Dec 10 11:43:23.377 Info: <airportd[160]> _bsd_80211_event_callback: <en0> link quality: RSSI=-58 dBm TxRate=243 Mbps
78 Mon Dec 10 11:43:23.377 Info: <Wi-Fi Menu Extra[335]> link quality changed
79 Mon Dec 10 11:43:28.380 Driver Event: <airportd[160]> _bsd_80211_event_callback: LINK_QUALITY (en0)
80 Mon Dec 10 11:43:28.380 Info: <airportd[160]> _bsd_80211_event_callback: <en0> link quality: RSSI=-58 dBm TxRate=216 Mbps
81 Mon Dec 10 11:43:28.380 Info: <Wi-Fi Menu Extra[335]> link quality changed
82 Mon Dec 10 11:43:31.744 AutoJoin: <airportd[160]> BACKGROUND SCAN request on interface en0 with SSID list (null)
83 Mon Dec 10 11:43:31.747 Scan: <airportd[160]> Cache-assisted scan request on channel 1 does not require a live scan
84 Mon Dec 10 11:43:31.748 Scan: <airportd[160]> Cache-assisted scan request on channel 2 does not require a live scan
85 Mon Dec 10 11:43:31.748 Scan: <airportd[160]> Cache-assisted scan request on channel 3 does not require a live scan
86 Mon Dec 10 11:43:31.748 Scan: <airportd[160]> Cache-assisted scan request does not require a live scan
87 Mon Dec 10 11:43:31.748 AutoJoin: <airportd[160]> Successful cache-assisted background scan request with channels {(
88 Mon Dec 10 11:43:31.748 <CWChannel: 0x7fc3fcd22180> [channelNumber=1(2GHz), channelWidth={20MHz}, active],
89 Mon Dec 10 11:43:31.748 <CWChannel: 0x7fc3fcd284a0> [channelNumber=2(2GHz), channelWidth={20MHz}, active],
90 Mon Dec 10 11:43:31.748 <CWChannel: 0x7fc3fcd13910> [channelNumber=3(2GHz), channelWidth={20MHz}, active]
{last_modified_time} test.log Page 3
91 Mon Dec 10 11:52:32.715 AutoJoin: <airportd[160]> Successful cache-assisted scan request for locationd with channels {(
92 Mon Dec 10 11:52:32.715 <CWChannel: 0x7fc3fcd12470> [channelNumber=7(2GHz), channelWidth={20MHz}, active],
93 Mon Dec 10 11:52:32.715 <CWChannel: 0x7fc3fcd15590> [channelNumber=8(2GHz), channelWidth={20MHz}, active],
94 Mon Dec 10 11:52:32.715 <CWChannel: 0x7fc3fcd091c0> [channelNumber=9(2GHz), channelWidth={20MHz}, active],
95 Mon Dec 10 11:52:32.715 <CWChannel: 0x7fc3fcd36ac0> [channelNumber=10(2GHz), channelWidth={20MHz}, active],
96 Mon Dec 10 11:52:32.715 <CWChannel: 0x7fc3fcd3b1b0> [channelNumber=11(2GHz), channelWidth={20MHz}, active],
97 Mon Dec 10 11:52:32.715 <CWChannel: 0x7fc3fcd37970> [channelNumber=12(2GHz), channelWidth={20MHz}, active]
98 Mon Dec 10 11:52:32.715 )} took 0.2636 seconds, returned 10 results
99 Mon Dec 10 11:52:32.994 Driver Event: <airportd[160]> _bsd_80211_event_callback: SCAN_CACHE_UPDATED (en0)
100 Mon Dec 10 11:52:32.997 Info: <airportd[160]> QUERY SCAN CACHE request received from pid 92 (locationd)
101 Mon Dec 10 11:52:32.998 AutoJoin: <airportd[160]> Successful cache-assisted scan request for locationd with channels {(
102 Mon Dec 10 11:52:32.998 <CWChannel: 0x7fc3fcd0a4d0> [channelNumber=13(2GHz), channelWidth={20MHz}, active],
103 Mon Dec 10 11:52:32.998 <CWChannel: 0x7fc3fcd37320> [channelNumber=36(5GHz), channelWidth={40MHz(+1)}, active],
104 Mon Dec 10 11:52:32.998 <CWChannel: 0x7fc3fcd0fb50> [channelNumber=40(5GHz), channelWidth={40MHz(-1)}, active],
105 Mon Dec 10 11:52:32.998 <CWChannel: 0x7fc3fcd17760> [channelNumber=44(5GHz), channelWidth={40MHz(+1)}, active],
106 Mon Dec 10 11:52:32.998 <CWChannel: 0x7fc3fcd48130> [channelNumber=48(5GHz), channelWidth={40MHz(-1)}, active],
107 Mon Dec 10 11:52:32.998 <CWChannel: 0x7fc3fcd147d0> [channelNumber=149(5GHz), channelWidth={20MHz}, active]
108 Mon Dec 10 11:52:32.998 )} took 0.2822 seconds, returned 14 results
109 Mon Dec 10 11:52:33.405 Driver Event: <airportd[160]> _bsd_80211_event_callback: SCAN_CACHE_UPDATED (en0)
110 Mon Dec 10 11:52:33.408 Info: <airportd[160]> QUERY SCAN CACHE request received from pid 92 (locationd)
111 Mon Dec 10 11:52:33.409 AutoJoin: <airportd[160]> Successful cache-assisted scan request for locationd with channels {(
112 Mon Dec 10 11:52:33.409 <CWChannel: 0x7fc3fcd1c0c0> [channelNumber=153(5GHz), channelWidth={40MHz(-1)}, active],
113 Mon Dec 10 11:52:33.409 <CWChannel: 0x7fc3fcd02590> [channelNumber=157(5GHz), channelWidth={20MHz}, active],
114 Mon Dec 10 11:52:33.409 <CWChannel: 0x7fc3fcd01390> [channelNumber=161(5GHz), channelWidth={40MHz(-1)}, active],
115 Mon Dec 10 11:52:33.409 <CWChannel: 0x7fc3fcd31d20> [channelNumber=165(5GHz), channelWidth={20MHz}, active],
116 Mon Dec 10 11:52:33.409 <CWChannel: 0x7fc3fcd27100> [channelNumber=52(5GHz), channelWidth={40MHz(+1)}, DFS],
117 Mon Dec 10 11:52:33.409 <CWChannel: 0x7fc3fcd17e60> [channelNumber=56(5GHz), channelWidth={40MHz(-1)}, DFS]
118 Mon Dec 10 11:52:33.409 )} took 0.4099 seconds, returned 11 results
119 Mon Dec 10 11:52:33.669 Driver Event: <airportd[160]> _bsd_80211_event_callback: SCAN_CACHE_UPDATED (en0)
120 Mon Dec 10 11:52:33.672 Info: <airportd[160]> QUERY SCAN CACHE request received from pid 92 (locationd)
121 Mon Dec 10 11:52:33.672 AutoJoin: <airportd[160]> Successful cache-assisted scan request for locationd with channels {(
122 Mon Dec 10 11:52:33.672 <CWChannel: 0x7fc3fcd02d10> [channelNumber=60(5GHz), channelWidth={40MHz(+1)}, DFS],
123 Mon Dec 10 11:52:33.672 <CWChannel: 0x7fc3fcd48ab0> [channelNumber=64(5GHz), channelWidth={40MHz(-1)}, DFS]
124 Mon Dec 10 11:52:33.672 )} took 0.2625 seconds, returned 8 results
125 Mon Dec 10 11:52:33.673 Info: <Wi-Fi Menu Extra[335]> scan cache updated
126 Mon Dec 10 11:52:33.693 Info: <airportd[160]> SCAN request received from pid 92 (locationd) with priority 2
127 Mon Dec 10 11:52:33.693 Scan: <airportd[160]> locationd requested a live scan less than 10 seconds after previous request (1.4991s) returning cached scan results
128 Mon Dec 10 11:52:33.728 Info: <airportd[160]> SCAN request received from pid 92 (locationd) with priority 2
129 Mon Dec 10 11:52:33.728 Scan: <airportd[160]> locationd requested a live scan less than 10 seconds after previous request (1.5339s) returning cached scan results
130 Mon Dec 10 11:55:47.609 Driver Discovery: <airportd[160]> _PMConnectionHandler: caps = CPU Net Disk
131 Mon Dec 10 11:55:47.609 Driver Discovery: <airportd[160]> _PMConnectionHandler: Being put into maintenance wake mode while fully awake.
132 Mon Dec 10 11:55:47.610 Info: <airportd[160]> psCallback: powerSource = AC Power
133 Mon Dec 10 11:55:47.610 Info: <airportd[160]> psCallback: set powersave disabled on en0
134 Mon Dec 10 11:55:47.637 Info: <airportd[160]> RELINQUISH BT PAGING LOCK request received from pid 106 (bluetoothd)
135 Mon Dec 10 11:55:47.637 Info: <airportd[160]> RELINQUISH BT PAGING LOCK request received from pid 106 (bluetoothd)
136 Mon Dec 10 11:55:47.638 BTC: <airportd[160]> BT PAGING state already set to 0
137 Mon Dec 10 11:55:47.638 BTC: <airportd[160]> BT PAGING state already set to 0
138 Mon Dec 10 11:55:47.638 Info: <airportd[160]> BT PAGING LOCK RELINQUISHED after 0.0 seconds
139 Mon Dec 10 11:55:47.638 Info: <airportd[160]> BT PAGING LOCK RELINQUISHED after 0.0 seconds
140 Mon Dec 10 11:55:47.638 Info: <airportd[160]> <en0> BT PAGING LOCK RELINQUISHED, re-enabling deferred WiFi requests
141 Mon Dec 10 11:55:47.638 Info: <airportd[160]> <en0> BT PAGING LOCK RELINQUISHED, re-enabling deferred WiFi requests
142 Mon Dec 10 11:55:48.093 IPC: <airportd[160]> ADDED XPC CLIENT CONNECTION [loginwindow (pid=101, euid=1651299376, egid=604256670)]
143 Mon Dec 10 11:55:48.093 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
144 Mon Dec 10 11:55:48.093 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
145 Mon Dec 10 11:55:48.094 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
146 Mon Dec 10 11:55:48.094 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
147 Mon Dec 10 11:55:48.094 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
148 Mon Dec 10 11:55:48.094 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
149 Mon Dec 10 11:55:48.094 Info: <airportd[160]> START MONITORING EVENT request received from pid 101 (loginwindow)
150 Mon Dec 10 11:55:48.104 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
151 Mon Dec 10 11:55:48.104 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
152 Mon Dec 10 11:55:48.104 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
153 Mon Dec 10 11:55:48.104 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
154 Mon Dec 10 11:55:48.104 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
155 Mon Dec 10 11:55:48.104 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
156 Mon Dec 10 11:55:48.105 Info: <airportd[160]> STOP MONITORING EVENT request received from pid 101 (loginwindow)
157 Mon Dec 10 11:56:07.629 Driver Discovery: <airportd[160]> _PMConnectionHandler: caps =
158 Mon Dec 10 11:56:07.629 AutoJoin: <airportd[160]> BEST CONNECTED SCAN CANCELLED on interface en0
159 Mon Dec 10 11:56:07.629 AutoJoin: <airportd[160]> BACKGROUND SCAN CANCELLED on interface en0
160 Mon Dec 10 11:56:07.629 AutoJoin: <airportd[160]> Auto-join retry cancelled on interface en0
161 Mon Dec 10 11:56:07.629 Offload: <airportd[160]> _tcpKeepAliveActive: TCP keep-alive is active.
162 Mon Dec 10 11:56:07.637 P2P: <airportd[160]> _changeInterfaceFlags: Marking p2p0 down
163 Mon Dec 10 11:56:07.637 Info: <airportd[160]> SleepAcknowledgementCheckForHostAP: Checking sleep readiness for HostAP
164 Mon Dec 10 11:56:07.637 <airportd[160]> SleepAcknowledgementCheck: Checking sleep readiness
165 Mon Dec 10 11:56:07.637 <airportd[160]> SleepAcknowledgementCheck: <p2p0> Delaying sleep acknowledgement because of VifUp
166 Mon Dec 10 11:56:07.638 <airportd[160]> _interfaceFlagsChanged: KEV_DL_SIFFLAGS received for p2p0 [flags=0xffff8802 (down)].
167 Mon Dec 10 11:56:07.638 <airportd[160]> _interfaceFlagsChanged: Flags changed for p2p0 (0xffff8843 -> 0xffff8802) (down).
168 Mon Dec 10 11:56:07.638 P2P: <airportd[160]> _deviceInterfaceMarkedDown: p2p0 marked down
169 Mon Dec 10 11:56:07.638 P2P: <airportd[160]> _removeTimeoutForActionAndParam: Attempting to remove 'Stop GO' action (param = 0x0)
170 Mon Dec 10 11:56:07.638 P2P: <airportd[160]> _removeTimeoutForActionAndParam: Attempting to remove 'Scan' action (param = 0x0)
171 Mon Dec 10 11:56:07.638 P2P: <airportd[160]> _p2pSupervisorEventRunLoopCallback: Mark down complete for p2p0
172 Mon Dec 10 11:56:07.638 <airportd[160]> SleepAcknowledgementCheck: Checking sleep readiness
173 Mon Dec 10 11:56:07.638 WoW: <airportd[160]> SleepAcknowledgementCheck: <en0> Checking if auto-join is in progress before sleep acknowledgement
174 Mon Dec 10 11:56:07.638 WoW: <airportd[160]> SleepAcknowledgementDelayForAutoJoinAttempt_block_invoke: AUTO-JOIN attempt complete for en0, re-checking sleep readiness
175 Mon Dec 10 11:56:07.638 <airportd[160]> SleepAcknowledgementCheck: Checking sleep readiness
176 Mon Dec 10 11:56:07.639 WoW: <airportd[160]> _wowEnabled: WoW is active on en0
177 Mon Dec 10 11:56:07.639 WoW: <airportd[160]> wowExchangeRequiredForNode: WoW exchange not required for en0
178 Mon Dec 10 11:56:07.639 <airportd[160]> _acknowledgeSleepEvent: Acknowledging sleep event
179 Mon Dec 10 11:56:07.639 Info: <airportd[160]> PRIORITY LOCK ADDED [client=airportd, type=4, interface=(null), priority=7]
180 Mon Dec 10 11:56:07.640 AutoJoin: <airportd[160]> Auto-join retry cancelled on interface en0

View file

@ -0,0 +1,10 @@
1 ntation processAirPortStateChanges]: pppConnectionState 0
2 Mon Dec 10 11:42:56.558 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
3 Mon Dec 10 11:42:56.705 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
4 Mon Dec 10 11:42:56.706 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
5 Mon Dec 10 11:42:56.706 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
6 Mon Dec 10 11:42:57.003 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
7 Mon Dec 10 11:42:57.152 Info: <Wi-Fi Menu Extra[335]> 802.1X changed
8 Mon Dec 10 11:42:57.154 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: pppConnectionState 0
9 Mon Dec 10 11:42:57.154 Info: <Wi-Fi Menu Extra[335]> -[AirPortExtraImplementation processAirPortStateChanges]: old state=4 bars, new state=4 bars
10 Mon Dec 10 11:42:57.302 Info: <Wi-Fi Menu Extra[335]> 802.1X changed

View file

@ -182,7 +182,7 @@ fn test_with_number_option_with_custom_separator_char_and_width() {
}
#[test]
fn test_valid_page_ranges() {
fn test_with_valid_page_ranges() {
let test_file_path = "test_num_page.log";
let mut scenario = new_ucmd!();
scenario
@ -211,11 +211,10 @@ fn test_valid_page_ranges() {
.fails()
.stderr_is("pr: invalid --pages argument '5:1'")
.stdout_is("");
}
#[test]
fn test_page_range() {
fn test_with_page_range() {
let test_file_path = "test.log";
let expected_test_file_path = "test_page_range_1.log.expected";
let expected_test_file_path1 = "test_page_range_2.log.expected";
@ -234,3 +233,45 @@ fn test_page_range() {
(&"{last_modified_time}".to_string(), &value),
]);
}
#[test]
fn test_with_no_header_trailer_option() {
let test_file_path = "test_one_page.log";
let expected_test_file_path = "test_one_page_no_ht.log.expected";
let mut scenario = new_ucmd!();
scenario
.args(&["-t", test_file_path])
.succeeds()
.stdout_is_fixture(expected_test_file_path);
}
#[test]
fn test_with_page_length_option() {
let test_file_path = "test.log";
let expected_test_file_path = "test_page_length.log.expected";
let expected_test_file_path1 = "test_page_length1.log.expected";
let mut scenario = new_ucmd!();
let value = file_last_modified_time(&scenario, test_file_path);
scenario
.args(&["--pages=2:3", "-l", "100", "-n", test_file_path])
.succeeds()
.stdout_is_templated_fixture(expected_test_file_path, vec![
(&"{last_modified_time}".to_string(), &value),
]);
new_ucmd!()
.args(&["--pages=2:3", "-l", "5", "-n", test_file_path])
.succeeds()
.stdout_is_fixture(expected_test_file_path1);
}
#[test]
fn test_with_suppress_error_option() {
let test_file_path = "test_num_page.log";
let mut scenario = new_ucmd!();
scenario
.args(&["--pages=20:5", "-r", test_file_path])
.fails()
.stderr_is("")
.stdout_is("");
}