aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/test/xmerl_sax_SUITE.erl
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2014-01-16 12:21:20 +0100
committerMagnus Lidén <[email protected]>2014-01-21 16:38:28 +0100
commite750b2aa3698d5bd7f4a9d23f568031e34c6ba2a (patch)
tree57dbc03e9e25bbccc55335148615116a7e58c781 /lib/xmerl/test/xmerl_sax_SUITE.erl
parentfbcf11307e6e5eb9685fe6603ec2935638217423 (diff)
downloadotp-e750b2aa3698d5bd7f4a9d23f568031e34c6ba2a.tar.gz
otp-e750b2aa3698d5bd7f4a9d23f568031e34c6ba2a.tar.bz2
otp-e750b2aa3698d5bd7f4a9d23f568031e34c6ba2a.zip
[xmerl] Fix problem with header of next XML document is in the buffer
when using xmerl_sax_parser:stream/2 function.
Diffstat (limited to 'lib/xmerl/test/xmerl_sax_SUITE.erl')
-rw-r--r--lib/xmerl/test/xmerl_sax_SUITE.erl35
1 files changed, 32 insertions, 3 deletions
diff --git a/lib/xmerl/test/xmerl_sax_SUITE.erl b/lib/xmerl/test/xmerl_sax_SUITE.erl
index 563bbaaa06..10a96f470b 100644
--- a/lib/xmerl/test/xmerl_sax_SUITE.erl
+++ b/lib/xmerl/test/xmerl_sax_SUITE.erl
@@ -67,7 +67,8 @@ end_per_testcase(_Func,_Config) ->
%% Description: Checks that end of document is checked properly when continuation fun is missing.
ticket_8213(suite) -> [];
ticket_8213(_Config) ->
- ?line {ok,ok,[]} = xmerl_sax_parser:stream("<elem/>", [{event_fun, fun (_E,_,_) -> ok end}]).
+ ?line {ok,ok,[]} = xmerl_sax_parser:stream("<elem/>", [{event_fun, fun (_E,_,_) -> ok end}]),
+ ok.
%%----------------------------------------------------------------------
@@ -86,7 +87,35 @@ ticket_8214(_Config) ->
({startElement, _, "elem",_,_}, _,_) ->
throw({test, "Error in startElement tuple"});
(_E,_,_) -> ok
- end}]).
+ end}]),
+ ok.
+
+%%----------------------------------------------------------------------
+%% Test Case
+%% ID: ticket_8214
+%% Description: Checks that attributes with default namespace don't get [] in NS field.
+ticket_11551(suite) -> [];
+ticket_11551(Config) ->
+ Stream1 = <<"<?xml version=\"1.0\" encoding=\"utf-8\" ?>
+<a>hej</a>
+<?xml version=\"1.0\" encoding=\"utf-8\" ?>
+<a>hej</a>">>,
+ ?line {ok, undefined, <<"<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream1, []),
+ Stream2= <<"<?xml version=\"1.0\" encoding=\"utf-8\" ?>
+<a>hej</a>
+
+
+<?xml version=\"1.0\" encoding=\"utf-8\" ?>
+<a>hej</a>">>,
+ ?line {ok, undefined, <<"<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream2, []),
+ Stream3= <<"<a>hej</a>
+
+<?xml version=\"1.0\" encoding=\"utf-8\" ?>
+<a>hej</a>">>,
+ ?line {ok, undefined, <<"<?xml", _/binary>>} = xmerl_sax_parser:stream(Stream3, []),
+ ok.
+
+
%%----------------------------------------------------------------------
%% Bug test cases
@@ -99,7 +128,7 @@ all() ->
[{group, bugs}].
groups() ->
- [{bugs, [], [ticket_8213, ticket_8214]}].
+ [{bugs, [], [ticket_8213, ticket_8214, ticket_11551]}].
init_per_group(_GroupName, Config) ->
Config.