You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

104 lines
2.7 KiB

#!/usr/bin/expect
set SUGAR_EXECUTABLE $::env(SUGAR_EXECUTABLE)
proc abort {reason} {
puts "test failed $reason"
exit 1
}
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-01.mol lex parse
expect {
eof { abort "should display failure in incomplete-01" }
Procedure-Name
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-02.mol lex parse
expect {
eof { abort "should display failure in incomplete-02" }
__--__
}
expect {
eof { abort "should display failure procedure" }
main
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-03.mol lex parse
expect {
eof { abort "should display failure in incomplete-03" }
{Expected Procedure-Argument-List to end}
}
expect {
eof { abort "should display failure line" }
{incomplete-03.mol:2}
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-04.mol lex parse
expect {
eof { abort "should display failure in incomplete-04" }
{Expected Procedure-Argument-List to be followed by a return list or a __DO__}
}
expect {
eof { abort "should display failure line" }
{incomplete-04.mol:3}
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-05.mol lex parse
expect {
eof { abort "should display failure in incomplete-05" }
{Expected Procedure-Return-List to end}
}
expect {
eof { abort "should display failure line" }
{incomplete-05.mol:4}
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-06.mol lex parse
expect {
eof { abort "should display failure in incomplete-06" }
{Expected __DO__ block needs a matching __END__}
}
expect {
eof { abort "should display failure line" }
{incomplete-06.mol:5}
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-07.mol lex parse
expect {
eof { abort "should display failure line" }
{incomplete-07.mol:1}
}
expect {
eof { abort "should display failure in incomplete-07" }
{Expected __PROC__}
}
expect eof
### ------------------------------------------------------------------
spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-08.mol lex parse
expect {
eof { abort "should display failure in incomplete-08" }
{return stack}
}
expect eof