From: Christian Heller Date: Wed, 8 Oct 2025 18:26:19 +0000 (+0200) Subject: Have dedicated test script for ERROR handling. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bprefix%7D%7D/do_day?a=commitdiff_plain;p=ircplom Have dedicated test script for ERROR handling. --- diff --git a/src/tests/_timeout_retries.test b/src/tests/_timeout_retries.test index 767029a..c2ceebf 100644 --- a/src/tests/_timeout_retries.test +++ b/src/tests/_timeout_retries.test @@ -63,19 +63,6 @@ repeat isupport-clear-in isupport-clear-out , ..$ DISCONNECTED 1 .!$ will retry connecting in 1 seconds repeat conn-full-in conn-full-out -:0:1 ..< ERROR :Closing link: (Connection timed out) -1 ..$ connection_state set to: [Closing link: (Connection timed out)] -1 ..$ isupport cleared -1 ..$ isupport:CHANTYPES set to: [#&] -1 ..$ isupport:PREFIX set to: [(ov)@+] -1 ..$ isupport:USERLEN set to: [10] -1 ..$ connection_state set to: [] -wait 1 -, ..$ DISCONNECTED -1 .!$ will retry connecting in 1 seconds -repeat conn-full-in conn-full-out - -# test retry chain started by "timed out)" ERROR # on second server, check timed auto-retries don't activate after manual intervention > /connect baz.bar.foo:10003 foo:bar baz:foobarbazquux diff --git a/src/tests/error_disconnects.test b/src/tests/error_disconnects.test new file mode 100644 index 0000000..613b57d --- /dev/null +++ b/src/tests/error_disconnects.test @@ -0,0 +1,50 @@ +# to prepare first test, initiate connected state +> /connect foo.bar.baz foo bar:baz +| isupport-clear-in +1 ..$ isupport cleared +1 ..$ isupport:CHANTYPES set to: [#&] +1 ..$ isupport:PREFIX set to: [(ov)@+] +1 ..$ isupport:USERLEN set to: [10] +| isupport-clear-out +1 ..$ caps cleared +1 ..$ users cleared +1 ..$ channels cleared +, ..$ DISCONNECTED +1 ..$ hostname set to: [foo.bar.baz] +1 ..$ port set to: [-1] +1 ..$ nick_wanted set to: [foo] +1 ..$ user_wanted set to: [baz] +1 ..$ realname set to: [bar] +1 ..$ port set to: [6697] +| connecting-in +1 ..$ connection_state set to: [connecting] +1 ..$ connection_state set to: [connected] +, ..$ CONNECTED +1 ..> CAP LS :302 +1 ..> USER baz 0 * :bar +1 ..> NICK :foo +| connecting-out + +# test default ERROR handling +:0:1 ..< ERROR :abc def ghi +1 ..$ connection_state set to: [abc def ghi] +| disconnecting-in +repeat isupport-clear-in isupport-clear-out +1 ..$ connection_state set to: [] +, ..$ DISCONNECTED +| disconnecting-out + +# to prepare next test, get back to connected state +> /window 1 +> /reconnect +repeat connecting-in connecting-out + +# test "timed out)" ERROR handling +:0:1 ..< ERROR :Closing link: (Connection timed out) +1 ..$ connection_state set to: [Closing link: (Connection timed out)] +repeat disconnecting-in disconnecting-out +1 .!$ will retry connecting in 1 seconds + +# over and out +> /quit +0 ..<