1# ngIRCd test suite 2# PRIVMSG and NOTICE test 3 4spawn telnet 127.0.0.1 6789 5expect { 6 timeout { exit 1 } 7 "Connected" 8} 9 10send "nick nick\r" 11send "user user . . :User\r" 12expect { 13 timeout { exit 1 } 14 "376" 15} 16 17send "privmsg nick :test\r" 18expect { 19 timeout { exit 1 } 20 "@* PRIVMSG nick :test" 21} 22 23send "privmsg nick\r" 24expect { 25 timeout { exit 1 } 26 "412" 27} 28 29send "privmsg\r" 30expect { 31 timeout { exit 1 } 32 "411" 33} 34 35send "privmsg nick,nick :test\r" 36expect { 37 timeout { exit 1 } 38 "@* PRIVMSG nick :test" 39} 40 41send "privmsg ,,,, :dummy\r" 42send "privmsg ,,,nick,,&server,,, :test\r" 43expect { 44 timeout { exit 1 } 45 "@* PRIVMSG nick :test" 46} 47expect { 48 timeout { exit 1 } 49 "404" 50} 51 52send "privmsg Nick,#testChannel,nick :test\r" 53expect { 54 timeout { exit 1 } 55 "@* PRIVMSG nick :test\r*401" 56} 57 58send "privmsg doesnotexist :test\r" 59expect { 60 timeout { exit 1 } 61 "401" 62} 63 64send "privmsg ~UsEr@ngIRCd.Test.Server :test\r" 65expect { 66 timeout { exit 1 } 67 "@* PRIVMSG nick :test" 68} 69 70send "mode nick +b\r" 71expect { 72 timeout { exit 1 } 73 "MODE nick :+b" 74} 75send "privmsg nick :test\r" 76expect { 77 timeout { exit 1 } 78 "486" 79} 80send "mode nick -b\r" 81expect { 82 timeout { exit 1 } 83 "MODE nick :-b" 84} 85 86send "privmsg ~user\%127.0.0.1 :test\r" 87expect { 88 timeout { exit 1 } 89 "@* PRIVMSG nick :test" 90} 91 92send "privmsg Nick!~User@127.0.0.1 :test\r" 93expect { 94 timeout { exit 1 } 95 "@* PRIVMSG nick :test" 96} 97 98send "away :away\r" 99expect { 100 timeout { exit 1 } 101 "306" 102} 103 104send "privmsg nick :test\r" 105expect { 106 timeout { exit 1 } 107 "301" 108} 109 110send "away\r" 111expect { 112 timeout { exit 1 } 113 "305" 114} 115 116send "privmsg \$ngircd.test.server :test\r" 117expect { 118 timeout { exit 1 } 119 "481" 120} 121 122send "privmsg #*.de :test\r" 123expect { 124 timeout { exit 1 } 125 "481" 126} 127 128send "oper TestOp 123\r" 129 130send "privmsg \$ngircd.test.server :test\r" 131expect { 132 timeout { exit 1 } 133 "@* PRIVMSG nick :test" 134} 135 136send "privmsg \$*.test*.server :test\r" 137expect { 138 timeout { exit 1 } 139 "@* PRIVMSG nick :test" 140} 141 142send "privmsg \$noDotServer :test\r" 143expect { 144 timeout { exit 1 } 145 "401" 146} 147 148send "quit\r" 149expect { 150 timeout { exit 1 } 151 "Connection closed" 152} 153