| Don Libes 2004-03-29, 6:51 pm |
| mdunford@quarrytech.com (Martin) writes:
> expect_before {
> -i $id -re $easyToMatch {
> puts " AS EXPECTED "
> }
> }
> can easily be switched-off/negated/reversed by doing ...
>
> expect_before -i $id
>
> However, if any_spawn_id is used
>
> expect_before {
> -i $any_spawn_id -re $easyToMatch {
> puts " AS EXPECTED "
> }
> then
>
> expect_before -i $any_spawn_id
>
> has no effect! (surely it should behave consistently here?)
>
> I am debugging a test environemnt that is primed using
> expect_before in various different places and need to somehow
> switch these off. I cannot figure out how to do it
> once any_spawn_id creeps in to the equation...
> Any help much appreaciated!! thanks
>
> Martin.
Works fine for me. Here's the script I tried followed by output I
got:
############################## Here's the script:
spawn telnet
exp_internal 1
expect_before {
-i $any_spawn_id junk {
puts " AS EXPECTED "
}
}
set timeout 2
expect before
expect_before -i $any_spawn_id
expect after
############################## Here's the output:
% expect /tmp/foo
spawn telnet
expect: does "" (spawn_id exp4) match glob pattern "junk"? no
"before"? no
telnet>
expect: does "telnet> " (spawn_id exp4) match glob pattern "junk"? no
"before"? no
expect: timed out
expect: does "telnet> " (spawn_id exp4) match glob pattern "after"? no
expect: timed out
%
|