/[dejagnu]/dejagnu/example/calc/testsuite/calc.test/calc.exp
ViewVC logotype

Diff of /dejagnu/example/calc/testsuite/calc.test/calc.exp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by bje, Sun Aug 17 23:00:08 2003 UTC revision 1.4 by bje, Tue Aug 19 00:11:43 2003 UTC
# Line 27  set timeout 3 Line 27  set timeout 3
27  # ever be triggered.  # ever be triggered.
28  #  #
29  expect_after {  expect_after {
30          -re "\[^\n\r\]*$prompt$" {      -re "\[^\n\r\]*$prompt$" {
31                  fail "$test (bad match)"          fail "$test (bad match)"
32                  if { $verbose > 0 } {          if { $verbose > 0 } {
33                          regexp ".*\r\n(\[^\r\n\]+)(\[\r\n\])+$prompt$" \              regexp ".*\r\n(\[^\r\n\]+)(\[\r\n\])+$prompt$" \
34                                                  $expect_out(buffer) "" output                  $expect_out(buffer) "" output
35                          send_user "\tUnmatched output: \"$output\"\n"              send_user "\tUnmatched output: \"$output\"\n"
                 }  
         }  
         timeout {  
                 fail "$test (timeout)"  
36          }          }
37        }
38        timeout {
39            fail "$test (timeout)"
40        }
41  }  }
42  #  #
43  # Here are the tests  # Here are the tests
# Line 45  expect_after { Line 45  expect_after {
45  set test "version"  set test "version"
46  send "version\n"  send "version\n"
47  expect {  expect {
48          -re "Version:.*$prompt$"        { pass "version" }      -re "Version:.*$prompt$"    { pass "version" }
49  }  }
50    
51  set test add1  set test add1
52  send "add 3 4\n"  send "add 3 4\n"
53  expect {  expect {
54          -re "7+.*$prompt$"              { pass "$test" }      -re "7+.*$prompt$"          { pass "$test" }
55  }  }
56    
57  set test add2  set test add2
58  send "add 1 2 3\n"  send "add 1 2 3\n"
59  expect {  expect {
60          -re "Usage: add #1 #2.*$prompt$" { pass "$test" }      -re "Usage: add #1 #2.*$prompt$" { pass "$test" }
61  }  }
62    
63  set test multiply1  set test multiply1
64  send "multiply 3 4\n"  send "multiply 3 4\n"
65  expect {  expect {
66          -re "12.*$prompt$"              { pass "$test" }      -re "12.*$prompt$"          { pass "$test" }
67  }  }
68    
69  set test multiply2  set test multiply2
70  send "multiply 2 4\n"  send "multiply 2 4\n"
71  expect {  expect {
72          -re "8.*$prompt$"               { pass "$test" }      -re "8.*$prompt$"           { pass "$test" }
73  }  }
74    
75  set test multiply3  set test multiply3
76  send "multiply 1 2 3\n"  send "multiply 1 2 3\n"
77  expect {  expect {
78          -re "Usage: multiply #1 #2.*$prompt$" { pass "$test" }      -re "Usage: multiply #1 #2.*$prompt$" { pass "$test" }
79  }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26