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"}
  }