invite-test.e 1.7 KB

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