3855 |
|
|
3856 |
@XMLTests: |
@XMLTests: |
3857 |
@@XMLTest: |
@@XMLTest: |
3858 |
|
@@@QName: xp.syntax.empty.test |
3859 |
|
@@@DEnt: |
3860 |
|
@@@@test:value: \ |
3861 |
|
@@@c:erred: |
3862 |
|
<[[xp:wf-syntax-error]]> { (1, 1); } |
3863 |
|
@@XMLTest: |
3864 |
|
@@@QName: xp.syntax.space.test |
3865 |
|
@@@DEnt: |
3866 |
|
@@@@test:value: \ |
3867 |
|
@@@c:erred: |
3868 |
|
<[[xp:wf-syntax-error]]> { (1, 4); } |
3869 |
|
@@XMLTest: |
3870 |
|
@@@QName: xp.syntax.newlines.test |
3871 |
|
@@@DEnt: |
3872 |
|
@@@@test:value: |
3873 |
|
\ |
3874 |
|
\ |
3875 |
|
\ |
3876 |
|
@@@c:erred: |
3877 |
|
<[[xp:wf-syntax-error]]> { (3, 1); } |
3878 |
|
|
3879 |
|
@@XMLTest: |
3880 |
@@@QName: xp.only.docel.test |
@@@QName: xp.only.docel.test |
3881 |
@@@DEnt: |
@@@DEnt: |
3882 |
@@@@test:value: |
@@@@test:value: |
4949 |
for my $test_data (@$TestData) { |
for my $test_data (@$TestData) { |
4950 |
$test->start_new_test ($test_data->{uri}); |
$test->start_new_test ($test_data->{uri}); |
4951 |
my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}}; |
my $doc_ent = $test_data->{entity}->{$test_data->{root_uri}}; |
4952 |
my $doc = $parser->parse_string ($doc_ent->{<H::test:value>}); |
|
4953 |
try { |
$parser->dom_config->set_parameter ('error-handler' => sub ($$) { |
4954 |
$test->assert_dom_tree_equals |
my (undef, $err) = @_; |
4955 |
(actual_value => $doc, |
my $err_type = $err->type; |
4956 |
expected_hash => $test_data->{dom_tree}); |
if ($test_data->{dom_error}->{$err_type}) { |
4957 |
$test->ok; |
$test->assert_error_equals |
4958 |
} catch Message::Util::IF::DTException with { }; |
(actual_value => $err, |
4959 |
|
expected_hash => pop @{$test_data->{dom_error} |
4960 |
|
->{$err_type}}); |
4961 |
|
} else { # Uncatched error |
4962 |
|
warn $err; |
4963 |
|
} |
4964 |
|
return true; # continue as far as possible |
4965 |
|
}); |
4966 |
|
|
4967 |
|
if ($test_data->{dom_tree}) { # Successful test |
4968 |
|
try { |
4969 |
|
my $doc = $parser->parse_string ($doc_ent->{<H::test:value>}); |
4970 |
|
$test->assert_dom_tree_equals |
4971 |
|
(actual_value => $doc, |
4972 |
|
expected_hash => $test_data->{dom_tree}); |
4973 |
|
my $has_error; |
4974 |
|
for (values %{$test_data->{dom_error}||{}}) { |
4975 |
|
if (@$_) { |
4976 |
|
$test->failure_comment |
4977 |
|
(@$_.' |DOMError|s of type |'. |
4978 |
|
$_->[0]->{type}.'| are not reported'); |
4979 |
|
$has_error = true; |
4980 |
|
} |
4981 |
|
} |
4982 |
|
$has_error ? $test->not_ok : $test->ok; |
4983 |
|
} catch Message::Util::IF::DTException with { |
4984 |
|
# |
4985 |
|
} catch Message::DOM::IF::LSException with { |
4986 |
|
$test->assert_never; |
4987 |
|
}; |
4988 |
|
} else { |
4989 |
|
try { |
4990 |
|
my $doc = $parser->parse_string ($doc_ent->{<H::test:value>}); |
4991 |
|
$test->assert_never; |
4992 |
|
} catch Message::Util::IF::DTException with { |
4993 |
|
# |
4994 |
|
} catch Message::DOM::IF::LSException with { |
4995 |
|
# |
4996 |
|
}; |
4997 |
|
my $has_error; |
4998 |
|
for (values %{$test_data->{dom_error}||{}}) { |
4999 |
|
if (@$_) { |
5000 |
|
$test->failure_comment |
5001 |
|
(@$_.' |DOMError|s of type |'. |
5002 |
|
$_->[0]->{type}.'| are not reported'); |
5003 |
|
$has_error = true; |
5004 |
|
} |
5005 |
|
} |
5006 |
|
$has_error ? $test->not_ok : $test->ok; |
5007 |
|
} |
5008 |
} |
} |
5009 |
|
|
5010 |
@ResourceDef: |
@ResourceDef: |