I am trying to use expect_send, but it's hunging and I get:
ok 4 - expect_run
Expect::Simple: couldn't find prompt after send
at /home/hgreen/test/Test-Expect-0.29/lib/Test/Expect.pm line 72
# Looks like your test died just after 4.
I am trying to use a silly program:
#!/bin/ksh
read -r var1?"Enter foo "
echo $var1
In my test program I ahve included:
use Test::More tests => 5;
use Test::Cmd;
use Test::Harness;
use Test::Expect;
use Expect::Simple;
use Expect;
And the invokation looks like:
expect_run(
command => "/bbcm/devtools/tools/autoplink/tst",
prompt => 'Enter foo ',
quit => 'quit',
);
expect('foo', 'foo', "expect");
expect_send('foo', "expect_send1");
Can someone tells me what am I doing wrong?
Edit g0n - added code tags
Edit g0n - retitled from "Test::Expect"
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.