From: Christian Heller Date: Mon, 3 Nov 2025 18:49:30 +0000 (+0100) Subject: In testing, reduce verbosity of many insert calls. X-Git-Url: https://plomlompom.com/repos/do_day?a=commitdiff_plain;h=bef2379b6d0373ea345354d251f9c5f63185d934;p=ircplom In testing, reduce verbosity of many insert calls. --- diff --git a/src/ircplom/testing.py b/src/ircplom/testing.py index 0fda4c3..b1e2e52 100644 --- a/src/ircplom/testing.py +++ b/src/ircplom/testing.py @@ -222,45 +222,51 @@ class _Playbook: _SEP_0.join((_MARK_LOG, args[1], args[2])))] def insert(index_str: str, - args: tuple[str, ...], + insert_args: tuple[str, ...], fragments: dict[str, tuple[tuple[str, str], ...]], **__ ) -> list[tuple[str, str]]: candidates = [ (_SEP_2.join((index_str, _TOK_IDX_REPEAT, sub_index_str)), line) - for sub_index_str, line in fragments[args[0]]] + for sub_index_str, line in fragments[insert_args[0]]] + if len(insert_args) == 1: + return candidates idx_in, idx_out = ((int(val) if val else None) - for val in args[1].split(_SEP_2)) + for val in insert_args[1].split(_SEP_2)) candidates = candidates[idx_in:idx_out] - lowest_int: Optional[int] = None - inserts = [] + n_bump = int(insert_args[2]) if len(insert_args) > 2 else None + if n_bump is None: + return candidates + to_bump = [] + start_offset: Optional[int] = None for candidate in candidates: cmd_name, remains = candidate[1].split(_SEP_0, maxsplit=1) cmd_args_idx = _SIGNATURE_FOR_CMD[cmd_name][1] - cmd_args: list[str | tuple[int, ...]]\ - = list(self._args_for_cmd(cmd_name, remains)) + cmd_args: list[str | tuple[int, ...]] + cmd_args = list(self._args_for_cmd(cmd_name, remains)) if cmd_args_idx is not None and len(cmd_args) > cmd_args_idx: cmd_arg = cmd_args[cmd_args_idx] assert isinstance(cmd_arg, str) vals = tuple(int(n) for n in cmd_arg.split(_SEP_1) if n) if len(vals) > 0: - lowest_int = min(vals if lowest_int is None - else (vals + (lowest_int,))) + start_offset = min(vals if start_offset is None + else (vals + (start_offset,))) cmd_args[cmd_args_idx] = vals - inserts += [(candidate[0], cmd_name, cmd_args)] - line_offset = 0 - (lowest_int or 0) - return [ - (new_index_str, - _SEP_0.join( - (cmd_name, ) - + tuple( - cmd_arg if isinstance(cmd_arg, str) - else (_SEP_1.join(str(n + line_offset + int(args[2])) - for n in cmd_arg) - or ',') - for cmd_arg in cmd_args))) - for new_index_str, cmd_name, cmd_args in inserts] + to_bump += [(candidate[0], cmd_name, cmd_args)] + bumped_offset = n_bump - (start_offset or 0) + inserts = [] + for new_index_str, cmd_name, cmd_args in to_bump: + to_join = [cmd_name] + for cmd_arg in cmd_args: + if isinstance(cmd_arg, str): + to_join += [cmd_arg] + else: + to_join += [ + _SEP_1.join(str(n + bumped_offset) for n in cmd_arg) + or ','] + inserts += [(new_index_str, _SEP_0.join(to_join))] + return inserts def expand_inserts() -> None: fragments: dict[str, tuple[tuple[str, str], ...]] = {} diff --git a/src/tests/_timeout_retries.test b/src/tests/_timeout_retries.test index dbe3a35..23bff19 100644 --- a/src/tests/_timeout_retries.test +++ b/src/tests/_timeout_retries.test @@ -48,12 +48,12 @@ log 1 > NICK :foo # each started connection attempt > /connect foo.bar.baz:10003 foo:bar baz:foobarbazquux -insert clientwin-init : +1 +insert clientwin-init log 1 $ hostname set to: [foo.bar.baz] -insert conn-init-retries : +1 +insert conn-init-retries # with TestingClient finally having reduced port to 10000, connecting works now -insert conn : +1 +insert conn # check retry chain also started by in-connection timeout servermsg 0 timeout @@ -61,7 +61,7 @@ log 1 > PING :what's up? servermsg 0 timeout servermsg 0 no timely PONG from server log 1 $ connection_state set to: [broken: no timely PONG from server] -insert isupport-clear : +1 +insert isupport-clear log 1 $ connection_state set to: [] log , $ DISCONNECTED log 1 $ will retry connecting in 1 seconds diff --git a/src/tests/connect_disconnect_legalities.test b/src/tests/connect_disconnect_legalities.test index 91a4061..8904ccf 100644 --- a/src/tests/connect_disconnect_legalities.test +++ b/src/tests/connect_disconnect_legalities.test @@ -11,14 +11,14 @@ log 1 > CAP LS :302 log 1 > USER baz 0 * :bar log 1 > NICK :foo × disconnecting -insert isupport-clear : +1 +insert isupport-clear log 1 $ connection_state set to: [] log , $ DISCONNECTED × # to prepare, initiate connection > /connect foo.bar.baz foo bar:baz -insert isupport-clear : +1 +insert isupport-clear log 1 $ caps cleared log 1 $ users cleared log 1 $ channels cleared @@ -29,7 +29,7 @@ log 1 $ nick_wanted set to: [foo] log 1 $ user_wanted set to: [baz] log 1 $ realname set to: [bar] log 1 $ port set to: [6697] -insert connecting : +1 +insert connecting # fail to reconnect while connected > /window 1 @@ -41,7 +41,7 @@ log 1 $ not re-connecting since already connected log 1 > QUIT :ircplom says bye loggedservermsg 0 1 < ERROR :Closing link: (whatever@whatever.com) [Quit: ircplom says bye] log 1 $ connection_state set to: [Closing link: (whatever@whatever.com) [Quit: ircplom says bye]] -insert disconnecting : +1 +insert disconnecting # fail to disconnect when already disconnected > /disconnect @@ -49,12 +49,12 @@ log 1 $ already disconnected and not attempting connect # succeed to re-connect after disconnect > /reconnect -insert connecting : +1 +insert connecting # allow /disconnect outside connection for auto-connect stops loggedservermsg 0 1 < ERROR :Closing link: (Connection timed out) log 1 $ connection_state set to: [Closing link: (Connection timed out)] -insert disconnecting : +1 +insert disconnecting log 1 $ will retry connecting in 1 seconds > /disconnect log 1 $ already disconnected, stopped connecting attempts diff --git a/src/tests/error_disconnects.test b/src/tests/error_disconnects.test index ac3a63a..9015eaa 100644 --- a/src/tests/error_disconnects.test +++ b/src/tests/error_disconnects.test @@ -11,20 +11,20 @@ log 1 > CAP LS :302 log 1 > USER baz 0 * :bar log 1 > NICK :foo × disconnecting -insert isupport-clear : +1 +insert isupport-clear log 1 $ connection_state set to: [] log , $ DISCONNECTED × reconnect > /reconnect -insert connecting : +1 +insert connecting × disconnect-with-retry -insert disconnecting : +1 +insert disconnecting log 1 $ will retry connecting in 1 seconds × # to prepare first test, initiate connected state > /connect foo.bar.baz foo bar:baz -insert isupport-clear : +1 +insert isupport-clear log 1 $ caps cleared log 1 $ users cleared log 1 $ channels cleared @@ -35,28 +35,28 @@ log 1 $ nick_wanted set to: [foo] log 1 $ user_wanted set to: [baz] log 1 $ realname set to: [bar] log 1 $ port set to: [6697] -insert connecting : +1 +insert connecting # test default ERROR handling loggedservermsg 0 1 < ERROR :abc def ghi log 1 $ connection_state set to: [abc def ghi] -insert disconnecting : +1 +insert disconnecting # test ERROR regex (non-)matches > /window 1 -insert reconnect : +1 +insert reconnect loggedservermsg 0 1 < ERROR :Closing link: (this should not match) log 1 $ connection_state set to: [Closing link: (this should not match)] -insert disconnecting : +1 -insert reconnect : +1 +insert disconnecting +insert reconnect loggedservermsg 0 1 < ERROR :Closing link: (Connection timed out) log 1 $ connection_state set to: [Closing link: (Connection timed out)] -insert disconnect-with-retry : +1 -insert reconnect : +1 +insert disconnect-with-retry +insert reconnect loggedservermsg 0 1 < ERROR :closing Link: (connection timed out) log 1 $ connection_state set to: [closing Link: (connection timed out)] -insert disconnect-with-retry : +1 -insert reconnect : +1 +insert disconnect-with-retry +insert reconnect loggedservermsg 0 1 < ERROR :Closing link: (Ping timeout: 240 seconds) log 1 $ connection_state set to: [Closing link: (Ping timeout: 240 seconds)] -insert disconnect-with-retry : +1 +insert disconnect-with-retry diff --git a/src/tests/pingpong.test b/src/tests/pingpong.test index d25a5e9..b5d571b 100644 --- a/src/tests/pingpong.test +++ b/src/tests/pingpong.test @@ -14,16 +14,16 @@ log 1 > NICK :foo × full-timeout # ping on timeout, go on as normal if PONG received -insert trigger-ping : +0 +insert trigger-ping loggedservermsg 0 1 < :*.?.net PONG *.?.net :what's up? loggedservermsg 0 1 < :*.?.net NOTICE * :*** Looking up your ident... log 2 < (server) *** Looking up your ident... # another timeout instead of pong? disconnect -insert trigger-ping : +0 +insert trigger-ping servermsg 0 timeout servermsg 0 no timely PONG from server log 1 $ connection_state set to: [broken: no timely PONG from server] -insert isupport-clear : +1 +insert isupport-clear log 1 $ connection_state set to: [] log 2 $ DISCONNECTED log 1 $ will retry connecting in 1 seconds @@ -35,7 +35,7 @@ log 1 > PING :what's up? × > /connect foo.bar.baz foo:bar baz:foobarbazquux -insert isupport-clear : +1 +insert isupport-clear log 1 $ caps cleared log 1 $ users cleared log 1 $ channels cleared @@ -47,18 +47,18 @@ log 1 $ user_wanted set to: [foobarbazquux] log 1 $ realname set to: [baz] log 1 $ password set to: [bar] log 1 $ port set to: [6697] -insert conn : +1 +insert conn # ensure we PONG properly loggedservermsg 0 1 < PING :? log 1 > PONG :? -insert full-timeout : +0 +insert full-timeout # on re-connect, ensure timer cleared, i.e. only 2nd time-out will disconnect > /window 1 > /reconnect -insert conn :2 +1 +insert conn :2 log 2 $ CONNECTED -insert conn 3: +1 -insert full-timeout : +0 +insert conn 3: +insert full-timeout diff --git a/src/tests/test.test b/src/tests/test.test index 04867f6..5cf281b 100644 --- a/src/tests/test.test +++ b/src/tests/test.test @@ -260,7 +260,7 @@ log 5 $ foo1!~foobarbaz@baz.bar.foo quits: Client Quit log 1 $ channels:#testtest:exits:me cleared loggedservermsg 0 1 < ERROR :Closing link: (~foobarbaz@baz.bar.foo) [Quit: ircplom says bye] log 1 $ connection_state set to: [Closing link: (~foobarbaz@baz.bar.foo) [Quit: ircplom says bye]] -insert isupport-clear : +1 +insert isupport-clear log 1 $ caps cleared log 1 $ channels cleared log 1 $ connection_state set to: [] @@ -288,7 +288,7 @@ log , $ DISCONNECTED # on /connect init databases, log in new windows > /connect foo.bar.baz foo:bar baz:foobarbazquux -insert standard-clear : +1 +insert standard-clear # connect with values set by /connect, init CAP negotation log 1 $ hostname set to: [foo.bar.baz] @@ -297,10 +297,10 @@ log 1 $ nick_wanted set to: [foo] log 1 $ user_wanted set to: [foobarbazquux] log 1 $ realname set to: [baz] log 1 $ password set to: [bar] -insert conn_init_0 : +1 +insert conn_init_0 -insert conn_init_1 : +0 -insert conn_init_2 : +0 +insert conn_init_1 +insert conn_init_2 # check difference in available commands when switching to client window > /join #test @@ -338,7 +338,7 @@ log 1 # /window.prompt.scroll DIRECTION log 1 # /window.raw VERB [PARAMS_STR] log 1 # /window.reconnect -insert during_conn : +0 +insert during_conn # test setting up second client, but 432 irrecoverably > /connect baz.bar.foo ?foo foo:foo @@ -373,11 +373,11 @@ log 9 $ will retry connecting in 1 seconds # check that (save TUI tests assuming start on window 0, and no 4 yet) on reconnect, all the same effects can be expected > /reconnect -insert conn_init_0 1:3 +1 +insert conn_init_0 1:3 log 2,3,4,5,6,7 $ CONNECTED -insert conn_init_0 4: +1 -insert conn_init_1 : +0 -insert conn_init_2 :1 +0 +insert conn_init_0 4: +insert conn_init_1 +insert conn_init_2 :1 log 1 > JOIN :#testtest -insert conn_init_2 1: +0 +insert conn_init_2 1: insert during_conn : +0 diff --git a/src/tests/tui_draw.test b/src/tests/tui_draw.test index 185140d..07b3803 100644 --- a/src/tests/tui_draw.test +++ b/src/tests/tui_draw.test @@ -72,64 +72,64 @@ line 21 on_black,bright_white,reverse vvv [29] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv × status-[0]-prompt line 22 on_black,bright_white :start)=====================================================================([0]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0]-1-prompt line 22 on_black,bright_white :start)===================================================================([0] 1§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0]-1:2-prompt line 22 on_black,bright_white :start)===============================================================([0] (1:2)§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1:2]-prompt line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:2)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0]-1:4-prompt line 22 on_black,bright_white :start)===============================================================([0] (1:4)§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1:4]-prompt line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:4)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0]-1:6-prompt line 22 on_black,bright_white :start)===============================================================([0] (1:6)§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1:6]-prompt line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:6)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1:7]-prompt line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:7)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1:18]-prompt line 22 on_black,bright_white foo.bar.baz:debug)===================================================(0 [(1:18)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0]-1:29-prompt line 22 on_black,bright_white :start)==============================================================([0] (1:29)§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1:29]-prompt line 22 on_black,bright_white foo.bar.baz:debug)===================================================(0 [(1:29)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0]-1:32-prompt line 22 on_black,bright_white :start)==============================================================([0] (1:32)§§ -insert prompt-empty : +23 +insert prompt-empty × status-0-[1]-prompt line 22 on_black,bright_white foo.bar.baz:debug)========================================================(0 [1]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0:1]-prompt line 22 on_black,bright_white :start)=================================================================([(0:1)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0:1]-1-prompt line 22 on_black,bright_white :start)===============================================================([(0:1)] 1§§ -insert prompt-empty : +23 +insert prompt-empty × status-0:1-[1]-prompt line 22 on_black,bright_white foo.bar.baz:debug)====================================================((0:1) [1]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0:1]-1:19-prompt line 22 on_black,bright_white :start)==========================================================([(0:1)] (1:19)§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0:3]-prompt line 22 on_black,bright_white :start)=================================================================([(0:3)]§§ -insert prompt-empty : +23 +insert prompt-empty × status-[0:12]-prompt line 22 on_black,bright_white :start)================================================================([(0:12)]§§ -insert prompt-empty : +23 +insert prompt-empty × history_0 line 0 on_black,bright_white 20§§-§§-§§ §§ @@ -247,65 +247,65 @@ line 78 on_black,bright_green > §§:§§:§§ PONG :23 × -insert lines-empty : +0 -insert status-[0]-prompt : +22 +insert lines-empty +insert status-[0]-prompt # nothing happening on empty command input > -insert lines-empty : +0 -insert status-[0]-prompt : +22 +insert lines-empty +insert status-[0]-prompt # check scrolling on empty history does nothing > /window.history.scroll up -insert lines-empty : +0 -insert status-[0]-prompt : +22 +insert lines-empty +insert status-[0]-prompt > /window.history.scroll down -insert lines-empty : +0 -insert status-[0]-prompt : +22 +insert lines-empty +insert status-[0]-prompt # non-empty command input starts log at bottom, with date above it > foo log 0 # invalid prompt command: not prefixed by / -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :2 +20 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # check scrolling on history merely 2 lines long won't do anything either > /window.history.scroll up -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :2 +20 -insert status-[0]-prompt : +22 +insert status-[0]-prompt > /window.history.scroll down -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :2 +20 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # further inputs grow log upwards > /foo log 0 # invalid prompt command: /foo unknown -insert lines-empty :19 +0 +insert lines-empty :19 insert history_0 :3 +19 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # check scrolling up does something on history 3 lines long > /window.history.scroll up -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-2 : +21 -insert status-[0]-prompt : +22 +insert scrolldown-2 +insert status-[0]-prompt # check scrolling down on 3-lines history > /window.history.scroll down -insert lines-empty :19 +0 +insert lines-empty :19 insert history_0 :3 +19 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # check history growing below up-scroll > /window.history.scroll up -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-2 : +21 -insert status-[0]-prompt : +22 +insert scrolldown-2 +insert status-[0]-prompt > /help log 0 # commands available in this window: log 0 # /connect HOST_PORT [NICKNAME_PW] [REALNAME_USERNAME] @@ -319,35 +319,35 @@ log 0 # /window.paste log 0 # /window.prompt.backspace log 0 # /window.prompt.move_cursor DIRECTION log 0 # /window.prompt.scroll DIRECTION -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-14 : +21 -insert status-[0:12]-prompt : +22 +insert scrolldown-14 +insert status-[0:12]-prompt # check scroll-down on newer history longer than half a screen width does not fully land at bottom > /window.history.scroll down -insert lines-empty :9 +0 +insert lines-empty :9 insert history_0 :12 +9 -insert scrolldown-3 : +21 -insert status-[0:3]-prompt : +22 +insert scrolldown-3 +insert status-[0:3]-prompt # check previous scroll-down not hitting bottom be fully reversible > /window.history.scroll up -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-14 : +21 -insert status-[0:3]-prompt : +22 +insert scrolldown-14 +insert status-[0:3]-prompt > /window.history.scroll down -insert lines-empty :9 +0 +insert lines-empty :9 insert history_0 :12 +9 -insert scrolldown-3 : +21 -insert status-[0:3]-prompt : +22 +insert scrolldown-3 +insert status-[0:3]-prompt # scroll to bottom, check history still growing up even beyond upper fold > /window.history.scroll down -insert lines-empty :7 +0 +insert lines-empty :7 insert history_0 :15 +7 -insert status-[0]-prompt : +22 +insert status-[0]-prompt > /0 log 0 # invalid prompt command: /0 unknown > /1 @@ -365,19 +365,19 @@ log 0 # invalid prompt command: /6 unknown > /7 log 0 # invalid prompt command: /7 unknown insert history_0 1:23 +0 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # check scroll-down even with long history does nothing > /window.history.scroll down insert history_0 1:23 +0 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # quick look one scroll up to check single-scroll increase of below-scroll count (when up-scroll not limited, and all lines un-wrapped) > /window.history.scroll up -insert lines-empty :9 +0 +insert lines-empty :9 insert history_0 :12 +9 -insert scrolldown-11 : +21 -insert status-[0]-prompt : +22 +insert scrolldown-11 +insert status-[0]-prompt # check wrapping > /window.history.scroll down @@ -386,55 +386,55 @@ log 0 # invalid prompt command: /foo_0123456789_0123456789_0123456789 unknown > /foo_0123456789_0123456789_0123456789_ log 0 # invalid prompt command: /foo_0123456789_0123456789_0123456789_ unknown insert history_0 4:26 +0 -insert status-[0]-prompt : +22 +insert status-[0]-prompt # check scroll-up over wrapped moves up less history lines than screen lines > /window.history.scroll up -insert lines-empty :6 +0 +insert lines-empty :6 insert history_0 :15 +6 -insert scrolldown-10 : +21 -insert status-[0]-prompt : +22 +insert scrolldown-10 +insert status-[0]-prompt # check scroll-down fully reversible even if over wrapped > /window.history.scroll down insert history_0 4:26 +0 -insert status-[0]-prompt : +22 +insert status-[0]-prompt > /window.history.scroll up -insert lines-empty :6 +0 +insert lines-empty :6 insert history_0 :15 +6 -insert scrolldown-10 : +21 -insert status-[0]-prompt : +22 +insert scrolldown-10 +insert status-[0]-prompt # check wrapped input only increases below-scroll count by one > /bar_0123456789_0123456789_0123456789_ log 0 # invalid prompt command: /bar_0123456789_0123456789_0123456789_ unknown -insert lines-empty :6 +0 +insert lines-empty :6 insert history_0 :15 +6 -insert scrolldown-11 : +21 -insert status-[0:1]-prompt : +22 +insert scrolldown-11 +insert status-[0:1]-prompt # check scroll-down over wrapped will snap down to bottom of wrapped > /window.history.scroll down insert history_0 5:26 +0 -insert scrolldown-1 : +21 -insert status-[0:1]-prompt : +22 +insert scrolldown-1 +insert status-[0:1]-prompt # # check scrolls-up over longer history until top > /window.history.scroll up -insert lines-empty :6 +0 +insert lines-empty :6 insert history_0 :15 +6 -insert scrolldown-11 : +21 -insert status-[0:1]-prompt : +22 +insert scrolldown-11 +insert status-[0:1]-prompt > /window.history.scroll up -insert lines-empty :17 +0 +insert lines-empty :17 insert history_0 :3 +17 -insert scrolldown-22 : +21 -insert status-[0:1]-prompt : +22 +insert scrolldown-22 +insert status-[0:1]-prompt > /window.history.scroll up -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-25 : +21 -insert status-[0:1]-prompt : +22 +insert scrolldown-25 +insert status-[0:1]-prompt # check that triggering creation of new window with new lines adds it to status, with unread-lines count > /connect foo.bar.baz foo bar:baz @@ -458,64 +458,64 @@ log , $ CONNECTED log 1 > CAP LS :302 log 1 > USER baz 0 * :bar log 1 > NICK :foo -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-25 : +21 -insert status-[0:1]-1:19-prompt : +22 +insert scrolldown-25 +insert status-[0:1]-1:19-prompt # check switch to other window, updates to status line (movement of brackets, clearing of own unread-lines count) > /window 1 -insert lines-empty :3 +0 +insert lines-empty :3 insert history_1 :19 +3 -insert status-0:1-[1]-prompt : +22 +insert status-0:1-[1]-prompt # check switch-back to window 0, retaining clearing of window 1's unread-lines count > /window 0 -insert lines-empty :20 +0 +insert lines-empty :20 insert history_0 :1 +20 -insert scrolldown-25 : +21 -insert status-[0:1]-1-prompt : +22 +insert scrolldown-25 +insert status-[0:1]-1-prompt # check that on full scroll-down, we now have a bookmark above the newest lines not previously scrolled into > /window.history.scroll down -insert lines-empty :9 +0 +insert lines-empty :9 insert history_0 :12 +9 -insert scrolldown-14 : +21 -insert status-[0:1]-1-prompt : +22 +insert scrolldown-14 +insert status-[0:1]-1-prompt > /window.history.scroll down insert history_0 2:23 +0 -insert scrolldown-3 : +21 -insert status-[0:1]-1-prompt : +22 +insert scrolldown-3 +insert status-[0:1]-1-prompt > /window.history.scroll down insert history_0 7:26 +0 insert bookmark : +19 insert history_0 26:28 +20 -insert status-[0]-1-prompt : +22 +insert status-[0]-1-prompt # check that scrolling non-bottom bookmark out of sight, then scrolling it back into view again does not by itself move its position in the log history > /window.history.scroll up -insert lines-empty :3 +0 +insert lines-empty :3 insert history_0 :18 +3 -insert scrolldown-8 : +21 -insert status-[0]-1-prompt : +22 +insert scrolldown-8 +insert status-[0]-1-prompt > /window.history.scroll down insert history_0 7:26 +0 insert bookmark : +19 insert history_0 26:28 +20 -insert status-[0]-1-prompt : +22 +insert status-[0]-1-prompt # check that second switch to new window, previously left on bottom of history, establishes bookmark at bottom of log > /window 1 -insert lines-empty :2 +0 +insert lines-empty :2 insert history_1 :19 +2 insert bookmark : +21 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt # check second switch-back places bookmark at bottom there too, since the newest lines previously succeeding it have now been read by us > /window 0 insert history_0 7:28 +0 insert bookmark : +21 -insert status-[0]-1-prompt : +22 +insert status-[0]-1-prompt # check new lines push bookmark up > /list @@ -525,7 +525,7 @@ log 0 # 1) foo.bar.baz:debug insert history_0 10:28 +0 insert bookmark : +18 insert history_0 28:31 +19 -insert status-[0]-1-prompt : +22 +insert status-[0]-1-prompt # check new lines growing in other window, one of which long enough to wrap, to be re-start count in status (with wrapped only as single) loggedservermsg 0 1 < PING :? @@ -535,40 +535,40 @@ log 1 > PONG :9 123456789 123456789 123456789 123456789 123456789 123456789 1234 insert history_0 10:28 +0 insert bookmark : +18 insert history_0 28:31 +19 -insert status-[0]-1:4-prompt : +22 +insert status-[0]-1:4-prompt # check that switching to window with new lines, but left scroll-to-bottom, keeps the scroll-to-bottom, keeps bookmark after last line previously seen there > /window 1 insert history_1 4:19 +0 insert bookmark : +15 insert history_1 19:25 +16 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt ### # check that growth below scroll does not by itself re-position bookmark in history > /window.history.scroll up loggedservermsg 0 1 < PING :foo log 1 > PONG :foo -insert lines-empty :6 +0 +insert lines-empty :6 insert history_1 0:15 +6 -insert scrolldown-10 : +21 -insert status-0-[1:2]-prompt : +22 +insert scrolldown-10 +insert status-0-[1:2]-prompt > /window.history.scroll down insert history_1 5:19 +0 insert bookmark : +14 insert history_1 19:25 +15 -insert scrolldown-2 : +21 -insert status-0-[1:2]-prompt : +22 +insert scrolldown-2 +insert status-0-[1:2]-prompt # check that with new lines left unread, switch away and back into window moves bookmark below newest read line, counts unread lines in status > /window 0 insert history_0 10:31 +0 insert bookmark : +21 -insert status-[0]-1:2-prompt : +22 +insert status-[0]-1:2-prompt > /window 1 insert history_1 5:25 +0 insert bookmark : +20 -insert scrolldown-2 : +21 -insert status-0-[1:2]-prompt : +22 +insert scrolldown-2 +insert status-0-[1:2]-prompt # check that growing lines below scroll in other preserves non-bottom bookmark (left in sight on previous window leave) > /window 0 @@ -576,40 +576,40 @@ loggedservermsg 0 1 < PING :bar log 1 > PONG :bar insert history_0 10:31 +0 insert bookmark : +21 -insert status-[0]-1:4-prompt : +22 +insert status-[0]-1:4-prompt > /window 1 insert history_1 5:25 +0 insert bookmark : +20 -insert scrolldown-4 : +21 -insert status-0-[1:4]-prompt : +22 +insert scrolldown-4 +insert status-0-[1:4]-prompt # check same applies when leaving affected window with bookmark out-of-sight > /window.history.scroll up -insert lines-empty :6 +0 +insert lines-empty :6 insert history_1 :15 +6 -insert scrolldown-12 : +21 -insert status-0-[1:4]-prompt : +22 +insert scrolldown-12 +insert status-0-[1:4]-prompt > /window 0 loggedservermsg 0 1 < PING :baz log 1 > PONG :baz insert history_0 10:31 +0 insert bookmark : +21 -insert status-[0]-1:6-prompt : +22 +insert status-[0]-1:6-prompt > /window 1 -insert lines-empty :6 +0 +insert lines-empty :6 insert history_1 :15 +6 -insert scrolldown-14 : +21 -insert status-0-[1:6]-prompt : +22 +insert scrolldown-14 +insert status-0-[1:6]-prompt > /window.history.scroll down insert history_1 5:25 +0 insert bookmark : +20 -insert scrolldown-6 : +21 -insert status-0-[1:6]-prompt : +22 +insert scrolldown-6 +insert status-0-[1:6]-prompt > /window.history.scroll down insert history_1 10:25 +0 insert bookmark : +15 insert history_1 25:31 +16 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt # check log growth beyond max depth only remarkable after scrolling up to limit loggedservermsg 0 1 < PING :0 @@ -617,35 +617,35 @@ log 1 > PONG :0 insert history_1 12:25 +0 insert bookmark : +13 insert history_1 25:33 +14 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt > /window.history.scroll up insert history_1 2:23 +0 -insert scrolldown-9 : +21 -insert status-0-[1]-prompt : +22 +insert scrolldown-9 +insert status-0-[1]-prompt > /window.history.scroll up -insert lines-empty :10 +0 +insert lines-empty :10 insert history_1 1:12 +10 -insert scrolldown-19 : +21 -insert status-0-[1]-prompt : +22 +insert scrolldown-19 +insert status-0-[1]-prompt > /window.history.scroll up -insert lines-empty :20 +0 +insert lines-empty :20 insert history_1 1:2 +20 -insert scrolldown-29 : +21 -insert status-0-[1]-prompt : +22 +insert scrolldown-29 +insert status-0-[1]-prompt # check cut-off log growth seen from topmost scroll not affecting scrolldown count, but unread-lines status loggedservermsg 0 1 < PING :0 log 1 > PONG :0 -insert lines-empty :20 +0 +insert lines-empty :20 insert history_1 3:4 +20 -insert scrolldown-29 : +21 -insert status-0-[1:2]-prompt : +22 +insert scrolldown-29 +insert status-0-[1:2]-prompt # check unread-lines count potentially growing above max log depth if in other window > /window 0 insert history_0 10:31 +0 insert bookmark : +21 -insert status-[0]-1:2-prompt : +22 +insert status-[0]-1:2-prompt loggedservermsg 0 1 < PING :1 log 1 > PONG :1 loggedservermsg 0 1 < PING :2 @@ -678,59 +678,59 @@ loggedservermsg 0 1 < PING :15 log 1 > PONG :15 insert history_0 10:31 +0 insert bookmark : +21 -insert status-[0]-1:32-prompt : +22 +insert status-[0]-1:32-prompt # check switching into window scrolled-top with more unread lines than max log depth shrinks former to latter, and scrolling down no bookmark is to be found > /window 1 -insert lines-empty :20 +0 +insert lines-empty :20 insert history_1 33:34 +20 -insert scrolldown-29 : +21 -insert status-0-[1:29]-prompt : +22 +insert scrolldown-29 +insert status-0-[1:29]-prompt > /window.history.scroll down -insert lines-empty :9 +0 +insert lines-empty :9 insert history_1 33:45 +9 -insert scrolldown-18 : +21 -insert status-0-[1:18]-prompt : +22 +insert scrolldown-18 +insert status-0-[1:18]-prompt > /window.history.scroll down insert history_1 35:56 +0 -insert scrolldown-7 : +21 -insert status-0-[1:7]-prompt : +22 +insert scrolldown-7 +insert status-0-[1:7]-prompt > /window.history.scroll down insert history_1 41:61 +0 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt # check bookmark remains absent with log growing while scrolled to bottom, … loggedservermsg 0 1 < PING :16 log 1 > PONG :16 insert history_1 43:63 +0 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt # … as well as if further growth happens below scroll > /window.history.scroll up -insert lines-empty :2 +0 +insert lines-empty :2 insert history_1 35:54 +2 -insert scrolldown-11 : +21 -insert status-0-[1]-prompt : +22 +insert scrolldown-11 +insert status-0-[1]-prompt loggedservermsg 0 1 < PING :17 log 1 > PONG :17 -insert lines-empty :4 +0 +insert lines-empty :4 insert history_1 37:54 +4 -insert scrolldown-13 : +21 -insert status-0-[1:2]-prompt : +22 +insert scrolldown-13 +insert status-0-[1:2]-prompt > /window.history.scroll down insert history_1 44:65 +0 -insert scrolldown-2 : +21 -insert status-0-[1:2]-prompt : +22 +insert scrolldown-2 +insert status-0-[1:2]-prompt > /window.history.scroll down insert history_1 45:67 +0 -insert status-0-[1]-prompt : +22 +insert status-0-[1]-prompt # check unread-lines status not growing beyond max log if within active window, and … > /window.history.scroll up -insert lines-empty :2 +0 +insert lines-empty :2 insert history_1 37:54 +2 -insert scrolldown-11 : +21 -insert status-0-[1]-prompt : +22 +insert scrolldown-11 +insert status-0-[1]-prompt loggedservermsg 0 1 < PING :18 log 1 > PONG :18 loggedservermsg 0 1 < PING :19 @@ -761,26 +761,26 @@ loggedservermsg 0 1 < PING :31 log 1 > PONG :31 loggedservermsg 0 1 < PING :32 log 1 > PONG :32 -insert lines-empty :20 +0 +insert lines-empty :20 insert history_1 67:68 +20 -insert scrolldown-29 : +21 -insert status-0-[1:29]-prompt : +22 +insert scrolldown-29 +insert status-0-[1:29]-prompt # … setting bookmark visible after switching back-and-forth > /window 0 insert history_0 10:31 +0 insert bookmark : +21 -insert status-[0]-1:29-prompt : +22 +insert status-[0]-1:29-prompt > /window 1 -insert lines-empty :19 +0 +insert lines-empty :19 insert history_1 67:68 +19 insert bookmark : +20 -insert scrolldown-29 : +21 -insert status-0-[1:29]-prompt : +22 +insert scrolldown-29 +insert status-0-[1:29]-prompt > /window.history.scroll down -insert lines-empty :8 +0 +insert lines-empty :8 insert history_1 67:68 +8 insert bookmark : +9 insert history_1 68:79 +10 -insert scrolldown-18 : +21 -insert status-0-[1:18]-prompt : +22 +insert scrolldown-18 +insert status-0-[1:18]-prompt