home · contact · privacy
On testing inserts, allow empty bump fields.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 16 Nov 2025 03:32:23 +0000 (04:32 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 16 Nov 2025 03:32:23 +0000 (04:32 +0100)
src/ircplom/testing.py
src/tests/channels.test
src/tests/isupports.test
src/tests/lib/join-empty
src/tests/lib/part
src/tests/lib/privmsg
src/tests/test.test

index 0f53f97df0ded0bf84f2e4cafb3301c8ff1055ec..a84e3428dd4b52047bb2a3ac6905449b076eba7a 100644 (file)
@@ -276,7 +276,7 @@ class _Playbook:
                         assert '=' in arg
                         replace_pattern(*arg.split('=', maxsplit=1))
                     replace_pattern(*repl_args[-2:])
-                if len(insert_args) >= 3:
+                if len(insert_args) >= 3 and insert_args[2] != '+':
                     bump_int_fields(int(insert_args[2]))
             except (AssertionError, ValueError):
                 assert False, (idx_str, insert_args)
index e970aa348c727081f9f9d752163826fca157009d..485ef911e1350f35ac446435dc746c289019912f 100644 (file)
@@ -12,15 +12,14 @@ insert ./lib/disconnect
 insert ./lib/join-empty
 # for: join-channel-0, join-channel-1, join-empty
 insert ./lib/part
+# for: exit-channel, part, parts-core, quit
 insert ./lib/privmsg
 insert ./lib/retry-in
 insert ./lib/servermsglogged
 insert ./lib/user-set-to
 
 × part-empty
-insert part :-3 +0 USERIDS_CLEAR :cleared
-log CHAN_WIN_ID $ foo!~baz@baz.bar.foo parts
-insert part -2:
+insert part : + USERIDS_CLEAR :cleared
 
 × topic-set-to
 log 1 $ channels:CHANNEL:topic set to: [Topic(what='NEWTOPIC', who=NickUserHost(nick='baz', user='~baz', host='baz.baz'))]
@@ -28,13 +27,21 @@ log 4 $ baz!~baz@baz.baz set topic: NEWTOPIC
 
 × reconnect
 > /reconnect
-insert attempting-to-connected : +1 WIN_IDS :2,3,4
-insert caps-neg-empty : +0
-insert 001-setting-nick : +0
+insert attempting-to-connected : + WIN_IDS :2,3,4
+insert caps-neg-empty : +
+insert 001-setting-nick : +
 log 1 > JOIN :#ch_test0
 insert usermode
-insert servermsglogged : +0 MSG ::foo!~baz@baz.bar.foo JOIN #ch_test0
-insert join-empty : +0 CHANNEL :#ch_test0
+insert servermsglogged : + MSG ::foo!~baz@baz.bar.foo JOIN #ch_test0
+insert join-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
+
+× join-already-in
+> /join TARGET
+log LOG_WIN_ID $ already in that channel
+
+× part-other
+insert servermsglogged : + MSG ::NICK!~NICK@NICK.NICK PART :#ch_test0
+insert parts-core : + exitMSG= exitPREFIX= USERIDS_CLEAR=set§to:§REMAINING_IDS CHANNEL=#ch_test0 CHAN_WIN_ID=3 § : 
 
 × ×--------------------------
 
@@ -48,175 +55,149 @@ insert 001-to-usermode
 log 2 $ not sending, since not in channel
 
 # check join with minimum context (no topic, no other users etc.)
-insert join-empty : +0 CHANNEL :#ch_test0
+insert join-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
 
 # check privmsg into channel from other window only works by direct addressing
 > msg_test1
 log 2 # invalid prompt command: not prefixed by /
-insert privmsg : +1 TARGET=#ch_test0 TXT :msg_test1
+insert privmsg : + TARGET_WIN_ID=3 TARGET=#ch_test0 TXT :msg_test1
 
 # check from within channel window privmsg works directly and indirectly
 > /window 3
-insert privmsg : +1 TARGET=#ch_test0 TXT :msg_test2
+insert privmsg : + TARGET_WIN_ID=3 TARGET=#ch_test0 TXT :msg_test2
 > msg_test3
-insert privmsg 1: +1 TARGET=#ch_test0 TXT :msg_test3
+insert privmsg 1: + TARGET_WIN_ID=3 TARGET=#ch_test0 TXT :msg_test3
 
 # check /part and that it only works from within channel window, and if already in channel
 > /window 2
 > /part
 log 2 # invalid prompt command: /part unknown
 > /window 3
-insert part-empty : +0 CHAN_WIN_ID=3 CHANNEL :#ch_test0
+insert part-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
 > /part
 log 3 $ not in that channel
 
 # check /join without argument joins channel previously joined in same window
 > /join
-insert join-empty 1: +0 CHANNEL :#ch_test0
+insert join-empty 1: + CHAN_WIN_ID=3 CHANNEL :#ch_test0
 
 # check cannot /join channel already joined, neither from its window nor from elsewhere
-> /join
-log 3 $ already in that channel
-> /join #ch_test0
-log 3 $ already in that channel
+insert join-already-in : + LOG_WIN_ID=3 TARGET :
+insert join-already-in : + LOG_WIN_ID=3 TARGET :#ch_test0
 > /window 2
-> /join #ch_test0
-log 2 $ already in that channel
+insert join-already-in : + LOG_WIN_ID=2 TARGET :#ch_test0
 
 # check join to different channel name initiates new window, even if there's already a window for a channel that's been /parted
 > /window 3
-insert part-empty : +0 CHAN_WIN_ID=3 CHANNEL :#ch_test0
-insert join-empty :-1 +0 CHANNEL :#ch_test1
-log 4 $ residents: foo
-
-# check /join to channel with one other user, and @ rather than = in 353 message
-insert join-channel-0 :-3 +0 CHANNEL :#ch_test0
-insert servermsglogged : +0 MSG ::foo.bar.baz 353 foo @ #ch_test0 :foo bar
-insert join-channel-0 -1: +1 CHANNEL :#ch_test0
-insert user-set-to :2 +1 USER_ID=1 USERNICK :bar
-insert join-channel-1 : +0 CHANNEL=#ch_test0 RESIDENT_IDS :[1], [me]
-log 3 $ residents: bar, foo
+insert part-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
+insert join-empty : + CHAN_WIN_ID=4 CHANNEL :#ch_test1
 
-# check /part from channel with other user
-insert part : +0 CHANNEL=#ch_test0 CHAN_WIN_ID=3 USERIDS_CLEAR :set to: [1]
+# check 353 also understood if using @ rather than =
+insert join-empty : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 = :@
+insert part-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
+
+# check /join to, and part from, channel with one other user
+insert join-channel-0 : + CHANNEL=#ch_test0 RESIDENT_NAMES :foo bar
+insert user-set-to :2 + USER_ID=1 USERNICK :bar
+insert join-channel-1 : + CHANNEL=#ch_test0 RESIDENT_IDS :[1], [me]
+log 3 $ residents: bar, foo
+insert part : + CHANNEL=#ch_test0 CHAN_WIN_ID=3 USERIDS_CLEAR :set to: [1]
 log 1 $ users:1 cleared
 
 # check /join into channel with many other users, with multi-line 353
-insert join-channel-0 : +0 CHANNEL=#ch_test0 RESIDENT_NAMES :foo baz oof
-insert user-set-to :2 +1 USER_ID=2 USERNICK :baz
-insert user-set-to :2 +1 USER_ID=3 USERNICK :oof
-insert servermsglogged : +0 MSG ::foo.bar.baz 353 foo = #ch_test0 :rab zab
-insert user-set-to :2 +1 USER_ID=4 USERNICK :rab
-insert user-set-to :2 +1 USER_ID=5 USERNICK :zab
-insert join-channel-1 : +0 CHANNEL=#ch_test0 RESIDENT_IDS :[2], [3], [4], [5], [me]
+insert join-channel-0 : + CHANNEL=#ch_test0 RESIDENT_NAMES :foo baz oof
+insert user-set-to :2 + USER_ID=2 USERNICK :baz
+insert user-set-to :2 + USER_ID=3 USERNICK :oof
+insert servermsglogged : + MSG ::foo.bar.baz 353 foo = #ch_test0 :rab zab
+insert user-set-to :2 + USER_ID=4 USERNICK :rab
+insert user-set-to :2 + USER_ID=5 USERNICK :zab
+insert join-channel-1 : + CHANNEL=#ch_test0 RESIDENT_IDS :[2], [3], [4], [5], [me]
 log 3 $ residents: baz, oof, rab, zab, foo
 
 # check /join into channel with topic set
 > /window 4
-insert part-empty : +0 CHAN_WIN_ID=4 CHANNEL :#ch_test1
-insert join-channel-0 :4 +0 CHANNEL :#ch_test1
-insert servermsglogged : +0 MSG ::foo.bar.baz 332 foo #ch_test1 :foo bar baz
+insert part-empty : + CHAN_WIN_ID=4 CHANNEL :#ch_test1
+insert join-channel-0-0 : + CHANNEL :#ch_test1
+insert servermsglogged : + MSG ::foo.bar.baz 332 foo #ch_test1 :foo bar baz
 log 1 $ channels:#ch_test1:exits cleared
-insert servermsglogged : +0 MSG ::foo.bar.baz 333 foo #ch_test1 baz!~baz@OLD.baz.baz 1234567890
-insert topic-set-to : +1 baz.baz=OLD.baz.baz CHANNEL=#ch_test1 NEWTOPIC :foo bar baz
-insert servermsglogged : +0 MSG ::foo.bar.baz 353 foo = #ch_test1 :foo baz
-
-insert join-channel-1 : +0 CHANNEL=#ch_test1 RESIDENT_IDS :[2], [me]
+insert servermsglogged : + MSG ::foo.bar.baz 333 foo #ch_test1 baz!~baz@OLD.baz.baz 1234567890
+insert topic-set-to : + baz.baz=OLD.baz.baz CHANNEL=#ch_test1 NEWTOPIC :foo bar baz
+insert join-channel-0-1 :-1 + CHANNEL=#ch_test1 RESIDENT_NAMES :foo baz
+insert join-channel-1 : + CHANNEL=#ch_test1 RESIDENT_IDS :[2], [me]
 log 4 $ residents: baz, foo
 
 # check _observed_ topic change _does_ affect users database, and …
-insert servermsglogged : +0 MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo bar baz
-insert user-set-to 2: +1 USER_ID=2 USERNAME=~baz USERHOST :baz.baz
+insert servermsglogged : + MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo bar baz
+insert user-set-to 2: + USER_ID=2 USERNAME=~baz USERHOST :baz.baz
 
 # … is echoed into channel window _if_ either content or setter change
-insert topic-set-to : +1 CHANNEL=#ch_test1 NEWTOPIC :foo bar baz
-insert servermsglogged : +0 MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo bar baz
-insert servermsglogged : +0 MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo foo baz
-insert topic-set-to : +1 CHANNEL=#ch_test1 NEWTOPIC :foo foo baz
+insert topic-set-to : + CHANNEL=#ch_test1 NEWTOPIC :foo bar baz
+insert servermsglogged : + MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo bar baz
+insert servermsglogged : + MSG ::baz!~baz@baz.baz TOPIC #ch_test1 :foo foo baz
+insert topic-set-to : + CHANNEL=#ch_test1 NEWTOPIC :foo foo baz
 
 # check effects of other users' messages (PRIVMSG and NOTICE)
-insert servermsglogged : +0 MSG ::baz!~baz@baz.baz PRIVMSG #ch_test0 :msg_test3 msg_test4
+insert servermsglogged : + MSG ::baz!~baz@baz.baz PRIVMSG #ch_test0 :msg_test3 msg_test4
 log 3 < [baz] msg_test3 msg_test4
-insert servermsglogged : +0 MSG ::oof!~oof@oof.oof NOTICE #ch_test0 :msg_test5 msg_test6
-insert user-set-to 2: +1 USER_ID=3 USERNAME=~oof USERHOST :oof.oof
+insert servermsglogged : + MSG ::oof!~oof@oof.oof NOTICE #ch_test0 :msg_test5 msg_test6
+insert user-set-to 2: + USER_ID=3 USERNAME=~oof USERHOST :oof.oof
 log 3 < (oof) msg_test5 msg_test6
 
 # check effect of server NOTICE to channel
-insert servermsglogged : +0 MSG ::*.?.net NOTICE #ch_test0 :msg_test6 msg_test7
+insert servermsglogged : + MSG ::*.?.net NOTICE #ch_test0 :msg_test6 msg_test7
 log 3 < (*.?.net) msg_test6 msg_test7
 
-# check part of user visible in other channel
-insert servermsglogged : +0 MSG ::baz!~baz@baz.baz PART :#ch_test0
-log 1 $ channels:#ch_test0:exits:2 set to: [P]
-log 1 $ channels:#ch_test0:user_ids set to: [3], [4], [5], [me]
-log 3 $ baz!~baz@baz.baz parts
-log 1 $ channels:#ch_test0:exits:2 cleared
-
-# check part of user NOT visible in other channel
-insert servermsglogged : +0 MSG ::oof!~oof@oof.oof PART :#ch_test0
-log 1 $ channels:#ch_test0:exits:3 set to: [P]
-log 1 $ channels:#ch_test0:user_ids set to: [4], [5], [me]
-log 3 $ oof!~oof@oof.oof parts
-log 1 $ channels:#ch_test0:exits:3 cleared
+# check part of user visible, and of user NOT visible in other channel
+insert part-other : + NICK=baz USER_ID=2 REMAINING_IDS :[3], [4], [5], [me]
+insert part-other : + NICK=oof USER_ID=3 REMAINING_IDS :[4], [5], [me]
 log 1 $ users:3 cleared
 
 # check other-user part with exit message
-insert servermsglogged : +0 MSG ::zab!~zab@zab.zab PART #ch_test0 :goodbye world
-insert user-set-to 2: +1 USER_ID=5 USERNAME=~zab USERHOST :zab.zab
-log 1 $ channels:#ch_test0:exits:5 set to: [Pgoodbye world]
-log 1 $ channels:#ch_test0:user_ids set to: [4], [me]
-log 3 $ zab!~zab@zab.zab parts: goodbye world
-log 1 $ channels:#ch_test0:exits:5 cleared
+insert servermsglogged : + MSG ::zab!~zab@zab.zab PART #ch_test0 :goodbye
+insert user-set-to 2: + USER_ID=5 USERNAME=~zab USERHOST :zab.zab
+insert parts-core : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=5 NICK=zab exitPREFIX=:§ exitMSG=goodbye USERIDS_CLEAR=set§to:§[4],§[me] § : 
 log 1 $ users:5 cleared
 
 # check re-join of user kept visible in other channel
-insert servermsglogged : +0 MSG ::baz!~baz@baz.baz JOIN :#ch_test0
+insert servermsglogged : + MSG ::baz!~baz@baz.baz JOIN :#ch_test0
 log 1 $ channels:#ch_test0:user_ids set to: [2], [4], [me]
 log 3 $ baz!~baz@baz.baz joins
 
 # check re-join of user NOT kept visible in other channel
-insert servermsglogged : +0 MSG ::oof!~oof@oof.oof JOIN :#ch_test0
-insert user-set-to : +1 USER_ID=6 USERNICK=oof USERNAME=~oof USERHOST :oof.oof
+insert servermsglogged : + MSG ::oof!~oof@oof.oof JOIN :#ch_test0
+insert user-set-to : + USER_ID=6 USERNICK=oof USERNAME=~oof USERHOST :oof.oof
 log 1 $ channels:#ch_test0:user_ids set to: [2], [4], [6], [me]
 log 3 $ oof!~oof@oof.oof joins
 
 # check renaming of user communicated into all windows of channels they're in – be it others, or oneself
-insert rename : +0 USER_ID=2 NUH=baz!~baz@baz.baz NEWNICK :bazbaz
-insert cmd-nick : +0 NUH=foo!~baz@baz.bar.foo USER_ID=me NEWNICK :myself
+insert rename : + USER_ID=2 NUH=baz!~baz@baz.baz NEWNICK :bazbaz
+insert rename : + USER_ID=2 NUH=bazbaz!~baz@baz.baz NEWNICK :baz
+insert cmd-nick : + NUH=foo!~baz@baz.bar.foo USER_ID=me NEWNICK :myself
 
 # reverting to foo to easen fragment re-use later on
-insert cmd-nick : +0 NUH=myself!~baz@baz.bar.foo USER_ID=me NEWNICK :foo
+insert cmd-nick : + NUH=myself!~baz@baz.bar.foo USER_ID=me NEWNICK :foo
 
 # check QUIT affecting user in all their channels, removing them from DB
-insert servermsglogged : +0 MSG ::bazbaz!~baz@baz.baz QUIT :Client Quit
+insert servermsglogged : + MSG ::baz!~baz@baz.baz QUIT :Client Quit
 log 1 $ users:2:exit_msg set to: [QClient Quit]
-log , $ bazbaz!~baz@baz.baz quits: Client Quit
-log 1 $ channels:#ch_test0:exits:2 set to: [QClient Quit]
-log 1 $ channels:#ch_test0:user_ids set to: [4], [6], [me]
-log 3 $ bazbaz!~baz@baz.baz quits: Client Quit
-log 1 $ channels:#ch_test0:exits:2 cleared
-log 1 $ channels:#ch_test1:exits:2 set to: [QClient Quit]
-log 1 $ channels:#ch_test1:user_ids set to: [me]
-log 4 $ bazbaz!~baz@baz.baz quits: Client Quit
-log 1 $ channels:#ch_test1:exits:2 cleared
+log , $ baz!~baz@baz.baz quits: Client Quit
+insert quit : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=2 NICK=baz REMAINING_IDS :[4], [6], [me]
+insert quit : + CHAN_WIN_ID=4 CHANNEL=#ch_test1 USER_ID=2 NICK=baz REMAINING_IDS :[me]
 log 1 $ users:2 cleared
 
 # check effects of own QUIT while present in one channel
-insert part-empty : +0 CHAN_WIN_ID=4 CHANNEL :#ch_test1
+insert part-empty : + CHAN_WIN_ID=4 CHANNEL :#ch_test1
 insert cmd-disconnect-0
-log 1 $ channels:#ch_test0:exits:me set to: [QClient Quit]
-log 1 $ channels:#ch_test0:user_ids set to: [4], [6]
-log 3 $ foo!~baz@baz.bar.foo quits: Client Quit
-log 1 $ channels:#ch_test0:exits:me cleared
-insert cmd-disconnect-1 :-1 +0
-insert disconnect1 : +1 WIN_IDS :2,3,4
+insert quit : + CHAN_WIN_ID=3 CHANNEL=#ch_test0 USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo REMAINING_IDS :[4], [6]
+insert cmd-disconnect-1 :-1
+insert disconnect1 : + WIN_IDS :2,3,4
 
 # check /reconnect calling auto-rejoin on the one channel inhabited on previous leaving
 insert reconnect
 
 # check same mechanism holding on externally triggered disconnect
 servermsg 0 FAKE_IRC_CONN_ABORT_EXCEPTION
-insert disconnect0 :-1 +1 EXIT_MSG :broken: FAKE_IRC_CONN_ABORT_EXCEPTION
-insert disconnect1 : +1 WIN_IDS :2,3,4
-insert retry-in : +1 ? :1
+insert disconnect0 :-1 + EXIT_MSG :broken: FAKE_IRC_CONN_ABORT_EXCEPTION
+insert disconnect1 : + WIN_IDS :2,3,4
+insert retry-in : + ? :1
 insert reconnect
index b414461822518e3a72528058bd4d3e3716fd063a..6d147e0cd1349302f94ed24e0736c1b1841d2dd7 100644 (file)
@@ -73,16 +73,13 @@ insert caps-neg-empty
 insert 001-to-usermode
 
 # check effect of CHANTYPES
-insert join-empty : +0 CHANNEL :#ch_test0
-insert join-empty :-1 +0 CHANNEL :&ch_test1
-log 4 $ residents: foo
+insert join-empty : + CHAN_WIN_ID=3 CHANNEL :#ch_test0
+insert join-empty : + CHAN_WIN_ID=4 CHANNEL :&ch_test1
 insert no-handler : +0 ALERT_WIN_IDS=2,3,4 ? :foo!~baz@baz.bar.foo JOIN $ch_test2
 insert un-default : +0 KEY=CHANTYPES VALUE :#$%
-insert join-empty :-1 +0 CHANNEL :#ch_test3
-log 5 $ residents: foo
+insert join-empty : + CHAN_WIN_ID=5 CHANNEL :#ch_test3
 insert no-handler : +0 ALERT_WIN_IDS=2,3,4,5 ? :foo!~baz@baz.bar.foo JOIN &ch_test4
-insert join-empty :-1 +0 CHANNEL :#ch_test5
-log 6 $ residents: foo
+insert join-empty : + CHAN_WIN_ID=6 CHANNEL :#ch_test5
 
 # test effect of PREFIX
 insert join-channel-0 : +0 CHANNEL=#ch_test6 RESIDENT_NAMES :foo @bar +baz =quux
@@ -99,8 +96,7 @@ insert join-channel-1 : +0 CHANNEL=#ch_test7 RESIDENT_IDS :[2], [4], [5], [me]
 log 8 $ residents: baz, @bar, quux, foo
 
 # test effect of USERLEN
-insert join-empty :-1 +0 CHANNEL :#ch_test8
-log 9 $ residents: foo
+insert join-empty : + CHAN_WIN_ID=9 CHANNEL :#ch_test8
 insert join-and-hi : +0 NICKNAME=user0 USER_ID=6 TO_CUT=foobarbaz RESIDENT_IDS :[6]
 insert un-default : +0 KEY=USERLEN VALUE :8
 insert join-and-hi : +0 NICKNAME=user1 USER_ID=7 TO_CUT=foobarb RESIDENT_IDS :[6], [7]
index c584db6919c50ed2871865835c720090afcba5cc..a89572acbbfa1e2216ee301dbbc6f3c1c3950344 100644 (file)
@@ -1,17 +1,23 @@
 insert ./lib/servermsglogged
 
-× join-channel-0
+× join-channel-0-0
 > /join CHANNEL
 log 1 > JOIN :CHANNEL
-insert servermsglogged : +0 MSG ::foo!~baz@baz.bar.foo JOIN :CHANNEL
-insert servermsglogged : +0 MSG ::foo.bar.baz 353 foo = CHANNEL :RESIDENT_NAMES
+insert servermsglogged : + MSG ::foo!~baz@baz.bar.foo JOIN :CHANNEL
+
+× join-channel-0-1
+insert servermsglogged : + MSG ::foo.bar.baz 353 foo = CHANNEL :RESIDENT_NAMES
 log 1 $ channels:CHANNEL:exits cleared
 
+× join-channel-0
+insert join-channel-0-0
+insert join-channel-0-1
+
 × join-channel-1
-insert servermsglogged : +0 MSG ::foo.bar.baz 366 foo CHANNEL :End of /NAMES list.
+insert servermsglogged : + MSG ::foo.bar.baz 366 foo CHANNEL :End of /NAMES list.
 log 1 $ channels:CHANNEL:user_ids set to: RESIDENT_IDS
 
 × join-empty
-insert join-channel-0 : +0 RESIDENT_NAMES :foo
-insert join-channel-1 : +0 RESIDENT_IDS :[me]
-log 3 $ residents: foo
+insert join-channel-0 : + RESIDENT_NAMES :foo
+insert join-channel-1 : + RESIDENT_IDS :[me]
+log CHAN_WIN_ID $ residents: foo
index 2a1bccdf62bbf885e6914d6bd11920d001273903..3fbfb42add742686675d12982614b0b0e27864a9 100644 (file)
@@ -1,11 +1,23 @@
 insert ./lib/servermsglogged
 
+× exit-channel
+log 1 $ channels:CHANNEL:exits:USER_ID set to: [exitTYPEexitMSG]
+log 1 $ channels:CHANNEL:user_ids USERIDS_CLEAR
+log CHAN_WIN_ID $ NICK!~NICK@NICK.NICK exitDESCexitPREFIXexitMSG
+log 1 $ channels:CHANNEL:exits:USER_ID cleared
+
+× parts-core
+insert exit-channel : + exitTYPE=P exitDESC :parts
+
 × part
 > /part
 log 1 > PART :CHANNEL
-insert servermsglogged : +0 MSG ::foo!~baz@baz.bar.foo PART :CHANNEL
-log 1 $ channels:CHANNEL:exits:me set to: [P]
-log 1 $ channels:CHANNEL:user_ids USERIDS_CLEAR
-log CHAN_WIN_ID $ foo!~baz@baz.bar.foo parts
-log 1 $ channels:CHANNEL:exits:me cleared
+insert servermsglogged : + MSG ::foo!~baz@baz.bar.foo PART :CHANNEL
+insert parts-core : + exitPREFIX= exitMSG= USER_ID=me NICK=foo foo@foo.foo :baz@baz.bar.foo
 log 1 $ channels:CHANNEL cleared
+
+× quits
+insert exit-channel : + exitTYPE=Q exitDESC=quits exitPREFIX=:§ exitMSG=Client§Quit § : 
+
+× quit
+insert quits : + USERIDS_CLEAR=set§to:§REMAINING_IDS § : 
index d13786a3221a0321a7f36fdf3605234a01bf1c90..ed7f1237cf7f3e4f49eb46176e3e13388d1eeb40 100644 (file)
@@ -1,4 +1,4 @@
 × privmsg
 > /privmsg TARGET TXT
 log 1 > PRIVMSG TARGET :TXT
-log 3 > [foo] TXT
+log TARGET_WIN_ID > [foo] TXT
index 7561929063f407bd058e68343df3d8eeffbf424f..6534640224c3ac829d2d3f9eb01e54bbd340df4e 100644 (file)
@@ -14,6 +14,7 @@ insert ./lib/join-empty
 # for: join-channel-0, join-channel-1
 insert ./lib/no-handler
 insert ./lib/part
+# for: part, quit, quits
 insert ./lib/pingpong
 insert ./lib/privmsg
 insert ./lib/req-sasl
@@ -140,14 +141,12 @@ log 5 $ residents: bar, foo
 # handle query window with known user
 insert servermsglogged : +0 MSG ::bar!~bar@bar.bar PRIVMSG foo :hi there
 log 6 < [bar] hi there
-insert privmsg :-1 +1 TARGET=bar TXT :hello, how is it going
-log 6 > [foo] hello, how is it going
+insert privmsg : +1 TARGET_WIN_ID=6 TARGET=bar TXT :hello, how is it going
 insert servermsglogged : +0 MSG ::bar!~bar@bar.bar PRIVMSG foo :fine!
 log 6 < [bar] fine!
 
 # handle failure to query absent user
-insert privmsg :-1 +1 TARGET=barbar TXT :hello!
-log 7 > [foo] hello!
+insert privmsg : +1 TARGET_WIN_ID=7 TARGET=barbar TXT :hello!
 insert servermsglogged : +0 MSG ::*.?.net 401 foo barbar :No such nick/channel
 log 7 $ barbar not online
 
@@ -160,14 +159,8 @@ log 4,5,6,7 $ bar!~bar@bar.bar renames barbar
 insert servermsglogged : +0 MSG ::barbar!~bar@bar.bar QUIT :Client Quit
 log 1 $ users:2:exit_msg set to: [QClient Quit]
 log 6,7 $ barbar!~bar@bar.bar quits: Client Quit
-log 1 $ channels:#test:exits:2 set to: [QClient Quit]
-log 1 $ channels:#test:user_ids set to: [1], [me]
-log 4 $ barbar!~bar@bar.bar quits: Client Quit
-log 1 $ channels:#test:exits:2 cleared
-log 1 $ channels:#testtest:exits:2 set to: [QClient Quit]
-log 1 $ channels:#testtest:user_ids set to: [me]
-log 5 $ barbar!~bar@bar.bar quits: Client Quit
-log 1 $ channels:#testtest:exits:2 cleared
+insert quit : + CHAN_WIN_ID=4 CHANNEL=#test USER_ID=2 NICK=bar bar!=barbar! REMAINING_IDS :[1], [me]
+insert quit : + CHAN_WIN_ID=5 CHANNEL=#testtest USER_ID=2 NICK=bar bar!=barbar! REMAINING_IDS :[me]
 log 1 $ users:2 cleared
 
 # handle self-PART: clear channel, and its squatters
@@ -181,10 +174,7 @@ insert no-handler : +0 ALERT_WIN_IDS=2,3,4,5,6,7 ? :foo bar baz
 # handle /disconnect, clear all
 insert cmd-disconnect-0 :-1
 log 3,6,7 $ foo!~baz@baz.bar.foo quits: Client Quit
-log 1 $ channels:#testtest:exits:me set to: [QClient Quit]
-log 1 $ channels:#testtest:user_ids cleared
-log 5 $ foo!~baz@baz.bar.foo quits: Client Quit
-log 1 $ channels:#testtest:exits:me cleared
+insert quits : + CHAN_WIN_ID=5 CHANNEL=#testtest USER_ID=me NICK=foo foo@foo.foo=baz@baz.bar.foo USERIDS_CLEAR :cleared
 insert cmd-disconnect-1 : +0
 insert disconnect1 :-1 +1 WIN_IDS :2,3,4,5,6,7
 log 1 $ motd cleared