diff options
Diffstat (limited to 'Master/texmf-dist/source/bibtex/biber/t/07-bcfvalidation.t')
-rwxr-xr-x | Master/texmf-dist/source/bibtex/biber/t/07-bcfvalidation.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/bibtex/biber/t/07-bcfvalidation.t b/Master/texmf-dist/source/bibtex/biber/t/07-bcfvalidation.t new file mode 100755 index 00000000000..4bd9baad5bc --- /dev/null +++ b/Master/texmf-dist/source/bibtex/biber/t/07-bcfvalidation.t @@ -0,0 +1,30 @@ +use strict; +use warnings; +use utf8; +no warnings 'utf8'; + +use Test::More tests => 32; +use XML::LibXML; +use Biber; +chdir('t'); + +# Validate all .bcfs used in tests + +# Set up schema +my $CFxmlschema = XML::LibXML::RelaxNG->new(location => '../data/schemata/bcf.rng'); + +foreach my $bcf (<tdata/*.bcf>) { +# Set up XML parser + my $CFxmlparser = XML::LibXML->new(); + + # basic parse and XInclude processing + my $CFxp = $CFxmlparser->parse_file($bcf); + + # XPath context + my $CFxpc = XML::LibXML::XPathContext->new($CFxp); + $CFxpc->registerNs('bcf', 'https://sourceforge.net/projects/biblatex'); + + # Validate against schema. Dies if it fails. + $CFxmlschema->validate($CFxp); + is($@, '', "Validation of $bcf"); +} |