Differences between revisions 3 and 4
Revision 3 as of 2004-05-28 08:56:04
Size: 341
Editor: anonymous
Comment:
Revision 4 as of 2004-05-28 09:48:08
Size: 364
Editor: anonymous
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:

set test "file compare"
spawn "/bin/bash"
send "diff -s exp.dat res.dat\r"
expect "diff -sq exp.dat res.dat\r\n"
expect {{{{
  -re "Files .* identical." {pass "$test"}
{{{
  set test "file compare"
  spawn "/bin/bash"
  send "diff -s expect.dat result.dat\r"
  expect "diff -sq expect.dat result.dat\r\n"
  expect {
    -re "Files .* identical." {pass "$test"}
Line 14: Line 14:
  }
Line 15: Line 16:
}

Page for test examples.

Simple file compare:

  set test "file compare"
  spawn "/bin/bash"
  send "diff -s expect.dat result.dat\r"
  expect "diff -sq expect.dat result.dat\r\n"
  expect {
    -re "Files .* identical." {pass "$test"}
    -re "Files .* differ" {fail "$test"}
     default {fail "$test"}
  }