]> granicus.if.org Git - procps-ng/blobdiff - testsuite/w.test/w.exp
w: add --pids option to display the pid of the login and best processes.
[procps-ng] / testsuite / w.test / w.exp
index 5f1064d78f004d9d806c2f94f8685b6110e10e44..f0da8034a9392aca26361d473a162401835efbd7 100644 (file)
@@ -17,10 +17,12 @@ set w_login "\(\\d+\[A-Z\]\[a-z\]{2}\\d+\|\[A-Z\]\[a-z\]{2}\\d+\|\\d+:\\d+\)"
 set w_idle  "\(\\?xdm\\?\|\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
 set w_ival7  "\(\\?\|\\d+days\|\\d+:\\d+m?\|\\d+.\\d+s\)"
 set w_what  "\[A-Za-z0-9_\/\\-\]+"
+set w_pids  "\\d+/\\d+"
 set w_std_userlines "\(${w_user}\\s+${w_tty}\\s+${w_login}\\s+${w_idle}\\s+${w_ival7}\\s+${w_ival7}\\s+${w_what}\\s*\)*"
 set w_short_userlines "\(${w_user}\\s+${w_tty}\\s+${w_idle}\\s+${w_what}\\s*\)*"
 set w_from_userlines "\(${w_user}\\s+${w_tty}\\s+${w_from}\\s+${w_login}\\s+${w_idle}\\s+${w_ival7}\\s+${w_ival7}\\s+${w_what}\\s*\)*"
 set w_fromshort_userlines "\(${w_user}\\s+${w_tty}\\s+${w_from}\\s+${w_idle}\\s+${w_what}\\s*\)*"
+set w_pid_userlines "\(${w_user}\\s+${w_tty}\\s+${w_idle}\\s+%{w_pids}\s+${w_what}\\s*\)*"
 
 set test "w with no arguments"
 spawn $w
@@ -51,3 +53,7 @@ set test "w with short and from flags"
 spawn $w -sf
 expect_pass "$test" "^${w_fromshort_header}${w_fromshort_userlines}"
 
+set test "w with pids display"
+spawn $w -p
+expect_pass "$test" "^${w_std_header}${w_pid_userlines}"
+