aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/test/xmerl_SUITE.erl
diff options
context:
space:
mode:
authorLars Thorsen <[email protected]>2011-09-26 11:11:47 +0200
committerLars Thorsen <[email protected]>2011-09-26 11:11:47 +0200
commita5baff1ab34518a5282da7ec9a32ac8ec991d4b4 (patch)
tree0c3950afaa526f7f1cb0f33de91640b0c112506f /lib/xmerl/test/xmerl_SUITE.erl
parentf8f0c5a1bc435fbb9d816323f1f0abfe992a6e3e (diff)
parent97f3a064f27843a9f825210c1c7a27075b7b3ad7 (diff)
downloadotp-a5baff1ab34518a5282da7ec9a32ac8ec991d4b4.tar.gz
otp-a5baff1ab34518a5282da7ec9a32ac8ec991d4b4.tar.bz2
otp-a5baff1ab34518a5282da7ec9a32ac8ec991d4b4.zip
Merge branch 'dev' into major
* dev: [xmerl] Fix streaming bug in xmerl_scan (Thanks to Simon Cornish)
Diffstat (limited to 'lib/xmerl/test/xmerl_SUITE.erl')
-rw-r--r--lib/xmerl/test/xmerl_SUITE.erl23
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/xmerl/test/xmerl_SUITE.erl b/lib/xmerl/test/xmerl_SUITE.erl
index 0c809dbcb6..94c38d4d48 100644
--- a/lib/xmerl/test/xmerl_SUITE.erl
+++ b/lib/xmerl/test/xmerl_SUITE.erl
@@ -58,7 +58,7 @@ groups() ->
{ticket_tests, [],
[ticket_5998, ticket_7211, ticket_7214, ticket_7430,
ticket_6873, ticket_7496, ticket_8156, ticket_8697,
- ticket_9411]},
+ ticket_9411, ticket_9457]},
{app_test, [], [{xmerl_app_test, all}]},
{appup_test, [], [{xmerl_appup_test, all}]}].
@@ -588,7 +588,26 @@ ticket_9411(Config) ->
?line {E, _} = xmerl_scan:string(Xml),
?line {E, _} = xmerl_xsd:validate(E, Schema).
-
+ticket_9457(suite) -> [];
+ticket_9457(doc) ->
+ ["Test that xmerl_scan handles continuation correct when current input runs out at the end of an attribute value"];
+ticket_9457(Config) ->
+ Opts = [{continuation_fun, fun ticket_9457_cont/3, start}, {space, normalize}],
+ ?line {E, _} = xmerl_scan:string([], Opts).
+
+ticket_9457_cont(Continue, Exception, GlobalState) ->
+ case xmerl_scan:cont_state(GlobalState) of
+ start ->
+ G1 = xmerl_scan:cont_state(next, GlobalState),
+ Bytes = "<?xml version=\"1.0\" ?>\r\n<item a=\"b\"",
+ Continue(Bytes, G1);
+ next ->
+ G1 = xmerl_scan:cont_state(last, GlobalState),
+ Bytes = ">blah</item>\r\n",
+ Continue(Bytes, G1);
+ _ ->
+ Exception(GlobalState)
+ end.
%%======================================================================
%% Support Functions