channel-test.e 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # ngIRCd test suite
  2. # Channel 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 "join #channel\r"
  15. expect {
  16. timeout { exit 1 }
  17. "@* JOIN :#channel"
  18. }
  19. expect {
  20. timeout { exit 1 }
  21. "366"
  22. }
  23. send "topic #channel :Test-Topic\r"
  24. expect {
  25. timeout { exit 1 }
  26. "@* TOPIC #channel :Test-Topic"
  27. }
  28. send "who #channel\r"
  29. expect {
  30. timeout { exit 1 }
  31. "352 nick #channel"
  32. }
  33. expect {
  34. timeout { exit 1 }
  35. "* nick H@ :0 User"
  36. }
  37. expect {
  38. timeout { exit 1 }
  39. "315 nick #channel"
  40. }
  41. send "names #channel\r"
  42. expect {
  43. timeout { exit 1 }
  44. "353 nick = #channel :@nick"
  45. }
  46. expect {
  47. timeout { exit 1 }
  48. "366 nick #channel"
  49. }
  50. send "list\r"
  51. expect {
  52. timeout { exit 1 }
  53. "322 nick #channel 1 :Test-Topic"
  54. }
  55. expect {
  56. timeout { exit 1 }
  57. "323 nick :End of LIST"
  58. }
  59. send "part #channel :bye bye\r"
  60. expect {
  61. timeout { exit 1 }
  62. "@* PART #channel :bye bye"
  63. }
  64. send "join #channel\r"
  65. expect {
  66. timeout { exit 1 }
  67. "@* JOIN :#channel"
  68. }
  69. expect {
  70. timeout { exit 1 }
  71. "366"
  72. }
  73. send "join #channel2\r"
  74. expect {
  75. timeout { exit 1 }
  76. "@* JOIN :#channel2"
  77. }
  78. expect {
  79. timeout { exit 1 }
  80. "366"
  81. }
  82. send "join 0\r"
  83. expect {
  84. timeout { exit 1 }
  85. "@* PART #channel2 :"
  86. }
  87. expect {
  88. timeout { exit 1 }
  89. "@* PART #channel :"
  90. }
  91. send "quit\r"
  92. expect {
  93. timeout { exit 1 }
  94. "Connection closed"
  95. }