diff options
author | Serge Aleynikov <[email protected]> | 2015-06-02 08:44:23 -0400 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-10-26 09:05:30 +0100 |
commit | 285b4fa13914dc4748c1020213a9c65cad3d2738 (patch) | |
tree | 35e3c451519fe0f1d5d0c6be53d6aa58ffca1d7a /lib/kernel/test/bif_SUITE.erl | |
parent | a76cc1d337c0bf44ecefebeccac2d08e496ba7e8 (diff) | |
download | otp-285b4fa13914dc4748c1020213a9c65cad3d2738.tar.gz otp-285b4fa13914dc4748c1020213a9c65cad3d2738.tar.bz2 otp-285b4fa13914dc4748c1020213a9c65cad3d2738.zip |
erts: Add {line_delimiter, byte()} option to inet:setopts/2
A new {line_delimiter, byte()} option allows line-oriented TCP-based protocols
to use a custom line delimiting character. It is to be used in conjunction
with {packet, line}.
This option also works with erlang:decode_packet/3 when its first argument
is 'line'.
Diffstat (limited to 'lib/kernel/test/bif_SUITE.erl')
-rw-r--r-- | lib/kernel/test/bif_SUITE.erl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/kernel/test/bif_SUITE.erl b/lib/kernel/test/bif_SUITE.erl index c3840f3d16..dd3010567a 100644 --- a/lib/kernel/test/bif_SUITE.erl +++ b/lib/kernel/test/bif_SUITE.erl @@ -33,6 +33,7 @@ spawn_failures/1, run_fun/1, + decode_packet_delim/1, wilderness/1]). -export([init_per_testcase/2, end_per_testcase/2]). @@ -516,6 +517,15 @@ fetch_proc_vals(Pid) -> {value,{heap_size,HS}} = lists:keysearch(heap_size, 1, PI), ?line {Ls, P, FA, HS}. +decode_packet_delim(doc) -> + ["Test erlang:packet_delim/3 with {line_delimiter,0} option"]; +decode_packet_delim(suite) -> + []; +decode_packet_delim(Config) when is_list(Config) -> + {ok,<<"abc",0>>,<<"efg",0>>} = + erlang:decode_packet(line, <<"abc",0,"efg",0>>, [{line_delimiter, 0}]), + {more, undefined} = erlang:decode_packet(line, <<"abc",0,"efg",0>>, []). + % This testcase should probably be moved somewhere else wilderness(doc) -> ["Test that memory allocation command line options affecting the" |