summaryrefslogtreecommitdiff
path: root/lib/common_test/test
diff options
context:
space:
mode:
authorSiri Hansen <siri@erlang.org>2019-01-31 13:29:41 +0100
committerSiri Hansen <siri@erlang.org>2019-01-31 13:29:41 +0100
commit5cf3304d44ecb8ee28045d44377e2e9747e80f26 (patch)
tree9d69bff44261f7fb9cc058f55cff18170b992969 /lib/common_test/test
parentb55d02e92d7fb8244da333ee5bbd794aa6090ff5 (diff)
downloaderlang-5cf3304d44ecb8ee28045d44377e2e9747e80f26.tar.gz
[ct] Add option {newline,string()} to ct_telnet:cmd and ct_telnet:send
By default, each command is appended with "\n", but in some cases a command must end with "\r\n" to evaluate correctly. This can now be specified with option {newline,"\r\n"}.
Diffstat (limited to 'lib/common_test/test')
-rw-r--r--lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl b/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
index 985fa40ad2..34df57027e 100644
--- a/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
+++ b/lib/common_test/test/ct_telnet_SUITE_data/ct_telnet_own_server_SUITE.erl
@@ -58,7 +58,8 @@ all() ->
server_speaks,
server_disconnects,
newline_ayt,
- newline_break
+ newline_break,
+ newline_string
].
groups() ->
@@ -393,3 +394,11 @@ newline_break(_) ->
"> " = lists:flatten(R),
ok = ct_telnet:close(Handle),
ok.
+
+%% Test option {newline,String} to specify an own newline, e.g. "\r\n"
+newline_string(_) ->
+ {ok, Handle} = ct_telnet:open(telnet_server_conn1),
+ ok = ct_telnet:send(Handle, "echo hello-", [{newline,"own_nl\n"}]),
+ {ok,["hello-own_nl"]} = ct_telnet:expect(Handle, ["hello-own_nl"]),
+ ok = ct_telnet:close(Handle),
+ ok.