aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/test/xmerl_sax_stream_SUITE.erl
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2017-05-24 07:32:18 +0200
committerLars Thorsen <[email protected]>2017-05-24 12:54:40 +0200
commitb8f358128742f3a815e39c30a68281246cc1911d (patch)
tree74df9447beea59ed40cde231307602768e3c2163 /lib/xmerl/test/xmerl_sax_stream_SUITE.erl
parentf8ab425800ba3b01251616eb73d5faf22bc63387 (diff)
downloadotp-b8f358128742f3a815e39c30a68281246cc1911d.tar.gz
otp-b8f358128742f3a815e39c30a68281246cc1911d.tar.bz2
otp-b8f358128742f3a815e39c30a68281246cc1911d.zip
[xmerl] Add test cases
Diffstat (limited to 'lib/xmerl/test/xmerl_sax_stream_SUITE.erl')
-rw-r--r--lib/xmerl/test/xmerl_sax_stream_SUITE.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/xmerl/test/xmerl_sax_stream_SUITE.erl b/lib/xmerl/test/xmerl_sax_stream_SUITE.erl
index a306eb66a2..7315f67374 100644
--- a/lib/xmerl/test/xmerl_sax_stream_SUITE.erl
+++ b/lib/xmerl/test/xmerl_sax_stream_SUITE.erl
@@ -40,7 +40,8 @@ all() ->
[
one_document,
two_documents,
- one_document_and_junk
+ one_document_and_junk,
+ end_of_stream
].
%%----------------------------------------------------------------------
@@ -62,6 +63,9 @@ end_per_testcase(_Func, _Config) ->
%%----------------------------------------------------------------------
%% Tests
%%----------------------------------------------------------------------
+
+%%----------------------------------------------------------------------
+%% Send One doc over stream
one_document(Config) ->
Port = 11111,
@@ -107,6 +111,8 @@ one_document(Config) ->
end,
ok.
+%%----------------------------------------------------------------------
+%% Send Two doc over stream
two_documents(Config) ->
Port = 11111,
@@ -152,6 +158,8 @@ two_documents(Config) ->
end,
ok.
+%%----------------------------------------------------------------------
+%% Send one doc and then junk on stream
one_document_and_junk(Config) ->
Port = 11111,
@@ -196,6 +204,13 @@ one_document_and_junk(Config) ->
ct:fail("Timeout")
end,
ok.
+
+%%----------------------------------------------------------------------
+%% Test of continuation when end of stream
+end_of_stream(Config) ->
+ Stream = <<"<?xml version=\"1.0\" encoding=\"utf-8\"?><a>hej</a>">>,
+ {ok, undefined, <<>>} = xmerl_sax_parser:stream(Stream, []),
+ ok.
%%----------------------------------------------------------------------
%% Utility functions