invite-test.e 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. spawn telnet localhost 6789
  2. expect {
  3. timeout { exit 1 }
  4. "Connected"
  5. }
  6. send "nick nick\r"
  7. send "user user . . :User\r"
  8. expect {
  9. timeout { exit 1 }
  10. "376"
  11. }
  12. send "invite\r"
  13. expect {
  14. timeout { exit 1 }
  15. "461"
  16. }
  17. send "invite nick\r"
  18. expect {
  19. timeout { exit 1 }
  20. "461"
  21. }
  22. send "invite nick #channel\r"
  23. expect {
  24. timeout { exit 1 }
  25. -re "INVITE nick :?#channel"
  26. }
  27. expect {
  28. timeout { exit 1 }
  29. -re "341 nick nick :?#channel"
  30. }
  31. send "invite nosuchnic #TopicChannel\r"
  32. expect {
  33. timeout { exit 1 }
  34. "401 nick nosuchnic :No such nick or channel name"
  35. }
  36. send "invite nick #TopicChannel\r"
  37. expect {
  38. timeout { exit 1 }
  39. "442 nick #TopicChannel :You are not on that channel"
  40. }
  41. send "join #channel\r"
  42. expect {
  43. timeout { exit 1 }
  44. -re "JOIN :?#channel"
  45. }
  46. send "invite nick #channel\r"
  47. expect {
  48. timeout { exit 1 }
  49. "443 nick nick #channel :is already on channel"
  50. }
  51. send "mode #channel +i\r"
  52. expect {
  53. timeout { exit 1 }
  54. "MODE #channel +i"
  55. }
  56. send "mode #channel -o nick\r"
  57. expect {
  58. timeout { exit 1 }
  59. "MODE #channel -o nick"
  60. }
  61. send "invite nick #channel\r"
  62. expect {
  63. timeout { exit 1 }
  64. "482 nick #channel :You are not channel operator"
  65. #it would be reasonable to expect 443 here instead
  66. }
  67. send "part #channel\r"
  68. expect {
  69. timeout { exit 1}
  70. -re "PART #channel :?nick"
  71. }
  72. send "invite nick :parameter with spaces\r"
  73. expect {
  74. timeout { exit 1 }
  75. "INVITE nick :parameter with spaces"
  76. }
  77. expect {
  78. timeout { exit 1 }
  79. "341 nick nick :parameter with spaces"
  80. }
  81. send "away message\r"
  82. expect {
  83. timeout { exit 1 }
  84. "306 nick :You have been marked as being away"
  85. }
  86. send "INVITE nick #channel\r"
  87. expect {
  88. timeout { exit 1 }
  89. -re "301 nick nick :?message"
  90. }
  91. send "quit\r"
  92. expect {
  93. timeout { exit 1 }
  94. "Connection closed"
  95. }
  96. # -eof-