-spawn telnet localhost 6789
+# ngIRCd test suite
+# PRIVMSG and NOTICE test
+
+spawn telnet 127.0.0.1 6789
expect {
timeout { exit 1 }
"Connected"
"@* PRIVMSG nick :test"
}
-# The following two tests using "localhost" as host name
-# had to be disabled, because there are operating systems
-# out there, that use "localhost.<domain>" as host name
-# for 127.0.0.1 instead of just "localhost".
-# (for example OpenBSD 4, OpenSolaris, ...)
-#
-#send "privmsg ~user\%localhost :test\r"
-#expect {
-# timeout { exit 1 }
-# "@* PRIVMSG nick :test"
-#}
-#
-#send "privmsg Nick!~User@LocalHost :test\r"
-#expect {
-# timeout { exit 1 }
-# "@* PRIVMSG nick :test"
-# "401"
-#}
+send "mode nick +b\r"
+expect {
+ timeout { exit 1 }
+ "MODE nick :+b"
+}
+send "privmsg nick :test\r"
+expect {
+ timeout { exit 1 }
+ "486"
+}
+send "mode nick -b\r"
+expect {
+ timeout { exit 1 }
+ "MODE nick :-b"
+}
+
+send "privmsg ~user\%127.0.0.1 :test\r"
+expect {
+ timeout { exit 1 }
+ "@* PRIVMSG nick :test"
+}
+
+send "privmsg Nick!~User@127.0.0.1 :test\r"
+expect {
+ timeout { exit 1 }
+ "@* PRIVMSG nick :test"
+}
send "away :away\r"
expect {
"401"
}
-#cannot test host mask since localhost has no '.' as RFC requires
-
send "quit\r"
expect {
timeout { exit 1 }
"Connection closed"
}
-
-# -eof-