From: Christian Heller <c.heller@plomlompom.de> Date: Thu, 18 Sep 2025 10:23:17 +0000 (+0200) Subject: To testing, add block repetition directive. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/static/day?a=commitdiff_plain;ds=inline;p=ircplom To testing, add block repetition directive. --- diff --git a/ircplom/testing.py b/ircplom/testing.py index 2249186..497eab1 100644 --- a/ircplom/testing.py +++ b/ircplom/testing.py @@ -128,6 +128,12 @@ class TestingClientTui(ClientTui): if line[:1] == '#' or not line.strip(): continue context, msg = line.split(' ', maxsplit=1) + if context == 'repeat': + start, end = msg.split(':') + self._playbook = (self._playbook[:self._playbook_idx + 1] + + self._playbook[int(start):int(end)] + + self._playbook[self._playbook_idx + 1:]) + continue if context == '>': for c in msg: self._q_keypresses.put(c) diff --git a/test.txt b/test.txt index 15dcca4..1d352a1 100644 --- a/test.txt +++ b/test.txt @@ -264,89 +264,12 @@ 1,2 $ channels cleared 1,2 $ users cleared +# check that (save TUI tests assuming start on window 0, and no 4 yet) on reconnect, all the same effects can be expected > /reconnect 1,2,3,4 $ connection_state set to: [connecting] 1,2,3,4 $ connection_state set to: [connected] -2 > CAP LS :302 -2 > USER foobarbazquux 0 * :baz -2 > NICK :foo -2 < :*.?.net NOTICE * :*** Looking up your ident... -1,2 $$$ *** Looking up your ident... -2 < :*.?.net NOTICE * :*** Looking up your hostname... -1,2 $$$ *** Looking up your hostname... -2 < :*.?.net NOTICE * :*** Found your hostname (baz.bar.foo) -1,2 $$$ *** Found your hostname (baz.bar.foo) -2 < PING :? -2 > PONG :? -2 < :*.?.net CAP * LS : foo bar sasl=PLAIN,EXTERNAL baz -2 > CAP REQ :sasl -2 > CAP :LIST -2 < :*.?.net CAP ? ACK :sasl -2 < :*.?.net CAP ? LIST :cap-notify sasl -1,2 $ caps:bar:data set to: [] -1,2 $ caps:baz:data set to: [] -1,2 $ caps:foo:data set to: [] -1,2 $ caps:sasl:data set to: [] -1,2 $ caps:sasl:data set to: [PLAIN,EXTERNAL] -1,2 $ caps:sasl:enabled set to: [True] -1,2 $ sasl_auth_state set to: [attempting] -2 > AUTHENTICATE :PLAIN -2 < AUTHENTICATE + -2 > AUTHENTICATE :Zm9vAGZvbwBiYXI= -2 < :foo.bar.baz 900 foo foo!foobarbazq@baz.bar.foo foo :You are now logged in as foo -1,2 $ users:me:nick set to: [?] -1,2 $ users:me:nick set to: [foo] -1,2 $ users:me:user set to: [foobarbazq] -1,2 $ users:me:host set to: [baz.bar.foo] -1,2 $ sasl_account set to: [foo] -2 < :foo.bar.baz 903 foo :SASL authentication successful -1,2 $ sasl_auth_state set to: [SASL authentication successful] -2 > CAP :END -2 < :foo.bar.baz 001 foo :Welcome to the foo.bar.baz network -2 < :foo.bar.baz 002 foo :Your host is foo.bar.baz -2 < :foo.bar.baz 003 foo :This server was created Jan 1 2020 -2 < :foo.bar.baz 004 foo foo.bar.baz ircserver-1.0 abc def ghi -2 < :foo.bar.baz 005 foo ABC=DEF GHI=JKL :are supported by this server -1,2 $ isupport:ABC set to: [DEF] -1,2 $ isupport:GHI set to: [JKL] -2 < :foo.bar.baz 005 foo MNO=PQR STU=VWX Y=Z :are supported by this server -1,2 $ isupport:MNO set to: [PQR] -1,2 $ isupport:STU set to: [VWX] -1,2 $ isupport:Y set to: [Z] -2 < :foo.bar.baz 251 foo :There are 10 users and 1000 invisible on 5 servers -2 < :foo.bar.baz 252 foo 7 :IRC Operators online -2 < :foo.bar.baz 253 foo 4 :unknown connection(s) -2 < :foo.bar.baz 254 foo 800 :channels formed -2 < :foo.bar.baz 255 foo :I have 100 clients and 1 serveres -2 < :foo.bar.baz 265 foo 100 150 :Current local users 100, max 150 -2 < :foo.bar.baz 266 foo 1010 1050 :Current global users 1010, max 1050 -2 < :foo.bar.baz 250 foo :Highest connection count: 151 (150 clients) (1080 connections received) -2 < :foo.bar.baz 375 foo :- foo.bar.baz Message of the Day - -2 < :foo.bar.baz 372 foo :- Howdy! - -2 < :foo.bar.baz 372 foo :- Welcome! - -2 < :foo.bar.baz 372 foo :- (to this server) - -2 < :foo.bar.baz 376 foo :End of /MOTD command -1,2 $ motd set to: -1,2 $ - Howdy! - -1,2 $ - Welcome! - -1,2 $ - (to this server) - -2 < :foo MODE foo :+Ziw -1,2 $ users:me:modes set to: [+Ziw] -2 < :SaslServ!SaslServ@services.bar.baz NOTICE foo :Last login from ~foobarbaz@foo.bar.baz on Jan 1 22:00:00 2021 +0000. -3 <<< [SaslServ] Last login from ~foobarbaz@foo.bar.baz on Jan 1 22:00:00 2021 +0000. -> /join #test -2 > JOIN :#test -2 < :foo!~foobarbaz@baz.bar.foo JOIN #test -1,2 $ users:me:user set to: [~foobarbaz] -2 < :foo.bar.baz 353 foo @ #test :foo @bar -1,2 $ users:1:nick set to: [?] -1,2 $ users:1:nick set to: [bar] -2 < :foo.bar.baz 366 foo #test :End of /NAMES list. -4 $ residents: bar, foo -2 < :bar!~bar@bar.bar PRIVMSG #test :hi there -1,2 $ users:1:user set to: [~bar] -1,2 $ users:1:host set to: [bar.bar] -4 < [bar] hi there +repeat 64:147 +repeat 158:265 > /quit 0 <