Skip Menu |

This queue is for tickets about the XML-Validator-Schema CPAN distribution.

Report information
The Basics
Id: 120688
Status: open
Priority: 0/
Queue: XML-Validator-Schema

People
Owner: Nobody in particular
Requestors: nik.mitev [...] jisc.ac.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Typo in XML::Validator::Schema::SimpleType
Date: Wed, 22 Mar 2017 14:55:34 +0000
To: <bug-XML-Validator-Schema [...] rt.cpan.org>
From: Nik Mitev <nik.mitev [...] jisc.ac.uk>
Subject: Typo in XML::Validator::Schema::SimpleType
To: bug-XML-Validator-Schema [...] rt.cpan.org
From: Nik Mitev <nik.mitev [...] jisc.ac.uk>
Hi, As distributed the module died with "Found illegal restriction 'enumeration' on type derived from 'decimal'" On inspection found a typo which when corrected fixes the error: --- a/perls/perl-5.22.3/lib/site_perl/5.22.3/XML/Validator/Schema/SimpleType.pm +++ b/perls/perl-5.22.3/lib/site_perl/5.22.3/XML/Validator/Schema/SimpleType.pm @@ -326,7 +326,7 @@ sub restrict { # is this a legal restriction? (base types can do whatever they want _err("Found illegal restriction '$key' on type derived from '$root->{name}'.") unless ($self == $root) or - ($FACET{$key} & $root->{facets}); + ($FACET{$key} && $root->{facets}); push @{$self->{restrict}{$key} ||= []}, $value; } Nik -- Nik Mitev eduroam UK Technical Support, Jisc www.eduroam.uk
Download signature.asc
application/pgp-signature 801b

Message body not shown because it is not plain text.

Show quoted text
> unless ($self == $root) or > - ($FACET{$key} & $root->{facets}); > + ($FACET{$key} && $root->{facets});
This is doubtful, given that %FACET holds bit-patterns. Your patch also leads to test failures: t/01basic.t ..... ok 1 - use XML::Validator::Schema; ok 2 1..2 ok ======> Testing against XML::SAX::PurePerl <====== Argument "aaaaabbbbcccc" isn't numeric in numeric lt (<) at /<<PKGBUILDDIR>>/blib/lib/XML/Validator/Schema/SimpleType.pm line 421. # Failed test 'bad_restriction.yml: block 1 should fail matching /illegal restriction/' # at t/02yaml.t line 15. # 'Illegal value 'aaaaabbbbcccc' in element <one>, is below minimum (inclusive) allowed, 10 # ' # doesn't match '(?^:illegal restriction)' ======> Testing against XML::LibXML::SAX <====== Argument "aaaaabbbbcccc" isn't numeric in numeric lt (<) at /<<PKGBUILDDIR>>/blib/lib/XML/Validator/Schema/SimpleType.pm line 421. # Failed test 'bad_restriction.yml: block 1 should fail matching /illegal restriction/' # at t/02yaml.t line 15. # 'Illegal value 'aaaaabbbbcccc' in element <one>, is below minimum (inclusive) allowed, 10 # ' # doesn't match '(?^:illegal restriction)' ======> Testing against XML::SAX::Expat <====== Argument "aaaaabbbbcccc" isn't numeric in numeric lt (<) at /<<PKGBUILDDIR>>/blib/lib/XML/Validator/Schema/SimpleType.pm line 421. # Failed test 'bad_restriction.yml: block 1 should fail matching /illegal restriction/' # at t/02yaml.t line 15. # 'Illegal value 'aaaaabbbbcccc' in element <one>, is below minimum (inclusive) allowed, 10 # ' # doesn't match '(?^:illegal restriction)' # Looks like you failed 3 tests of 675. t/02yaml.t ......