diff options
author | Fredrik Gustafsson <[email protected]> | 2013-08-26 10:27:37 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-08-26 10:27:37 +0200 |
commit | e1e19bdcb4ba8032a4771aaf022c1da766a9d91b (patch) | |
tree | ebd851c1e45c67ec1a7a72b8c379b0f8e94f7c4e /lib/kernel/test | |
parent | fe79e6ec46339aa05af2f8c33860a8f05b5eb5f1 (diff) | |
parent | 5e2876e4524eb7de61a6d3661e0bfe1a22472668 (diff) | |
download | otp-e1e19bdcb4ba8032a4771aaf022c1da766a9d91b.tar.gz otp-e1e19bdcb4ba8032a4771aaf022c1da766a9d91b.tar.bz2 otp-e1e19bdcb4ba8032a4771aaf022c1da766a9d91b.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/interactive_shell_SUITE.erl | 51 |
1 files changed, 48 insertions, 3 deletions
diff --git a/lib/kernel/test/interactive_shell_SUITE.erl b/lib/kernel/test/interactive_shell_SUITE.erl index d7d9434b1f..a375adceea 100644 --- a/lib/kernel/test/interactive_shell_SUITE.erl +++ b/lib/kernel/test/interactive_shell_SUITE.erl @@ -22,7 +22,7 @@ init_per_group/2,end_per_group/2, get_columns_and_rows/1, exit_initial/1, job_control_local/1, job_control_remote/1, - job_control_remote_noshell/1]). + job_control_remote_noshell/1,ctrl_keys/1]). -export([init_per_testcase/2, end_per_testcase/2]). %% For spawn @@ -41,7 +41,8 @@ suite() -> [{ct_hooks,[ts_install_cth]}]. all() -> [get_columns_and_rows, exit_initial, job_control_local, - job_control_remote, job_control_remote_noshell]. + job_control_remote, job_control_remote_noshell, + ctrl_keys]. groups() -> []. @@ -289,7 +290,51 @@ job_control_remote_noshell(Config) when is_list(Config) -> ?line stop_noshell_node(NSNode), ?line Res end. - + +ctrl_keys(suite) -> []; +ctrl_keys(doc) -> ["Tests various control keys"]; +ctrl_keys(_Conf) when is_list(_Conf) -> + Cu=[$\^u], + Cw=[$\^w], + Home=[27,$O,$H], + End=[27,$O,$F], + rtnode([{putline,""}, + {putline,"2."}, + {getline,"2"}, + {putline,"\"hello "++Cw++"world\"."}, % test <CTRL>+W + {getline,"\"world\""}, + {putline,"\"hello "++Cu++"\"world\"."}, % test <CTRL>+U + {getline,"\"world\""}, + {putline,"world\"."++Home++"\"hello "}, % test <HOME> + {getline,"\"hello world\""}, + {putline,"world"++Home++"\"hello "++End++"\"."}, % test <END> + {getline,"\"hello world\""}] + ++wordLeft()++wordRight(),[]). + + +wordLeft() -> + L1=[27,27,$[,$D], + L2=[27]++"[5D", + L3=[27]++"[1;5D", + wordLeft(L1)++wordLeft(L2)++wordLeft(L3). + +wordLeft(Chars) -> + End=[27,$O,$F], + [{putline,"\"world\""++Chars++"hello "++End++"."}, + {getline,"\"hello world\""}]. + +wordRight() -> + R1=[27,27,$[,$C], + R2=[27]++"[5C", + R3=[27]++"[1;5C", + wordRight(R1)++wordRight(R2)++wordRight(R3). + +wordRight(Chars) -> + Home=[27,$O,$H], + [{putline,"world"++Home++"\"hello "++Chars++"\"."}, + {getline,"\"hello world\""}]. + + rtnode(C,N) -> rtnode(C,N,[]). rtnode(Commands,Nodename,ErlPrefix) -> |