Skip to content

Commit

Permalink
Fix bsml_sax.t by using lax SAX parser
Browse files Browse the repository at this point in the history
The test `t/SeqIO/bsml_sax.t` may fail on systems with older versions of
`XML::LibXML` due to a 404 for the external BSML DTD's URL. This gives
the error:

```
http error : Unknown IO error
t/SeqIO/bsml_sax.t ..................
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 14/15 subtests
```

Uses lax parser XML::SAX::PurePerl within the test which does not try to
fetch the external DTD.

Fixes <#376>.

Connects with <#379>.
  • Loading branch information
zmughal authored and cjfields committed May 10, 2023
1 parent 7adc3aa commit a809db2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Summary of important user-visible changes for BioPerl
{{$NEXT}}
* Add minimum dependency on base.pm v2.18. Fixes bug in some cases when
using SUPER::new() [#307].
* Fix test for BSML SAX by using lax parser XML::SAX::PurePerl since
the external DTD URL now 404s [#376].

1.7.8 2021-02-02 23:02:18-06:00 America/Chicago
* Bio::SeqIO::interpro has been moved to a separate repository to
Expand Down
5 changes: 5 additions & 0 deletions t/SeqIO/bsml_sax.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ BEGIN {
test_begin(-tests => 15,
-requires_modules => [qw(XML::SAX
XML::SAX::Writer
XML::SAX::PurePerl
XML::SAX::Base)]);

use_ok('Bio::SeqIO');
}

my $verbose = test_debug();

# Using lax parser XML::SAX::PurePerl due to external DTD error (404 for URL,
# invalid redeclaration of predefined entity) instead of others such as
# XML::LibXML::SAX. See GH#376.
local $XML::SAX::ParserPackage = 'XML::SAX::PurePerl';
my $str = Bio::SeqIO->new(-format => 'bsml_sax',
-verbose => $verbose,
-file => test_input_file('U83300.bsml'));
Expand Down

0 comments on commit a809db2

Please sign in to comment.