25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.7 KiB

  1. #!/usr/bin/expect
  2. set SUGAR_EXECUTABLE $::env(SUGAR_EXECUTABLE)
  3. proc abort {reason} {
  4. puts "test failed $reason"
  5. exit 1
  6. }
  7. ### ------------------------------------------------------------------
  8. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-01.mol lex parse
  9. expect {
  10. eof { abort "should display failure in incomplete-01" }
  11. Procedure-Name
  12. }
  13. expect eof
  14. ### ------------------------------------------------------------------
  15. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-02.mol lex parse
  16. expect {
  17. eof { abort "should display failure in incomplete-02" }
  18. __--__
  19. }
  20. expect {
  21. eof { abort "should display failure procedure" }
  22. main
  23. }
  24. expect eof
  25. ### ------------------------------------------------------------------
  26. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-03.mol lex parse
  27. expect {
  28. eof { abort "should display failure in incomplete-03" }
  29. {Expected Procedure-Argument-List to end}
  30. }
  31. expect {
  32. eof { abort "should display failure line" }
  33. {incomplete-03.mol:2}
  34. }
  35. expect eof
  36. ### ------------------------------------------------------------------
  37. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-04.mol lex parse
  38. expect {
  39. eof { abort "should display failure in incomplete-04" }
  40. {Expected Procedure-Argument-List to be followed by a return list or a __DO__}
  41. }
  42. expect {
  43. eof { abort "should display failure line" }
  44. {incomplete-04.mol:3}
  45. }
  46. expect eof
  47. ### ------------------------------------------------------------------
  48. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-05.mol lex parse
  49. expect {
  50. eof { abort "should display failure in incomplete-05" }
  51. {Expected Procedure-Return-List to end}
  52. }
  53. expect {
  54. eof { abort "should display failure line" }
  55. {incomplete-05.mol:4}
  56. }
  57. expect eof
  58. ### ------------------------------------------------------------------
  59. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-06.mol lex parse
  60. expect {
  61. eof { abort "should display failure in incomplete-06" }
  62. {Expected __DO__ block needs a matching __END__}
  63. }
  64. expect {
  65. eof { abort "should display failure line" }
  66. {incomplete-06.mol:5}
  67. }
  68. expect eof
  69. ### ------------------------------------------------------------------
  70. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-07.mol lex parse
  71. expect {
  72. eof { abort "should display failure line" }
  73. {incomplete-07.mol:1}
  74. }
  75. expect {
  76. eof { abort "should display failure in incomplete-07" }
  77. {Expected __PROC__}
  78. }
  79. expect eof
  80. ### ------------------------------------------------------------------
  81. spawn -noecho $SUGAR_EXECUTABLE tests/004/incomplete-08.mol lex parse
  82. expect {
  83. eof { abort "should display failure in incomplete-08" }
  84. {return stack}
  85. }
  86. expect eof