21 lines
517 B
Plaintext
21 lines
517 B
Plaintext
|
|
set pwdx "${topdir}pwdx"
|
|
# Run pwdx with no arguments
|
|
set test "pwdx no args"
|
|
spawn $pwdx
|
|
expect_pass "$test" "^\\s*Usage:\\s+\(lt-\)\?pwdx \\\[options\\\] pid\.\.\."
|
|
|
|
# Run pwdx with pid 0 which is invalid
|
|
set test "pwdx pid 0 should be invalid"
|
|
spawn $pwdx 0
|
|
expect_pass "$test" "^0: No such process"
|
|
|
|
# Run pwdx with existing pid
|
|
set test "pwdx finds sleep in cwd"
|
|
set sleep_pid [ exec sleep 600 & ]
|
|
set sleep_pwd [ pwd ]
|
|
spawn $pwdx $sleep_pid
|
|
expect_pass "$test" "^$sleep_pid: $sleep_pwd"
|
|
exec kill $sleep_pid
|
|
|