File 0473-ssh-testcase-for-recursive-search-fix.patch of Package erlang

From c205174991068971bb6213e0b207645db91dcba3 Mon Sep 17 00:00:00 2001
From: Jakub Witczak <kuba@erlang.org>
Date: Tue, 19 Sep 2023 17:20:39 +0200
Subject: [PATCH 3/3] ssh: testcase for recursive search fix

---
 lib/ssh/test/ssh_connection_SUITE.erl | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index 8965252ed8..7812376624 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -89,6 +89,7 @@
          start_exec_direct_fun1_read_write_advanced/1,
          start_shell/1,
          new_shell_dumb_term/1,
+         new_shell_xterm_term/1,
          start_shell_pty/1,
          start_shell_exec/1,
          start_shell_exec_direct_fun/1,
@@ -130,6 +131,7 @@ all() ->
      exec_shell_disabled,
      start_shell,
      new_shell_dumb_term,
+     new_shell_xterm_term,
      trap_exit_connect,
      trap_exit_daemon,
      start_shell_pty,
@@ -778,9 +780,26 @@ new_shell_dumb_term(Config) when is_list(Config) ->
                            [<<"\e[;1;4msearch:\e[0m ">>]},
                     Config).
 
+%%--------------------------------------------------------------------
+new_shell_xterm_term(Config) when is_list(Config) ->
+    new_shell_helper(#{term => "xterm",
+                       cmds => ["one_atom_please.\n",
+                                "\^R" % attempt to trigger history search
+                               ],
+                       exp_output =>
+                           [<<"Enter command\r\n">>,
+                            <<"1> ">>,
+                            <<"one_atom_please.\r\n\e[1022D\e[1B">>,
+                            <<"{simple_eval,one_atom_please}\r\n">>,
+                            <<"2> ">>,
+                            <<"\e[3D\e[J">>,
+                            <<"\e[;1;4msearch:\e[0m ">>,
+                            <<"\r\n  one_atom_please.">>]},
+                    Config).
+
 new_shell_helper(#{term := Term, cmds := Cmds,
-                   exp_output := ExpectedOutput,
-                   unexp_output := UnexpectedOutput}, Config) ->
+                   exp_output := ExpectedOutput} = Settings, Config) ->
+    UnexpectedOutput = maps:get(unexp_output, Settings, []),
     PrivDir = proplists:get_value(priv_dir, Config),
     UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
     file:make_dir(UserDir),
-- 
2.35.3

openSUSE Build Service is sponsored by