CONTRIBUTING000664001750001750 614612404317276 13724 0ustar00taitai000000000000Types-XSD-0.005NAME CONTRIBUTING DESCRIPTION If you're reading this document, that means you might be thinking about helping me out with this project. Thanks! Here's some ways you could help out: * Bug reports Found a bug? Great! (Well, not so great I suppose.) The place to report them is . Don't e-mail me about it, as your e-mail is more than likely to get lost amongst the spam. An example script clearly demonstrating the bug (preferably written using Test::More) would be greatly appreciated. * Patches If you've found a bug and written a fix for it, even better! Generally speaking you should check out the latest copy of the code from the source repository rather than using the CPAN distribution. The file META.yml should contain a link to the source repository. If not, then try or submit a bug report. (As far as I'm concerned the lack of a link is a bug.) Many of my distributions are also mirrored at . To submit the patch, do a pull request on GitHub or Bitbucket, or attach a diff file to a bug report. Unless otherwise stated, I'll assume that your contributions are licensed under the same terms as the rest of the project. (If using git, feel free to work in a branch. For Mercurial, I'd prefer bookmarks within the default branch.) * Documentation If there's anything unclear in the documentation, please submit this as a bug report or patch as above. Non-toy example scripts that I can bundle would also be appreciated. * Translation Translations of documentation would be welcome. For translations of error messages and other strings embedded in the code, check with me first. Sometimes the English strings may not in a stable state, so it would be a waste of time translating them. Coding Style I tend to write using something approximating the Allman style, using tabs for indentation and Unix-style line breaks. * * I nominally encode all source files as UTF-8, though in practice most of them use a 7-bit-safe ASCII-compatible subset of UTF-8. AUTHOR Toby Inkster . COPYRIGHT AND LICENCE Copyright (c) 2012-2014 by Toby Inkster. CONTRIBUTING is available under three different licences permitting its redistribution: the CC-BY-SA_UK-2.0 licence, plus the same licences as Perl itself, which is distributed under the GNU General Public Licence version 1, and the Artistic Licence. This file is licensed under the Creative Commons Attribution-ShareAlike 2.0 UK: England & Wales License. To view a copy of this license, visit . This file is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. COPYRIGHT000664001750001750 327212404317276 13362 0ustar00taitai000000000000Types-XSD-0.005Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Types-XSD Upstream-Contact: Toby Inkster (TOBYINK) Source: https://metacpan.org/release/Types-XSD Files: Makefile.PL t/50ID.t t/50NCName.t t/50NMTOKEN.t t/50Name.t t/50QName.t t/50anyURI.t t/50base64Binary.t t/50boolean.t t/50byte.t t/50date.t t/50dateTime.t t/50decimal.t t/50double.t t/50duration.t t/50float.t t/50gDay.t t/50gMonth.t t/50gMonthDay.t t/50gYear.t t/50gYearMonth.t t/50hexBinary.t t/50int.t t/50integer.t t/50language.t t/50long.t t/50negativeInteger.t t/50nonNegativeInteger.t t/50nonPositiveInteger.t t/50normalizedString.t t/50positiveInteger.t t/50short.t t/50string.t t/50time.t t/50token.t t/50unsignedByte.t t/50unsignedInt.t t/50unsignedLong.t t/50unsignedShort.t Copyright: Copyright 2013 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: README lib/Types/XSD.pm t/01basic.t t/02datetimes.t t/03duration.t Copyright: This software is copyright (c) 2013-2014 by Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: Changes META.json META.yml dist.ini doap.ttl Copyright: Copyright 2014 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: COPYRIGHT CREDITS SIGNATURE Copyright: None License: public-domain Files: CONTRIBUTING INSTALL LICENSE Copyright: Unknown License: Unknown License: Artistic-1.0 This software is Copyright (c) 2014 by the copyright holder(s). This is free software, licensed under: The Artistic License 1.0 License: GPL-1.0 This software is Copyright (c) 2014 by the copyright holder(s). This is free software, licensed under: The GNU General Public License, Version 1, February 1989 CREDITS000664001750001750 11612404317274 13057 0ustar00taitai000000000000Types-XSD-0.005Maintainer: - Toby Inkster (TOBYINK) Thanks: - MPRENTICE Changes000664001750001750 264312404317274 13361 0ustar00taitai000000000000Types-XSD-0.005Types-XSD ========= Created: 2013-04-15 Home page: Bug tracker: Maintainer: Toby Inkster (TOBYINK) 0.005 2014-09-11 [ Bug Fixes ] - Add support for negative durations. Fixes RT#89005. mprentice++ 0.004 2014-04-12 [ Packaging ] - Depend on Types::XSD::Lite 0.004, which includes a pretty important bug fix. - use Dist::Inkt. 0.003 2013-07-08 [ Packaging ] - Split out easy types into Types::XSD::Lite, which this module now depends on. 0.002 2013-05-13 [ Packaging ] - Require DateTimeX::Auto 0.004. 0.001 2013-04-28 First public release 0.000_04 2013-04-28 [ Packaging ] - Bundle a version of Type::Tiny for testing purposes (only in developer previews; not for stable releases). 0.000_03 2013-04-24 [ Documentation ] - Types::XSD has some documentation now! [ Other ] - Added: DateTimeStamp type constraint - Added: DayTimeDuration type constraint - Added: YearMonthDuration type constraint - Added: assertions parameter - Added: explicitTimezone parameter 0.000_02 2013-04-24 [ Bug Fixes ] - Ensure that the regexps in test cases don't use any post-5.8 features. [ Packaging ] - Depend on a newer version of Type::Library. (We need the undocumented _mksub method!) 0.000_01 2013-04-23 Preview release INSTALL000664001750001750 165312404317273 13116 0ustar00taitai000000000000Types-XSD-0.005 Installing Types-XSD should be straightforward. INSTALLATION WITH CPANMINUS If you have cpanm, you only need one line: % cpanm Types::XSD If you are installing into a system-wide directory, you may need to pass the "-S" flag to cpanm, which uses sudo to install the module: % cpanm -S Types::XSD INSTALLATION WITH THE CPAN SHELL Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan Types::XSD MANUAL INSTALLATION As a last resort, you can manually install it. Download the tarball and unpack it. Consult the file META.json for a list of pre-requisites. Install these first. To build Types-XSD: % perl Makefile.PL % make && make test Then install it: % make install If you are installing into a system-wide directory, you may need to run: % sudo make install LICENSE000664001750001750 4365512404317273 13122 0ustar00taitai000000000000Types-XSD-0.005This software is copyright (c) 2014 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2014 by Toby Inkster. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2014 by Toby Inkster. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End MANIFEST000664001750001750 137212404317276 13217 0ustar00taitai000000000000Types-XSD-0.005CONTRIBUTING COPYRIGHT CREDITS Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE dist.ini doap.ttl lib/Types/XSD.pm t/01basic.t t/02datetimes.t t/03duration.t t/50ID.t t/50NCName.t t/50NMTOKEN.t t/50Name.t t/50QName.t t/50anyURI.t t/50base64Binary.t t/50boolean.t t/50byte.t t/50date.t t/50dateTime.t t/50decimal.t t/50double.t t/50duration.t t/50float.t t/50gDay.t t/50gMonth.t t/50gMonthDay.t t/50gYear.t t/50gYearMonth.t t/50hexBinary.t t/50int.t t/50integer.t t/50language.t t/50long.t t/50negativeInteger.t t/50nonNegativeInteger.t t/50nonPositiveInteger.t t/50normalizedString.t t/50positiveInteger.t t/50short.t t/50string.t t/50time.t t/50token.t t/50unsignedByte.t t/50unsignedInt.t t/50unsignedLong.t t/50unsignedShort.t META.json000664001750001750 347112404317276 13511 0ustar00taitai000000000000Types-XSD-0.005{ "abstract" : "type constraints based on XML schema datatypes", "author" : [ "Toby Inkster (TOBYINK) " ], "dynamic_config" : 0, "generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.016, CPAN::Meta::Converter version 2.140640", "keywords" : [], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Types-XSD", "no_index" : { "directory" : [ "eg", "examples", "inc", "t", "xt" ] }, "optional_features" : {}, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.17" } }, "runtime" : { "requires" : { "DateTime::Incomplete" : "0", "DateTimeX::Auto" : "0.004", "Type::Library" : "0.004", "Types::XSD::Lite" : "0.004", "XML::RegExp" : "0" } }, "test" : { "requires" : { "Test::More" : "0.96", "Test::TypeTiny" : "0.004" } } }, "provides" : { "Types::XSD" : { "file" : "lib/Types/XSD.pm", "version" : "0.005" } }, "release_status" : "stable", "resources" : { "X_identifier" : "http://purl.org/NET/cpan-uri/dist/Types-XSD/project", "bugtracker" : { "web" : "http://rt.cpan.org/Dist/Display.html?Queue=Types-XSD" }, "homepage" : "https://metacpan.org/release/Types-XSD", "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "type" : "git", "url" : "git://github.com/tobyink/p5-types-xsd.git", "web" : "https://github.com/tobyink/p5-types-xsd" } }, "version" : "0.005" } META.yml000664001750001750 211312404317276 13331 0ustar00taitai000000000000Types-XSD-0.005--- abstract: 'type constraints based on XML schema datatypes' author: - 'Toby Inkster (TOBYINK) ' build_requires: Test::More: '0.96' Test::TypeTiny: '0.004' configure_requires: ExtUtils::MakeMaker: '6.17' dynamic_config: 0 generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.016, CPAN::Meta::Converter version 2.140640' keywords: [] license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Types-XSD no_index: directory: - eg - examples - inc - t - xt optional_features: {} provides: Types::XSD: file: lib/Types/XSD.pm version: '0.005' requires: DateTime::Incomplete: '0' DateTimeX::Auto: '0.004' Type::Library: '0.004' Types::XSD::Lite: '0.004' XML::RegExp: '0' resources: X_identifier: http://purl.org/NET/cpan-uri/dist/Types-XSD/project bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=Types-XSD homepage: https://metacpan.org/release/Types-XSD license: http://dev.perl.org/licenses/ repository: git://github.com/tobyink/p5-types-xsd.git version: '0.005' Makefile.PL000664001750001750 1165612404317276 14066 0ustar00taitai000000000000Types-XSD-0.005use strict; use ExtUtils::MakeMaker 6.17; my $EUMM = eval( $ExtUtils::MakeMaker::VERSION ); my $meta = { "abstract" => "type constraints based on XML schema datatypes", "author" => ["Toby Inkster (TOBYINK) "], "dynamic_config" => 0, "generated_by" => "Dist::Inkt::Profile::TOBYINK version 0.016, CPAN::Meta::Converter version 2.140640", "keywords" => [], "license" => ["perl_5"], "meta-spec" => { url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec", version => 2, }, "name" => "Types-XSD", "no_index" => { directory => ["eg", "examples", "inc", "t", "xt"] }, "prereqs" => { configure => { requires => { "ExtUtils::MakeMaker" => 6.17 } }, runtime => { requires => { "DateTime::Incomplete" => 0, "DateTimeX::Auto" => 0.004, "Type::Library" => 0.004, "Types::XSD::Lite" => 0.004, "XML::RegExp" => 0, }, }, test => { requires => { "Test::More" => 0.96, "Test::TypeTiny" => 0.004 } }, }, "provides" => { "Types::XSD" => { file => "lib/Types/XSD.pm", version => 0.005 }, }, "release_status" => "stable", "resources" => { bugtracker => { web => "http://rt.cpan.org/Dist/Display.html?Queue=Types-XSD" }, homepage => "https://metacpan.org/release/Types-XSD", license => ["http://dev.perl.org/licenses/"], repository => { type => "git", url => "git://github.com/tobyink/p5-types-xsd.git", web => "https://github.com/tobyink/p5-types-xsd", }, X_identifier => "http://purl.org/NET/cpan-uri/dist/Types-XSD/project", }, "version" => 0.005, }; my %dynamic_config; my %WriteMakefileArgs = ( ABSTRACT => $meta->{abstract}, AUTHOR => ($EUMM >= 6.5702 ? $meta->{author} : $meta->{author}[0]), DISTNAME => $meta->{name}, VERSION => $meta->{version}, EXE_FILES => [ map $_->{file}, values %{ $meta->{x_provides_scripts} || {} } ], NAME => do { my $n = $meta->{name}; $n =~ s/-/::/g; $n }, test => { TESTS => "t/*.t" }, %dynamic_config, ); $WriteMakefileArgs{LICENSE} = $meta->{license}[0] if $EUMM >= 6.3001; sub deps { my %r; for my $stage (@_) { for my $dep (keys %{$meta->{prereqs}{$stage}{requires}}) { next if $dep eq 'perl'; my $ver = $meta->{prereqs}{$stage}{requires}{$dep}; $r{$dep} = $ver if !exists($r{$dep}) || $ver >= $r{$dep}; } } \%r; } my ($build_requires, $configure_requires, $runtime_requires, $test_requires); if ($EUMM >= 6.6303) { $WriteMakefileArgs{BUILD_REQUIRES} ||= deps('build'); $WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure'); $WriteMakefileArgs{TEST_REQUIRES} ||= deps('test'); $WriteMakefileArgs{PREREQ_PM} ||= deps('runtime'); } elsif ($EUMM >= 6.5503) { $WriteMakefileArgs{BUILD_REQUIRES} ||= deps('build', 'test'); $WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure'); $WriteMakefileArgs{PREREQ_PM} ||= deps('runtime'); } elsif ($EUMM >= 6.52) { $WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure'); $WriteMakefileArgs{PREREQ_PM} ||= deps('runtime', 'build', 'test'); } else { $WriteMakefileArgs{PREREQ_PM} ||= deps('configure', 'build', 'test', 'runtime'); } { my ($minperl) = reverse sort( grep defined && /^[0-9]+(\.[0-9]+)?$/, map $meta->{prereqs}{$_}{requires}{perl}, qw( configure build runtime ) ); if (defined($minperl)) { die "Installing $meta->{name} requires Perl >= $minperl" unless $] >= $minperl; $WriteMakefileArgs{MIN_PERL_VERSION} ||= $minperl if $EUMM >= 6.48; } } sub FixMakefile { return unless -d 'inc'; my $file = shift; local *MAKEFILE; open MAKEFILE, "< $file" or die "FixMakefile: Couldn't open $file: $!; bailing out"; my $makefile = do { local $/; }; close MAKEFILE or die $!; $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /; $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g; $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g; $makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m; $makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m; open MAKEFILE, "> $file" or die "FixMakefile: Couldn't open $file: $!; bailing out"; print MAKEFILE $makefile or die $!; close MAKEFILE or die $!; } my $mm = WriteMakefile(%WriteMakefileArgs); FixMakefile($mm->{FIRST_MAKEFILE} || 'Makefile'); exit(0); README000664001750001750 2575312404317273 12774 0ustar00taitai000000000000Types-XSD-0.005NAME Types::XSD - type constraints based on XML schema datatypes SYNOPSIS package Person; use Moo; use Types::XSD::Lite qw( PositiveInteger String ); has name => (is => "ro", isa => String[ minLength => 1 ]); has age => (is => "ro", isa => PositiveInteger); DESCRIPTION Types::XSD is a type constraint library inspired by XML Schema, and built with Type::Library. It can be used as a type constraint library for Moo, Mouse or Moose, or used completely independently of any OO framework. This module is an extension of Types::XSD::Lite which has fewer type constraints, but fewer dependencies. For completeness, the type constraints and other features inherited from Types::XSD::Lite are documented below too. Type Constraints This module defines the following type constraints based on the data types defined in XML Schema . (The names of the type constraints are the same as the XML Schema data types, but capitalization often differs.) I've added some quick explainations of what each type is, but for details, see the XML Schema specification. `AnyType` As per `Any` from Types::Standard. `AnySimpleType` As per `Value` from Types::Standard. `String` As per `Str` from Types::Standard. `NormalizedString` A string containing no line breaks, carriage returns or tabs. `Token` Like `NormalizedString`, but also no leading or trailing space, and no doubled spaces (i.e. not `/\s{2,}/`). `Language` An RFC 3066 language code. `Name` Something that could be a valid XML element or attribute name. These roughly correspond to Perl identifiers but may also contain colons, hyphens and stops. (Digits, hyphens and stops are not allowed as the first character.) `NmToken` Slightly looser version of `Name`; allows digits, hyphens and stops in the first character. `NmTokens` Space-separated list of `NmToken`. `NCName` Slightly tighter vesion of `Name`; disallows colons. `Id` Effectively the same as `NCName`. `IdRef` Effectively the same as `NCName`. `IdRefs` Space-separated list of `IdRef`. `Entity` Effectively the same as `NCName`. `Entities` Space-separated list of `Entity`. `Boolean` Allows "true", "false", "1" and "0" (case-insensitively). Gotcha: The string "false" evaluates to true in Perl. You probably want to use `Bool` from Types::Standard instead. `Base64Binary` Strings which are valid Base64 data. Allows whitespace. Gotcha: If you parameterize this with `length`, `maxLength` or `minLength`, it is the length of the *decoded* string which will be checked. `HexBinary` Strings which are valid hexadecimal data. Disallows whitespace; disallows leading `0x`. Gotcha: If you parameterize this with `length`, `maxLength` or `minLength`, it is the length of the *decoded* string which will be checked. `Float` As per `Num` from Types::Standard. `Double` As per `Num` from Types::Standard. `AnyURI` Any absolute *or relative* URI. Effectively, any string at all! `QName` An XML QName; something that could be used as a valid element name in a namespaced XML document. Gotcha: while `length`, `maxLength` and `minLength` are allowed facets for parameterization, they are silently ignored, as per the specification! `Notation` Effectively the same as `QName`. According to XML Schema, this is *always* supposed to be parameterized with an enumeration. But we don't enforce that. Gotcha: while `length`, `maxLength` and `minLength` are allowed facets for parameterization, they are silently ignored, as per the specification! `Decimal` Numbers possibly including a decimal point, but not allowing exponential notation (e.g. "3.14e-3"). `Integer` As per `Int` from Types::Standard. `NonPositiveInteger` An `Integer` 0 or below. `NegativeInteger` An `Integer` -1 or below. `Long` An `Integer` between -9223372036854775808 and 9223372036854775807 (inclusive). `Int` An `Integer` between -2147483648 and 2147483647 (inclusive). `Short` An `Integer` between -32768 and 32767 (inclusive). `Byte` An `Integer` between -128 and 127 (inclusive). `NonNegativeInteger` An `Integer` 0 or above. `PositiveInteger` An `Integer` 1 or above. `UnsignedLong` A `NonNegativeInteger` between 0 and 18446744073709551615 (inclusive). `UnsignedInt` A `NonNegativeInteger` between 0 and 4294967295 (inclusive). `UnsignedShort` A `NonNegativeInteger` between 0 and 65535 (inclusive). `UnsignedByte` A `NonNegativeInteger` between 0 and 255 (inclusive). `Duration` An ISO 8601 duration. `YearMonthDuration` An ISO 8601 duration restricted to cover only years and months. `DayTimeDuration` An ISO 8601 duration restricted to cover only days, hours, minutes and seconds. (Note that this still permits durations of many years, as the days component is an arbitrary non-negative integer.) `DateTime` An ISO 8601 datetime with optional timezone. `DateTimeStamp` An ISO 8601 datetime with required timezone. `Time` An ISO 8601 time with optional timezone. `Date` An ISO 8601 date with optional timezone. `GYearMonth` An year-month pair with optional timezone. `GYear` An year with optional timezone. `GMonthDay` An month-day pair with optional timezone. `GDay` An day with optional timezone. `GMonth` An month with optional timezone. Parameters Datatypes can be parameterized using the facets defined by XML Schema. For example: use Types::XSD::Lite qw( String Decimal PositiveInteger Token ); my @sizes = qw( XS S M L XL XXL ); has name => (is => "ro", isa => String[ minLength => 1 ]); has price => (is => "ro", isa => Decimal[ fractionDigits => 2 ]); has rating => (is => "ro", isa => PositiveInteger[ maxInclusive => 5 ]); has size => (is => "ro", isa => Token[ enumeration => \@sizes ]); The following facets exist, but not all facets are supported for all datatypes. (The module will croak if you try to use an unsupported facet.) `enumeration` An arrayref of allowable values. You should probably use Type::Tiny::Enum instead. `pattern` A regular expression that the value is expected to conform to. Use a normal Perl quoted regexp: Token[ pattern => qr{^[a-z]+$} ] `whiteSpace` The `whiteSpace` facet is ignored as I'm not entirely sure what it should do. It perhaps makes sense for coercions, but this module doesn't define any coercions. `assertions` An arrayref of arbitrary additional restrictions, expressed as strings of Perl code or coderefs operating on $_. For example: Integer[ assertions => [ '$_ % 3 == 0', # multiple of three, and... sub { is_nice($_) }, # is nice (whatever that means) ], ], Strings of Perl code will result in faster-running type constraints. `length`, `maxLength`, `minLength` Restrict the length of a value. For example `Integer[length=>2]` allows 10, 99 and -1, but not 100, 9 or -10. Types::XSD won't prevent you from making ridiculous constraints such as `String[ maxLength => 1, minLength => 2 ]`. Note that on `HexBinary` and `Base64Binary` types, the lengths apply to the decoded string. Length restrictions are silently ignored for `QName` and `Notation` because the W3C doesn't think you should care what length these datatypes are. `maxInclusive`, `minInclusive`, `maxExclusive`, `minExclusive` Supported for numeric types and datetime/duration-related types. Note that to be super-correct, the `{max,min}{Inclusive,Exclusive}` facets for numeric types are performed by passing the numbers through Math::BigInt or Math::BigFloat, so may be a little slow. `totalDigits` For a decimal (or type derived from decimals) specifies that the total number of digits for the value must be at most this number. Given `Decimal[ totalDigits => 3 ]`, 1.23, 12.3, 123, 1.2 and 1 are all allowable; 1.234 is not. 1.230 is also not, but this may change in a future version. `fractionDigits` Like `totalDigits` but ignores digits before the decimal point. `explicitTimezone` May be "optional", "prohibited" or "required". For example: Time[ explicitTimezone => "prohibited" ] Functions This module also exports some convenience functions: `dur_parse($str)` Parse an xsd:duration string, returning a DateTime::Duration. `dur_cmp($a, $b)` Compare two strings conforming to the xsd:duration datatype to indicate which is the longer duration. Returns -1 if $a is shorter. Returns 1 if $b is shorter. Returns 0 if the durations are identical. Returns undef if the comparison is indeterminate; for example, "P1Y" (one year) and "P365D" (365 days) are not necessarily identical - in leap years "P365D" is shorter. `dt_cmp($type, $a, $b)` Compare two datetime-like strings. For example, two `gYearMonth` strings can be compared using: dt_cmp(GYearMonth, "2009-02", "2010-10"); Both strings are expected to conform to the same datatype. It doesn't make much sense to compare them otherwise. `dt_parse($type, $str)` Parse a datetime-like string, returning a DateTime::Incomplete object. Note that DateTime::Incomplete objects are always returned, even if the datetime is potentially complete. BUGS Please report any bugs to . SEE ALSO Type::Tiny, Types::XSD::Lite, Types::Standard. * Datatypes in XML Schema 1.0 * Datatypes in XML Schema 1.1 AUTHOR Toby Inkster . COPYRIGHT AND LICENCE This software is copyright (c) 2013-2014 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. DISCLAIMER OF WARRANTIES THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. SIGNATURE000664001750001750 763512404317277 13363 0ustar00taitai000000000000Types-XSD-0.005This file contains message digests of all files listed in MANIFEST, signed via the Module::Signature module, version 0.73. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: % cpansign -v It will check each file's integrity, as well as the signature's validity. If "==> Signature verified OK! <==" is not displayed, the distribution may already have been compromised, and you should not run its Makefile.PL or Build.PL. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 33317486c4fa2cf7fec85bf92ed38ac0f64233a0 CONTRIBUTING SHA1 8bfa21595f1c5af134a1b368fabd82c02b522c0d COPYRIGHT SHA1 05f33692d35fa4efe4bdfaf3e523a86828c8ca07 CREDITS SHA1 0a9314cd1e547e169f2cf06f344cb81d8d52ac55 Changes SHA1 63dddc51861186c61078b1d21dfc77c53db44c45 INSTALL SHA1 34f5e12514b91055de4b164a1f2327ef5c30ba53 LICENSE SHA1 3a42326ecf8c1420b189980a7c25df7e9be764b6 MANIFEST SHA1 40bedf1c6fc88f556f6564ee1c019f7de0fb2b87 META.json SHA1 ec334521369ed77b38cd69c300f1665e92288d19 META.yml SHA1 9bd1eb7847cbdeb377f5707a77a99262251273b9 Makefile.PL SHA1 72b10154f24a3d6f4f02a534298f563d61c144a1 README SHA1 38c7f231b2c9a84c47fa812b5abce9f7952b5525 dist.ini SHA1 d13efd7d10212b1757941946067db5eac24f43a2 doap.ttl SHA1 0953f0d3367827ca679fa91dbc289034dcda8e02 lib/Types/XSD.pm SHA1 213eb5e2c48e0f91b1e668b8e38bcd87ae9c3455 t/01basic.t SHA1 c0bde0b5677aee6be95c077eebd43c8029adb9aa t/02datetimes.t SHA1 7a914e26444c5ff066561de7153aaf41d22def41 t/03duration.t SHA1 91d7a740140a467761afb6451ff209c4cc2a9dff t/50ID.t SHA1 75b4a2241ec1627342e6a517dfdf004c620d92a4 t/50NCName.t SHA1 ad376d151012d749f6f0f1f06b3aca64130de866 t/50NMTOKEN.t SHA1 695008f9b76ca3ffacc6ece4f27109d3173ee375 t/50Name.t SHA1 143b33515365c98c818828514692e90811bd4b0c t/50QName.t SHA1 25a039f5f73edb3ffb3aef7d0d0e2f2a1f2dadc3 t/50anyURI.t SHA1 52b55855e05628183800a1712850c81f9ef6314c t/50base64Binary.t SHA1 a407a8731af6c947b9ae6571a42ccb6d0ac41836 t/50boolean.t SHA1 dfe530a281178c3c8c88fdd51c89f8c183e55fdd t/50byte.t SHA1 00bd077c1c99e965072d5b26936d6b2ca80e4238 t/50date.t SHA1 9fc41c7d079151ea7402d3d902c27b912dd55eae t/50dateTime.t SHA1 62dad5cf2be96fc988ec5e00f8f146cb00df1d3a t/50decimal.t SHA1 5a0ec26210b3de2535ae775ad7829bee395664e1 t/50double.t SHA1 fb9e7f830349787bce8d753d79770187ce730a49 t/50duration.t SHA1 f774abd7427ec3a2412006bf146fb956d7dedaf9 t/50float.t SHA1 a264b40ed1a301d228767fbfb2248e1664f8aa17 t/50gDay.t SHA1 9dad7099ecc8b215db0cb029d70871b6731e5a5f t/50gMonth.t SHA1 760e4d42fc512697469c51b8ec79880548aa7568 t/50gMonthDay.t SHA1 15f4585e0ae5950671debdf7c7c48835ee27f47b t/50gYear.t SHA1 c1fb1ecb95386fbdbc898910ce486dc7ab64bb8b t/50gYearMonth.t SHA1 8fa3f2167b846977016bc007255a7afd9e65f63c t/50hexBinary.t SHA1 b12af6b11ec2b94e51cff9cfadfdfab1350d1ece t/50int.t SHA1 24c241056cd3149020380f3b7be845ce057bc215 t/50integer.t SHA1 90c382eabbb715eda1fff84696961034e885c72b t/50language.t SHA1 9a97bf91e2fd50f0fd88261c825323bcb1cf19ef t/50long.t SHA1 6be7b2b00710b2205b62f471b29fbd73aaec3285 t/50negativeInteger.t SHA1 11ab679dc16c890557a099d25a419d2158a1c12f t/50nonNegativeInteger.t SHA1 48bbafa14078c8c460378377d925403b2ceb18a8 t/50nonPositiveInteger.t SHA1 676f67817c478717ec8e1accafc9f3feba7ee8ab t/50normalizedString.t SHA1 2c9861fde2788d19dc967843d1c20d0875449e9b t/50positiveInteger.t SHA1 ba9b3a51798664ea4f11f6a5d3a376c0f12d6519 t/50short.t SHA1 ae81077dcf83b7ebfc52c3585055cd8f1a237357 t/50string.t SHA1 8800721933474649e06ca3b999e3820e5b7cac2c t/50time.t SHA1 a991fab8796dda9ac076c78b64610d959084c618 t/50token.t SHA1 92adae06451129a713e04406705f7b4508a7fe30 t/50unsignedByte.t SHA1 a79742e09227deaef0d7e280a4d3a0f021c36ea4 t/50unsignedInt.t SHA1 89595b55b3b6ef8d136d664d92dc858d200fe83e t/50unsignedLong.t SHA1 d9c0eb27c119f32836634be8e758b1ed5b337435 t/50unsignedShort.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlQRnr8ACgkQzr+BKGoqfTnGsACfcCuMfGtFub/YhNgeT7c2SJnB HmcAmwbZv5foNkHW51dQVgbBMeKsYWvC =42vr -----END PGP SIGNATURE----- dist.ini000664001750001750 7312404317273 13464 0ustar00taitai000000000000Types-XSD-0.005;;class='Dist::Inkt::Profile::TOBYINK' ;;name='Types-XSD' doap.ttl000664001750001750 2115412404317276 13556 0ustar00taitai000000000000Types-XSD-0.005@prefix cpan-uri: . @prefix dc: . @prefix doap: . @prefix doap-bugs: . @prefix doap-changeset: . @prefix doap-deps: . @prefix foaf: . @prefix rdfs: . @prefix xsd: . dc:title "the same terms as the perl 5 programming language system itself". a doap:Project; dc:contributor ; doap-deps:runtime-requirement [ doap-deps:on "DateTime::Incomplete 0"^^doap-deps:CpanId; ], [ doap-deps:on "DateTimeX::Auto 0.004"^^doap-deps:CpanId; ], [ doap-deps:on "Type::Library 0.004"^^doap-deps:CpanId; ], [ doap-deps:on "XML::RegExp 0"^^doap-deps:CpanId ], [ doap-deps:on "Types::XSD::Lite 0.004"^^doap-deps:CpanId; ]; doap-deps:test-requirement [ doap-deps:on "Test::More 0.96"^^doap-deps:CpanId ], [ doap-deps:on "Test::TypeTiny 0.004"^^doap-deps:CpanId; ]; doap:bug-database ; doap:created "2013-04-15"^^xsd:date; doap:developer ; doap:download-page ; doap:homepage ; doap:license ; doap:maintainer ; doap:name "Types-XSD"; doap:programming-language "Perl"; doap:release , , , , , , , , ; doap:repository [ a doap:GitRepository; doap:browse ; ]; doap:shortdesc "type constraints based on XML schema datatypes". a cpan-uri:DeveloperRelease, doap:Version; rdfs:label "Preview release"; dc:identifier "Types-XSD-0.000_01"^^xsd:string; dc:issued "2013-04-23"^^xsd:date; doap-changeset:released-by ; doap:file-release ; doap:revision "0.000_01"^^xsd:string. a cpan-uri:DeveloperRelease, doap:Version; dc:identifier "Types-XSD-0.000_02"^^xsd:string; dc:issued "2013-04-24"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Ensure that the regexps in test cases don't use any post-5.8 features."; ], [ a doap-changeset:Packaging; rdfs:label "Depend on a newer version of Type::Library. (We need the undocumented _mksub method!)"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.000_02"^^xsd:string. a cpan-uri:DeveloperRelease, doap:Version; dc:identifier "Types-XSD-0.000_03"^^xsd:string; dc:issued "2013-04-24"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Documentation; rdfs:label "Types::XSD has some documentation now!"; ], [ a doap-changeset:Addition; rdfs:label "DateTimeStamp type constraint"; ], [ a doap-changeset:Addition; rdfs:label "YearMonthDuration type constraint"; ], [ a doap-changeset:Addition; rdfs:label "DayTimeDuration type constraint"; ], [ a doap-changeset:Addition; rdfs:label "explicitTimezone parameter"; ], [ a doap-changeset:Addition; rdfs:label "assertions parameter"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.000_03"^^xsd:string. a cpan-uri:DeveloperRelease, doap:Version; dc:identifier "Types-XSD-0.000_04"^^xsd:string; dc:issued "2013-04-28"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Packaging; rdfs:label "Bundle a version of Type::Tiny for testing purposes (only in developer previews; not for stable releases)."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.000_04"^^xsd:string. a doap:Version; rdfs:label "First public release"; dc:identifier "Types-XSD-0.001"^^xsd:string; dc:issued "2013-04-28"^^xsd:date; doap-changeset:released-by ; doap:file-release ; doap:revision "0.001"^^xsd:string; rdfs:comment "No functional changes". a doap:Version; dc:identifier "Types-XSD-0.002"^^xsd:string; dc:issued "2013-05-13"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Packaging; rdfs:label "Require DateTimeX::Auto 0.004."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.002"^^xsd:string. a doap:Version; dc:identifier "Types-XSD-0.003"^^xsd:string; dc:issued "2013-07-08"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Packaging; rdfs:label "Split out easy types into Types::XSD::Lite, which this module now depends on."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.003"^^xsd:string. a doap:Version; dc:identifier "Types-XSD-0.004"^^xsd:string; dc:issued "2014-04-12"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Packaging; rdfs:label "Depend on Types::XSD::Lite 0.004, which includes a pretty important bug fix."; ], [ a doap-changeset:Packaging; rdfs:label "use Dist::Inkt."; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.004"^^xsd:string. a doap:Version; dc:identifier "Types-XSD-0.005"^^xsd:string; dc:issued "2014-09-11"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Add support for negative durations."; doap-changeset:fixes ; doap-changeset:thanks [ foaf:nick "mprentice" ]; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.005"^^xsd:string. a foaf:Person; foaf:mbox ; foaf:name "Toby Inkster"; foaf:nick "TOBYINK"; foaf:page . a doap-bugs:Issue; doap-bugs:id "89005"^^xsd:string; doap-bugs:page . 01basic.t000664001750001750 67012404317273 13715 0ustar00taitai000000000000Types-XSD-0.005/t=pod =encoding utf-8 =head1 PURPOSE Test that Types::XSD compiles. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2013-2014 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut use strict; use warnings; use Test::More; use_ok('Types::XSD'); done_testing; 02datetimes.t000664001750001750 355412404317273 14640 0ustar00taitai000000000000Types-XSD-0.005/t=pod =encoding utf-8 =head1 PURPOSE Test a few datetime-related types. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2013-2014 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut use strict; use warnings; use Test::More; use Test::TypeTiny; use Types::XSD -types; should_pass('2009-02-12T03:54:00Z', DateTime); should_pass('2009-02-12T03:54:00Z', DateTimeStamp); should_pass('2009-02-12T03:54:00Z', DateTime[explicitTimezone => "optional"]); should_pass('2009-02-12T03:54:00Z', DateTime[explicitTimezone => "required"]); should_fail('2009-02-12T03:54:00Z', DateTime[explicitTimezone => "prohibited"]); should_pass('2009-02-12T03:54:00+00:00', DateTime); should_pass('2009-02-12T03:54:00+00:00', DateTimeStamp); should_pass('2009-02-12T03:54:00+00:00', DateTime[explicitTimezone => "optional"]); should_pass('2009-02-12T03:54:00+00:00', DateTime[explicitTimezone => "required"]); should_fail('2009-02-12T03:54:00+00:00', DateTime[explicitTimezone => "prohibited"]); should_pass('2009-02-12T03:54:00', DateTime); should_fail('2009-02-12T03:54:00', DateTimeStamp); should_pass('2009-02-12T03:54:00', DateTime[explicitTimezone => "optional"]); should_fail('2009-02-12T03:54:00', DateTime[explicitTimezone => "required"]); should_pass('2009-02-12T03:54:00', DateTime[explicitTimezone => "prohibited"]); should_pass('2009-02-12T03:54:00', DateTime[assertions => [sub { m/^2009/ }]]); should_pass('2009-02-12T03:54:00', DateTime[assertions => 'm/^2009/']); should_fail('2010-02-12T03:54:00', DateTime[assertions => [sub { m/^2009/ }]]); should_fail('2010-02-12T03:54:00', DateTime[assertions => 'm/^2009/']); should_pass('2009-02-12T03:54:00', DateTime[assertions => [sub { m/^2009/ }, 'm/-02-/']]); done_testing; 03duration.t000664001750001750 302612404317273 14501 0ustar00taitai000000000000Types-XSD-0.005/t=pod =encoding utf-8 =head1 PURPOSE Test that negative durations work. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2013-2014 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut use strict; use warnings; use Test::More; use Test::TypeTiny; use Types::XSD -types; should_pass('P4YT5S', Duration); should_pass('-P4YT5S', Duration); should_fail('+P4YT5S', Duration); should_pass('P4Y', YearMonthDuration); should_pass('P4Y6M', YearMonthDuration); should_pass('-P4Y', YearMonthDuration); should_pass('-P4Y6M', YearMonthDuration); should_fail('+P4Y', YearMonthDuration); should_fail('+P4Y6M', YearMonthDuration); should_fail('P4YT5S', YearMonthDuration); should_fail('-P4YT5S', YearMonthDuration); should_fail('+P4YT5S', YearMonthDuration); should_pass('P3DT6H0M0S', DayTimeDuration); should_pass('-P3DT6H0M0S', DayTimeDuration); should_fail('+P3DT6H0M0S', DayTimeDuration); should_pass('PT6H0M0S', DayTimeDuration); should_pass('-PT6H0M0S', DayTimeDuration); should_fail('+PT6H0M0S', DayTimeDuration); should_fail('P4Y', DayTimeDuration); should_fail('P4Y6M', DayTimeDuration); should_fail('-P4Y', DayTimeDuration); should_fail('-P4Y6M', DayTimeDuration); should_fail('+P4Y', DayTimeDuration); should_fail('+P4Y6M', DayTimeDuration); should_fail('P4YT5S', DayTimeDuration); should_fail('-P4YT5S', DayTimeDuration); should_fail('+P4YT5S', DayTimeDuration); done_testing; 50ID.t000664001750001750 4733512404317273 13205 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/ID is restricted by facet maxLength with value 1." => sub { my $type = mk_type('Id', {'maxLength' => '1'}); should_pass("_", $type, 0); should_pass("a", $type, 0); should_pass("f", $type, 0); should_pass("r", $type, 0); should_pass("_", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 62." => sub { my $type = mk_type('Id', {'maxLength' => '62'}); should_pass("f", $type, 0); should_pass("ofollowing.worki", $type, 0); should_pass("tthe.the.revolutionize.of_retri", $type, 0); should_pass("vlibraries_building_developing.computing_for_d", $type, 0); should_pass("qassociated_robust-the.the_and-working-eliminate-participants", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 58." => sub { my $type = mk_type('Id', {'maxLength' => '58'}); should_pass("w", $type, 0); should_pass("abeing_g.and-fi", $type, 0); should_pass("dthat_known-a.been-enable_wor", $type, 0); should_pass("ttransact-information-under-as_documents_th", $type, 0); should_pass("_is.development-success.which_technologies_than.registry.", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 22." => sub { my $type = mk_type('Id', {'maxLength' => '22'}); should_pass("n", $type, 0); should_pass("cdisco", $type, 0); should_pass("dwithin-and", $type, 0); should_pass("cfurther_devices", $type, 0); should_pass("ttools.implementation", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 64." => sub { my $type = mk_type('Id', {'maxLength' => '64'}); should_pass("h", $type, 0); should_pass("drepository.prot", $type, 0); should_pass("tfor.software_portable.will_doc", $type, 0); should_pass("_key.not.devices_software.of_is_including_for.", $type, 0); should_pass("bfiles.business_both.a.to_more_and.type.information.to_reposi", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 1." => sub { my $type = mk_type('Id', {'minLength' => '1'}); should_pass("t", $type, 0); should_pass("_consistency_mat", $type, 0); should_pass("pintelligent.these_enable.build", $type, 0); should_pass("_are.can_cross-reference-for_test.well_files.m", $type, 0); should_pass("fand-and-development-build-widely.only_systems-these_for_stan", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 45." => sub { my $type = mk_type('Id', {'minLength' => '45'}); should_pass("_mechanism-tools.to.for_documents_application", $type, 0); should_pass("_2001-both_law_them-that_to-allows_asking.the-sma", $type, 0); should_pass("yand.of_years_a-to.among-methods.electronic.these_inf", $type, 0); should_pass("cforensics_their_implementations.and.be_and-means_create-", $type, 0); should_pass("iand-large.and-to-the-supply.cooperation-languages-each.filte", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 58." => sub { my $type = mk_type('Id', {'minLength' => '58'}); should_pass("_well.lack-retrieval.improved-and-between.file.annual.that", $type, 0); should_pass("_business-oriented.generation-related-industry-browsers_dev", $type, 0); should_pass("jcan_role_own_libraries-for-involved_this.will_business-and.", $type, 0); should_pass("dthe_using.specifications.would.organizations_the.computing_b", $type, 0); should_pass("ffor_specifications.divisions_without.from.this.rapid_with_res", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 6." => sub { my $type = mk_type('Id', {'minLength' => '6'}); should_pass("tis-be", $type, 0); should_pass("cfiles-of_a_suites_f", $type, 0); should_pass("lfacilitates.new-computing-build-o", $type, 0); should_pass("afor-to_for-and-work_widespread.through_effort-c", $type, 0); should_pass("vtoday.result-security_files_information-as.of-as.in_chosen_as", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 64." => sub { my $type = mk_type('Id', {'minLength' => '64'}); should_pass("xbe-to_bandwidth.the-are_information_and.software_annual.quality", $type, 0); should_pass("_degree_resides-environments-the-software_infrastructure.use-app", $type, 0); should_pass("uregistries-transforming_interoperability.as.targeted.from-imple", $type, 0); should_pass("wbandwidth.new.are-management_specifications_vocabularies.device", $type, 0); should_pass("hbe-under_all_related_provides.community.problems-ways.and_langu", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 1." => sub { my $type = mk_type('Id', {'length' => '1'}); should_pass("c", $type, 0); should_pass("_", $type, 0); should_pass("l", $type, 0); should_pass("_", $type, 0); should_pass("_", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 57." => sub { my $type = mk_type('Id', {'length' => '57'}); should_pass("athat-system_the.development_the.that_entire_launching_re", $type, 0); should_pass("gspecifications-web.in.g_automatically_four-resides.perso", $type, 0); should_pass("msolutions-and.sense_mechanism_a-of-this.need-gain_used.w", $type, 0); should_pass("_and.a.that-would_are-the-create.requires.repository.led-", $type, 0); should_pass("bindustries_in-of_structure_means-revolutionize_to-networ", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 24." => sub { my $type = mk_type('Id', {'length' => '24'}); should_pass("pdraft.and_manipulation-", $type, 0); should_pass("jof.of.complete-meets_no", $type, 0); should_pass("_as_information-build_wa", $type, 0); should_pass("nbe.file-these-rapidly-d", $type, 0); should_pass("swhich_improved_years.sp", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 8." => sub { my $type = mk_type('Id', {'length' => '8'}); should_pass("ythe-bus", $type, 0); should_pass("uthrough", $type, 0); should_pass("qto-whic", $type, 0); should_pass("_profile", $type, 0); should_pass("wto.in-h", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 64." => sub { my $type = mk_type('Id', {'length' => '64'}); should_pass("vcomputing.standardization_creation_enable-and-one_of-robust-ref", $type, 0); should_pass("_profile-and_a-object.for_revolution-will-used_repository_displa", $type, 0); should_pass("pused-pervasive-appropriate-used_tremendous-must.to.e_devices-de", $type, 0); should_pass("fsoftware-software-ability.supply_and_will-software_software-mad", $type, 0); should_pass("bwill.all_for_formed.database.be_efforts.with.and-is-as-foster_c", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{11}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('Id', {}); should_pass("_execution_b", $type, 0); should_pass("ufor-needed.", $type, 0); should_pass("yindustry-in", $type, 0); should_pass("ucomputer.th", $type, 0); should_pass("sinformation", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{55}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('Id', {}); should_pass("ncross-reference-the_be-collaborate_systems-e-to.the_par", $type, 0); should_pass("yincluding_the_with_use.tools.20_the_retrieves_help-the.", $type, 0); should_pass("uand_are_provide-including.as-discovery-system_is.offer_", $type, 0); should_pass("_organization_influence_systems-a-which_pervasive-pervas", $type, 0); should_pass("iversions.visibly_and.languages-use.the-versions-tools.c", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{18}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('Id', {}); should_pass("hand-some.the.parti", $type, 0); should_pass("_to_contribute_stim", $type, 0); should_pass("ktune-degree.from_c", $type, 0); should_pass("xbe-the-sensors.als", $type, 0); should_pass("hindustry_and-the-a", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{15}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('Id', {}); should_pass("kvertical-for.al", $type, 0); should_pass("wto_development-", $type, 0); should_pass("tand.must.provid", $type, 0); should_pass("ycollaborating_t", $type, 0); should_pass("_competence_comm", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{36}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('Id', {}); should_pass("jsystems_resources_further_without.ba", $type, 0); should_pass("xwill-manipulation.of.describes_and_a", $type, 0); should_pass("_build_process_transactional.around_w", $type, 0); should_pass("sadoption-set_and.computing.original.", $type, 0); should_pass("wusing.asking-library-one-be.commerce", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet enumeration." => sub { my $type = mk_type('Id', {'enumeration' => ['itemplates.resource_','horganiz','_work-of-is-documents_relationships-of_at.object','maccomplish.versions.care.define-and.pr','dallow-success-of_devices_enough_the.retrieve','_manufacturers_information.world_th','hdocuments-impact']}); should_pass("_manufacturers_information.world_th", $type, 0); should_pass("_work-of-is-documents_relationships-of_at.object", $type, 0); should_pass("dallow-success-of_devices_enough_the.retrieve", $type, 0); should_pass("maccomplish.versions.care.define-and.pr", $type, 0); should_pass("hdocuments-impact", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet enumeration." => sub { my $type = mk_type('Id', {'enumeration' => ['jrequesting-methods-in','pdata_technologies-will-that_their-at_me','tresult-a-of-methods-as.of-networks_and.specifica','mindustry.designed_match.and.influence_to_those.will','jmethods-wide.utilize-known-data-organizatio','_of_of_a-conferences_prominent-organizations-as_recent_te','svisibly.registry_is_support_for-will.industry-in_provide.and','lrigorous-be-pr']}); should_pass("svisibly.registry_is_support_for-will.industry-in_provide.and", $type, 0); should_pass("svisibly.registry_is_support_for-will.industry-in_provide.and", $type, 0); should_pass("tresult-a-of-methods-as.of-networks_and.specifica", $type, 0); should_pass("_of_of_a-conferences_prominent-organizations-as_recent_te", $type, 0); should_pass("_of_of_a-conferences_prominent-organizations-as_recent_te", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet enumeration." => sub { my $type = mk_type('Id', {'enumeration' => ['hin.and-software-hardware-a','wto-to.the_and.appr','hinteroperability.used.revolution.methods.systems.cost_ena','_with.measurements.lacking.degree-using_in-co','qprim','uservices_all_of_','mthe_issues_of_creation-bro','tand-performance-can_']}); should_pass("wto-to.the_and.appr", $type, 0); should_pass("uservices_all_of_", $type, 0); should_pass("hin.and-software-hardware-a", $type, 0); should_pass("hin.and-software-hardware-a", $type, 0); should_pass("qprim", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet enumeration." => sub { my $type = mk_type('Id', {'enumeration' => ['_for.newcomers_for-resources.forum_and-than.maintained-series-','iimpact-the.devices_templates_sy','nsoftware.the.from_commerce_using-','hi','lprovides.discover.over.clean.rel','qban','wregistries_result_made_key.the.of_without_the.can.organizatio','stesting-addressing_th']}); should_pass("iimpact-the.devices_templates_sy", $type, 0); should_pass("lprovides.discover.over.clean.rel", $type, 0); should_pass("stesting-addressing_th", $type, 0); should_pass("lprovides.discover.over.clean.rel", $type, 0); should_pass("hi", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet enumeration." => sub { my $type = mk_type('Id', {'enumeration' => ['ba','ca','efor','hregistry.as.on-work.u','_its-includ']}); should_pass("hregistry.as.on-work.u", $type, 0); should_pass("ca", $type, 0); should_pass("hregistry.as.on-work.u", $type, 0); should_pass("hregistry.as.on-work.u", $type, 0); should_pass("hregistry.as.on-work.u", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Id', {'whiteSpace' => 'collapse'}); should_pass("yto-by_process-primarily-type_revolution.and-the_te", $type, 0); should_pass("rorganization.cooperation-to.of-under.in-the.in-app", $type, 0); should_pass("_information.define.screen_interconnected-that_adve", $type, 0); should_pass("unetworking.technology_of-provide-developed_ways_th", $type, 0); should_pass("ithe_g.other-improved_asking-metrology-number_e.and", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 53." => sub { my $type = mk_type('Id', {'minLength' => '53'}); should_fail("w", $type, 0); should_fail("hheterogeneou", $type, 0); should_fail("rwill.product-the-that-ou", $type, 0); should_fail("achain_will_and_must_from.those-print", $type, 0); should_fail("dcommerce.understand_in-the.pervasive.second-gene", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 39." => sub { my $type = mk_type('Id', {'minLength' => '39'}); should_fail("g", $type, 0); should_fail("_must.web.", $type, 0); should_fail("vweb.in-global-with", $type, 0); should_fail("gtwo.performance.templates-t", $type, 0); should_fail("_registry-from_software-industry_with", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 33." => sub { my $type = mk_type('Id', {'minLength' => '33'}); should_fail("l", $type, 0); should_fail("_annual.", $type, 0); should_fail("wincluding-fed.", $type, 0); should_fail("ga_a-business.the-help", $type, 0); should_fail("gdata_respect_the_commerce_th", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 3." => sub { my $type = mk_type('Id', {'minLength' => '3'}); should_fail("s", $type, 0); should_fail("o", $type, 0); should_fail("_", $type, 0); should_fail("o", $type, 0); should_fail("v", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet minLength with value 64." => sub { my $type = mk_type('Id', {'minLength' => '64'}); should_fail("a", $type, 0); should_fail("rraised_approach", $type, 0); should_fail("_for.for_and-filter-and_its.par", $type, 0); should_fail("ospecifications.used_industries_mediums.each-t", $type, 0); should_fail("_can-used.lack-the.exchange.automatic.contributor-is_each_dis", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 1." => sub { my $type = mk_type('Id', {'maxLength' => '1'}); should_fail("_v", $type, 0); should_fail("hthat-describes.t", $type, 0); should_fail("lmust-specifications_both.work_t", $type, 0); should_fail("aclean.used.and-included.these_debug_for.relate", $type, 0); should_fail("jbe.security-standards_the_service.methods.original_as.as_tool", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 7." => sub { my $type = mk_type('Id', {'maxLength' => '7'}); should_fail("sopen.te", $type, 0); should_fail("kthat-personal_testing", $type, 0); should_fail("uour_respect.has-and-participate_dis", $type, 0); should_fail("pas_discovery.as_well-systems-the.target_and_intui", $type, 0); should_fail("band.technologies.as.by_become_specifications.transforming_well-", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 62." => sub { my $type = mk_type('Id', {'maxLength' => '62'}); should_fail("acost_can.documents_of_know-tools.s_tools.than-and_enabling_cro", $type, 0); should_fail("_for.to.set-software_is.this.the_language-better.and_the_to-app", $type, 0); should_fail("hhaving-regard_includes-of.to_and.market_be_computing_and_neede", $type, 0); should_fail("ipartnerships.and_diagnostic.commerce_projector_files_dynamic-p", $type, 0); should_fail("fuse-the_and-to.reputation_web.on-is-industry.transforming_perv", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 25." => sub { my $type = mk_type('Id', {'maxLength' => '25'}); should_fail("ris-technologies.at-techni", $type, 0); should_fail("p20.daily_applications.on.led_testi", $type, 0); should_fail("fcomputing_and-manipulate.tools-already.data", $type, 0); should_fail("mconformance_discussions_information.consortium_print", $type, 0); should_fail("wof-documents.better_the_advanced_led.challenges_any.automatic", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet maxLength with value 64." => sub { my $type = mk_type('Id', {'maxLength' => '64'}); should_fail("svirtually_repository.target-user.the_widespread_who-further_a.en", $type, 0); should_fail("gthe.international-of-processors-as.are-mediums_and.ambiguities_pervasive_and-of", $type, 0); should_fail("icomputing.back-adoption.exchange.testing_influence.results_following.industry-defining_a_busin", $type, 0); should_fail("padvanced.contributor.used.of.of-of-fed-standards-language-of.must.key.and-implementations_robust-graphical_al", $type, 0); should_fail("sbrowsers_lack-for-g_specifications.fed-provides.number-defining.hampered_testing_for-series-for_memory.in-using.the.built-th", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 1." => sub { my $type = mk_type('Id', {'length' => '1'}); should_fail("fi", $type, 0); should_fail("mleadership-are.o", $type, 0); should_fail("eand-is-by.neutral.signatures_to", $type, 0); should_fail("_to-the.and-registries.impact_requesting_filter", $type, 0); should_fail("nprocess.data-the_defines-heterogeneous.by-networking_the_soft", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 33." => sub { my $type = mk_type('Id', {'length' => '33'}); should_fail("e", $type, 0); should_fail("qand_lar", $type, 0); should_fail("dexercise_law.e", $type, 0); should_fail("ga_information.a.of_a-", $type, 0); should_fail("yaccessible_are_transmit-and-", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 3." => sub { my $type = mk_type('Id', {'length' => '3'}); should_fail("aham", $type, 0); should_fail("yan_such_lacking_wi", $type, 0); should_fail("vindustry_sensors-more_advanced-ha", $type, 0); should_fail("linvestigation_no.significant.prominent-s.is_its.", $type, 0); should_fail("dthe-in-technologies-files-with.organizations_technologies.proje", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 51." => sub { my $type = mk_type('Id', {'length' => '51'}); should_fail("f", $type, 0); should_fail("iheterogeneou", $type, 0); should_fail("scomputing_multidisciplin", $type, 0); should_fail("vsuite-retrieve-to_issues.documents.v", $type, 0); should_fail("schairing.reference.the-next_object-and.community", $type, 0); done_testing; }; subtest "Type atomic/ID is restricted by facet length with value 64." => sub { my $type = mk_type('Id', {'length' => '64'}); should_fail("q", $type, 0); should_fail("yas.technical_ar", $type, 0); should_fail("nsoftware-of-tune.competence-it", $type, 0); should_fail("iwidely.the_distributed.of_organization.promin", $type, 0); should_fail("lconformance_and-the-the_testing-of.and-to.with.is_be-and_dat", $type, 0); done_testing; }; done_testing; 50NCName.t000664001750001750 5137112404317273 14005 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/NCName is restricted by facet maxLength with value 1." => sub { my $type = mk_type('NCName', {'maxLength' => '1'}); should_pass("g", $type, 0); should_pass("k", $type, 0); should_pass("v", $type, 0); should_pass("h", $type, 0); should_pass("l", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 48." => sub { my $type = mk_type('NCName', {'maxLength' => '48'}); should_pass("i", $type, 0); should_pass("vby_to-this_", $type, 0); should_pass("iof-a_of_methods-profil", $type, 0); should_pass("kand_today.that.related-interconne", $type, 0); should_pass("sand-tools-to.as.developers-as-software.it_wi", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 12." => sub { my $type = mk_type('NCName', {'maxLength' => '12'}); should_pass("w", $type, 0); should_pass("hon", $type, 0); should_pass("qdisc", $type, 0); should_pass("ain-hou", $type, 0); should_pass("ofoster.o", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 37." => sub { my $type = mk_type('NCName', {'maxLength' => '37'}); should_pass("c", $type, 0); should_pass("las_partic", $type, 0); should_pass("eof_simplicity.mani", $type, 0); should_pass("qand-and.efforts-industry-in", $type, 0); should_pass("nbe_specifications-vocabulary_that_sy", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 64." => sub { my $type = mk_type('NCName', {'maxLength' => '64'}); should_pass("_", $type, 0); should_pass("iis.information-", $type, 0); should_pass("mwith_is_component_reference-th", $type, 0); should_pass("wfrom.related.that-which-dynamic-of.registry_b", $type, 0); should_pass("_revisions_in.products-and-of.is-ultimate-become-to_must.and_", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 1." => sub { my $type = mk_type('NCName', {'minLength' => '1'}); should_pass("_", $type, 0); should_pass("bfile-by.particu", $type, 0); should_pass("eallow_uses_g-and-for.set.porta", $type, 0); should_pass("_and.exchange_known-use-to_data_means.implemen", $type, 0); should_pass("ctest-come-must-criteria_partnerships.well-entire_and.chosen_", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 47." => sub { my $type = mk_type('NCName', {'minLength' => '47'}); should_pass("dweb.of-in_both.chains_computing_and.using-a.su", $type, 0); should_pass("gregard-hardware-first-generation.ambiguities.a-opp", $type, 0); should_pass("sand.of.of_discussions-data_has.chain.industry-computed", $type, 0); should_pass("_shift.the.of-information-and.for-reference.by_and_around_a", $type, 0); should_pass("_them-to_for-creation-specifications.versions_these-data.intero", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 32." => sub { my $type = mk_type('NCName', {'minLength' => '32'}); should_pass("mthe-to.provided_cost.and.cross-", $type, 0); should_pass("aimplementation.file.embedded-of-and.add", $type, 0); should_pass("gtechnologies_is_and_business.versions.use-of_av", $type, 0); should_pass("vspecifications.electronic.allow_a-four-developing_embed", $type, 0); should_pass("mservices-for_has.wireless.sense-the-and.of-indication.as.and.fo", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 60." => sub { my $type = mk_type('NCName', {'minLength' => '60'}); should_pass("oavailable.the-create-systems-annual.basis-exchange-issues_a", $type, 0); should_pass("yenvironment.with_and_range-operating-generation_a.would.refe", $type, 0); should_pass("pdynamic.a_partnerships-the-with-the-from-libraries-systems-in", $type, 0); should_pass("ftools_based-systems-to-widely_using_industry.development-and-f", $type, 0); should_pass("_for-for.offer-languages_would-diagnostic.maintained.for.effort-", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 64." => sub { my $type = mk_type('NCName', {'minLength' => '64'}); should_pass("eincluding-models-object-and_information-life_of_a-and-reach.ove", $type, 0); should_pass("oof.and.are_a-business-accelerate-generation-known.unbiased_voca", $type, 0); should_pass("rgeneration_many_in.semantics.around-well_electronic_are.a_to.bu", $type, 0); should_pass("hvendors-of_that-be.choices_any_and.meets_tests_file_pervasive.a", $type, 0); should_pass("nissues-developing_with.object_and-languages.emerging-will-voice", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 1." => sub { my $type = mk_type('NCName', {'length' => '1'}); should_pass("a", $type, 0); should_pass("b", $type, 0); should_pass("p", $type, 0); should_pass("r", $type, 0); should_pass("k", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 61." => sub { my $type = mk_type('NCName', {'length' => '61'}); should_pass("ie.signatures_advent-quality-being_templates.process_can.stan", $type, 0); should_pass("ufirst.set_and_20_methods_well_from_and-and_and.adoption_such", $type, 0); should_pass("_industries_and_of_and-the_aid.designed-of_and.a.and-among.to", $type, 0); should_pass("mlack_documents.by_repository.is.standards.that.be-and-discus", $type, 0); should_pass("jmanual.disseminate-for.consortium.performance-foster_provide", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 53." => sub { my $type = mk_type('NCName', {'length' => '53'}); should_pass("kfuture-and-the.eliminate-use_discovery_more-its_that", $type, 0); should_pass("_available-these-as-improved_enabling.and.chairs_meet", $type, 0); should_pass("yindustry-used-choices.for_key_for_partnerships.proce", $type, 0); should_pass("_heterogeneous_good_industry-standardization-concepts", $type, 0); should_pass("jcalled-by-is.automate_in-file-profiles_file-a-succes", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 61." => sub { my $type = mk_type('NCName', {'length' => '61'}); should_pass("kand.the.000-will_known.networks.manufacturers-to_resource.g_", $type, 0); should_pass("rlanguages-and_localized.and.and_of.enforcement.ensure-comput", $type, 0); should_pass("bpico-cellular.of.chosen_of.good_by-around.maintained-by-poss", $type, 0); should_pass("ireference_for_and-areas_must_industry.a.and.interconnected-c", $type, 0); should_pass("_allows.all-the-conferences-enable-under_registry_embedded_fr", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 64." => sub { my $type = mk_type('NCName', {'length' => '64'}); should_pass("xworld-participate.define.in.to.to.on-act_computing-discovery-pr", $type, 0); should_pass("_as_be.for.must_of-the-for-its.time_asked_organizations_implemen", $type, 0); should_pass("hfiles_adoption.and.has.the_our_implementation_our.testing_annua", $type, 0); should_pass("lthe.the_these_and-a_target.service_high-provides.prototypes-lif", $type, 0); should_pass("mindustry_correction.the-of-hoc_and-address_a.implementations.si", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{16}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('NCName', {}); should_pass("ta-reviewed-and-d", $type, 0); should_pass("lwhich.high_parti", $type, 0); should_pass("ias.software-a-th", $type, 0); should_pass("_standards_partic", $type, 0); should_pass("fin_entire.and-ha", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{40}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('NCName', {}); should_pass("onetworking-and_projector-of-tremendous_a", $type, 0); should_pass("rinclude_the-a.the_developers-effort-well", $type, 0); should_pass("wand.forensics.processes.etc_due_that-def", $type, 0); should_pass("ocreating_file_and-in_and_the.information", $type, 0); should_pass("_through_industry-of.and_and.information.", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{27}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('NCName', {}); should_pass("_a.tools.entire_revolution.o", $type, 0); should_pass("lwill-will-industry_conforma", $type, 0); should_pass("_the.the.industry.which.prob", $type, 0); should_pass("_precise-of.them-this.which_", $type, 0); should_pass("_unbiased.implementation.as.", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{12}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('NCName', {}); should_pass("oof-and-elect", $type, 0); should_pass("_tests-domain", $type, 0); should_pass("qthe.the-numb", $type, 0); should_pass("_a_and_with.t", $type, 0); should_pass("vcomponent_an", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet pattern with value [\\i-[:]][\\c-[:]]{63}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('NCName', {}); should_pass("_to.measurements_registries.would.will-success-testing.known.amb", $type, 0); should_pass("bfor_will_creating.emerging.result-database-language-for_can-inc", $type, 0); should_pass("gand.program_for-that-effective-process-a.and_standards.help-use", $type, 0); should_pass("_choices.would.commerce_computing.for-of-in_libraries-technology", $type, 0); should_pass("sthis_those_industry_and_automate.file.such-due-discussions-of.p", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet enumeration." => sub { my $type = mk_type('NCName', {'enumeration' => ['_is-testing.registry_for_come_popular-networking-is-betwe','ris.both-including-industries_software.which-stak','cof-a-retrieve-contained_into_for.indu','vwith.computers_discussions.applic','ew','_is-known.must_manipulate-to_refer','ga.the_the','ha_ad_prototype_led.process_other-of.specifications_appropriat']}); should_pass("ga.the_the", $type, 0); should_pass("vwith.computers_discussions.applic", $type, 0); should_pass("vwith.computers_discussions.applic", $type, 0); should_pass("_is-known.must_manipulate-to_refer", $type, 0); should_pass("cof-a-retrieve-contained_into_for.indu", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet enumeration." => sub { my $type = mk_type('NCName', {'enumeration' => ['osoftware-widespread_must_re','vto.significant_government_disseminate.industry.a_over','_industry-the-in_specifications.the_d','hsystems-i','bresource.and-c','fboth-th','_investigation.of-help_its-be_support.vendors_and_many-commerce','ewho-vocabularies-it-adoption_m']}); should_pass("fboth-th", $type, 0); should_pass("fboth-th", $type, 0); should_pass("_industry-the-in_specifications.the_d", $type, 0); should_pass("_industry-the-in_specifications.the_d", $type, 0); should_pass("_investigation.of-help_its-be_support.vendors_and_many-commerce", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet enumeration." => sub { my $type = mk_type('NCName', {'enumeration' => ['uprofiles.pa','cused.de','yboth-in-each-the_discuss_electronic_can_i','cof.issues.includes.used-20_the.e-we.to.manual-to-','gtools_the-the-are.key_mechanism_the_i','_repository_having-based-enterprises_contribute_filte']}); should_pass("cof.issues.includes.used-20_the.e-we.to.manual-to-", $type, 0); should_pass("cof.issues.includes.used-20_the.e-we.to.manual-to-", $type, 0); should_pass("cof.issues.includes.used-20_the.e-we.to.manual-to-", $type, 0); should_pass("yboth-in-each-the_discuss_electronic_can_i", $type, 0); should_pass("uprofiles.pa", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet enumeration." => sub { my $type = mk_type('NCName', {'enumeration' => ['xstandards-and-all-different-such.the_particularly.transmit_to','kindication.all-a_of_resources_with.cost-via-','welectronic-worki','iof_for-in.in-repository_other.and-of-i','_within.can.standard-and_fo','nto-use','oexecution_industry_data_indus','wupon-and_available.and-is.to.among_and_application-']}); should_pass("nto-use", $type, 0); should_pass("wupon-and_available.and-is.to.among_and_application-", $type, 0); should_pass("nto-use", $type, 0); should_pass("_within.can.standard-and_fo", $type, 0); should_pass("xstandards-and-all-different-such.the_particularly.transmit_to", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet enumeration." => sub { my $type = mk_type('NCName', {'enumeration' => ['kobject-transact-constituent_of_file.is_without_about_are_a.be','ocontribu','dof_set.wireless-buildin','uand-manipulation.good.information.ambiguities-','tthrough-of_av','_divisions.years_for_partnership-fed-','aneutral_heterogeneous.reproduced-will_','_and.to-we_frameworks-pervasive_the-regi','uin-and-ensure.']}); should_pass("_divisions.years_for_partnership-fed-", $type, 0); should_pass("tthrough-of_av", $type, 0); should_pass("ocontribu", $type, 0); should_pass("kobject-transact-constituent_of_file.is_without_about_are_a.be", $type, 0); should_pass("ocontribu", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('NCName', {'whiteSpace' => 'collapse'}); should_pass("rto.", $type, 0); should_pass("hdev", $type, 0); should_pass("idoc", $type, 0); should_pass("ginf", $type, 0); should_pass("aint", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 23." => sub { my $type = mk_type('NCName', {'minLength' => '23'}); should_fail("e", $type, 0); should_fail("_testi", $type, 0); should_fail("hto.of_for_", $type, 0); should_fail("_pervasive-will_", $type, 0); should_fail("ta-to_for-and-applica", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 35." => sub { my $type = mk_type('NCName', {'minLength' => '35'}); should_fail("_", $type, 0); should_fail("gvisibly.", $type, 0); should_fail("kfrom.rigorous_re", $type, 0); should_fail("yfilter_is_files.second-g", $type, 0); should_fail("eambiguities_dynamic-tools-by_the", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 58." => sub { my $type = mk_type('NCName', {'minLength' => '58'}); should_fail("p", $type, 0); should_fail("yneutral_develo", $type, 0); should_fail("_and_of_which.interconnected-", $type, 0); should_fail("oprint_in_assuring_in.implementations.speci", $type, 0); should_fail("vand-to_further-partners.areas.of.made-industries-informa", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 53." => sub { my $type = mk_type('NCName', {'minLength' => '53'}); should_fail("l", $type, 0); should_fail("lwireless.imp", $type, 0); should_fail("rthese-data-and-defining_", $type, 0); should_fail("osimplest_performance-mechanism_to.th", $type, 0); should_fail("wmaintains_reference.obtained.that.as.tools.and-e", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet minLength with value 64." => sub { my $type = mk_type('NCName', {'minLength' => '64'}); should_fail("_", $type, 0); should_fail("fdiscovery-softw", $type, 0); should_fail("qasked.to-as_memory-and.such-in", $type, 0); should_fail("wbuild-its_known.standardization-efforts-signi", $type, 0); should_fail("xcomputing_of-a.computer-an.as.as_include_used.role_profiles-", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 1." => sub { my $type = mk_type('NCName', {'maxLength' => '1'}); should_fail("lt", $type, 0); should_fail("qissues-quality-o", $type, 0); should_fail("xand_to.templates.and_to_filter_", $type, 0); should_fail("afrom-of_application_creating-partnerships.defi", $type, 0); should_fail("iis.forum.organizations.to-of.and.files.to_to_use.data-partner", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 24." => sub { my $type = mk_type('NCName', {'maxLength' => '24'}); should_fail("celiminate-to_with-techno", $type, 0); should_fail("ibe-product.the_law-and.eliminated", $type, 0); should_fail("_reputation_the.and-is_define_in_to-will_of", $type, 0); should_fail("abasis-be_about_are_management-define.language_of_e.", $type, 0); should_fail("_working-standards_in-manipulate.result.files_and.built_and-a", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 56." => sub { my $type = mk_type('NCName', {'maxLength' => '56'}); should_fail("ksuite.revolution_signatures-asked_make_in.complex_we-dev", $type, 0); should_fail("gentire.e_systems-on-a-chip.reference_describes-understand", $type, 0); should_fail("jconsistency.ability_a_for_and-then.print.vocabularies-obje", $type, 0); should_fail("nreference.discussions.product.networks_by.this-must-of_the-", $type, 0); should_fail("nsuites.to_asking_raised_file_networking-conformance-provided", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 20." => sub { my $type = mk_type('NCName', {'maxLength' => '20'}); should_fail("_the-and_pico-cellula", $type, 0); should_fail("wimplementations.particularly-p", $type, 0); should_fail("vindustry-debug_to_has.and_who.of.of-avai", $type, 0); should_fail("_some_these_are_of_is-in.regard.cost.them_would-as.", $type, 0); should_fail("padditionally.technologies.support-computer-great_computer.vo", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet maxLength with value 64." => sub { my $type = mk_type('NCName', {'maxLength' => '64'}); should_fail("cdigital-the_that-of.known.tools_and_law.is-variety-vendors_files", $type, 0); should_fail("efor_creation_has_will_these-competence_and.known_law.cross-over_discovery_used.", $type, 0); should_fail("ugraphics-providing.this-of-international.process_implementations-of-and-repository-adoption-su", $type, 0); should_fail("nin-emerging-and_e.documents_for_areas_the-a.technical-them_and_tools.be_systems-the.concepts.for_s-of-languag", $type, 0); should_fail("hrobust.define_small-_of_to.automating_versions.industry-that.specifications_a-containing_that.data-computing.data-file.them_", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 1." => sub { my $type = mk_type('NCName', {'length' => '1'}); should_fail("fs", $type, 0); should_fail("_capabilities-the", $type, 0); should_fail("wobvious.a_environments_will-eli", $type, 0); should_fail("uspecifications.eliminate_define-is.to-and.and.", $type, 0); should_fail("_both.to.requires.sensors-to_known.market_not_years_of_technic", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 48." => sub { my $type = mk_type('NCName', {'length' => '48'}); should_fail("s", $type, 0); should_fail("xcapabilitie", $type, 0); should_fail("hdeployed-documents-pro", $type, 0); should_fail("bwithin.industries.repository.rapi", $type, 0); should_fail("xdata_technologies-and-that_and_measure-we.co", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 11." => sub { my $type = mk_type('NCName', {'length' => '11'}); should_fail("bwireless_an", $type, 0); should_fail("smust.guidelines-creation", $type, 0); should_fail("ha-particular-ensure.lies.to-from_is-e", $type, 0); should_fail("_first-generation-registry_quality-product.systems-", $type, 0); should_fail("gsoftware_compatibility_already-ability.g_logic-addressing_throu", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 52." => sub { my $type = mk_type('NCName', {'length' => '52'}); should_fail("_", $type, 0); should_fail("kestablish-ca", $type, 0); should_fail("genforcement.infrastructu", $type, 0); should_fail("iand.filter-software_fact.conformance", $type, 0); should_fail("_for_indication.ensure_signatures.their_designed.", $type, 0); done_testing; }; subtest "Type atomic/NCName is restricted by facet length with value 64." => sub { my $type = mk_type('NCName', {'length' => '64'}); should_fail("w", $type, 0); should_fail("oa-related-devel", $type, 0); should_fail("xwith-recommendation_reference-", $type, 0); should_fail("lamong-will_on-and-information_organizations.c", $type, 0); should_fail("_than_create.can-language-directions-result_the.and_the.this.", $type, 0); done_testing; }; done_testing; 50NMTOKEN.t000664001750001750 5047512404317273 14023 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 1." => sub { my $type = mk_type('NmToken', {'maxLength' => '1'}); should_pass("o", $type, 0); should_pass("c", $type, 0); should_pass("m", $type, 0); should_pass("m", $type, 0); should_pass("p", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 41." => sub { my $type = mk_type('NmToken', {'maxLength' => '41'}); should_pass("i", $type, 0); should_pass("build.measu", $type, 0); should_pass("information-exercise_", $type, 0); should_pass("to_world-including:for.A_of:lan", $type, 0); should_pass("success:hampered:and_interoperability:doc", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 42." => sub { my $type = mk_type('NmToken', {'maxLength' => '42'}); should_pass("o", $type, 0); should_pass("to-cooperat", $type, 0); should_pass("and:available_a:suite", $type, 0); should_pass("using:all_as_software.efforts.d", $type, 0); should_pass("of:of.over:results.and:which.A:Develop_co", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 54." => sub { my $type = mk_type('NmToken', {'maxLength' => '54'}); should_pass("c", $type, 0); should_pass("the.repository", $type, 0); should_pass("will::creates_to:and:An-ens", $type, 0); should_pass("from_of_of-must.and_and_the:asked.develo", $type, 0); should_pass("retrieves-them-repository.and-XSL-FO:development-inte", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 64." => sub { my $type = mk_type('NmToken', {'maxLength' => '64'}); should_pass("c", $type, 0); should_pass("XML-can_of.techn", $type, 0); should_pass("displaying_highly.language-as_a", $type, 0); should_pass("browsers-Structured:approach-intuitive-primary", $type, 0); should_pass("with.the_partnership.build_that.and-four.OASIS:of.and:first_o", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 1." => sub { my $type = mk_type('NmToken', {'minLength' => '1'}); should_pass("t", $type, 0); should_pass("The:for:called_o", $type, 0); should_pass("communication:discuss:informati", $type, 0); should_pass("process:standardization.and.and.ebXML-body-to-", $type, 0); should_pass("with-signatures:The-as:prototypes.database_be.care_wireless-e", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 45." => sub { my $type = mk_type('NmToken', {'minLength' => '45'}); should_pass("The_ensure_is.are-appropriate_more:as:the.are", $type, 0); should_pass("data-Naval_software_a_of_files.test-retrieval_reg", $type, 0); should_pass("of:a_The.landscape-other.contribute_computing_unbiase", $type, 0); should_pass("reproduced-database.ad-Advancement_and:recent-and:do_the_", $type, 0); should_pass("beta_library_operating-are-to:subject:in:filter_understand_an", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 35." => sub { my $type = mk_type('NmToken', {'minLength' => '35'}); should_pass("the_repository.correction-a:Investi", $type, 0); should_pass("into_that-choices-coupled_being-Pervasive:", $type, 0); should_pass("electronic-our:must:DOM-The_role:these_and:the:si", $type, 0); should_pass("for_widely:this.known_the_that.location.profiles:visibly", $type, 0); should_pass("industry-allow_repository_have.tune:Working-offer:asked.supply-", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 33." => sub { my $type = mk_type('NmToken', {'minLength' => '33'}); should_pass("XML:environments.is.being.objects", $type, 0); should_pass("used:the:that-profiles-standards-reposit", $type, 0); should_pass("and.if:are:by:the:Simulation:the-the:help.NIST-", $type, 0); should_pass("on.would_is_the_particularly:of-computer.the-requires-", $type, 0); should_pass("that-groups:systems_software.find_data.addition.will-SMEs-tha", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 64." => sub { my $type = mk_type('NmToken', {'minLength' => '64'}); should_pass("languages-computing_specifications_way:for.chain:organization:fo", $type, 0); should_pass("suites:paradigm.manipulate_will-success.only-more:data.discussio", $type, 0); should_pass("and:e:program_rigorous:discuss_we:a_the:tools:robust_robust_is:r", $type, 0); should_pass("number:discovery_on:type:The-to:partnerships:such.tools.act-Nati", $type, 0); should_pass("global:and_can.enterprises.file:interacting-U:must.and_with.SOC.", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 1." => sub { my $type = mk_type('NmToken', {'length' => '1'}); should_pass("t", $type, 0); should_pass("f", $type, 0); should_pass("o", $type, 0); should_pass("r", $type, 0); should_pass("c", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 38." => sub { my $type = mk_type('NmToken', {'length' => '38'}); should_pass("global_application-creation:a-a_reposi", $type, 0); should_pass("dynamic:registries_file_A.be.as_would-", $type, 0); should_pass("interoperability_reference.to:specific", $type, 0); should_pass("and-as_wide-SMEs.with-i_Provide_the.to", $type, 0); should_pass("including_problems.be-and-Schema:and:a", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 57." => sub { my $type = mk_type('NmToken', {'length' => '57'}); should_pass("the.joint-s:these.well.and.Such.five-suite.and:to:cross-o", $type, 0); should_pass("NSRL_utilities.discover_to.ability.also:for:are-helping_p", $type, 0); should_pass("user:looking:repository:is-to_beta-without.standardizatio", $type, 0); should_pass("robust_build:EC:used:success:international.individual-suc", $type, 0); should_pass("of.mechanism_Reference:widely.Schema:signature_Informatio", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 60." => sub { my $type = mk_type('NmToken', {'length' => '60'}); should_pass("the:prominent:A.key.registry-frameworks.using.tool.hampered-", $type, 0); should_pass("of_Advancement.same:and-XML.designed_know:of-the_context-ric", $type, 0); should_pass("of.which:is_Internet-Although-addressing.will.to:market_amon", $type, 0); should_pass("Schemas_Standards_development:and.software:known:and:interac", $type, 0); should_pass("transactions-and-are:that.link:is_good-retrieve.for_are:Only", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 64." => sub { my $type = mk_type('NmToken', {'length' => '64'}); should_pass("of.for_between:A.of:investigations:recent:software_signatures.ab", $type, 0); should_pass("Provide_the_be.Sun_and-an.involved_In:and-is_prominent-of-chains", $type, 0); should_pass("advanced:Description-in-role.used-and:enterprises_can_and-softwa", $type, 0); should_pass("and:electronic.signatures:in-The.Working_as.through.Experimental", $type, 0); should_pass("future:the:compliant-industry.including:technology_Using-the:thi", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{40}." => sub { my $type = mk_type('NmToken', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){40}$)/}); should_pass("participants.file-interconnecting_will.v", $type, 0); should_pass("computer.systems_their:wide.the:assuring", $type, 0); should_pass("provides.facilitates:known-discussions:o", $type, 0); should_pass("only-review_that:particularly-DOM:Comput", $type, 0); should_pass("and:multidisciplinary.software_years_an:", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{18}." => sub { my $type = mk_type('NmToken', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){18}$)/}); should_pass("in.typical_tools:m", $type, 0); should_pass("and:Conformance:to", $type, 0); should_pass("tests.clean:succes", $type, 0); should_pass("virtually-discover", $type, 0); should_pass("with.define-to:cha", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{6}." => sub { my $type = mk_type('NmToken', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){6}$)/}); should_pass("for_AP", $type, 0); should_pass("XML.to", $type, 0); should_pass("to-Too", $type, 0); should_pass("abilit", $type, 0); should_pass("XML-op", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{33}." => sub { my $type = mk_type('NmToken', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){33}$)/}); should_pass("small-.and.for.these-for:Provide-", $type, 0); should_pass("if_discovery.to_allow-vocabulary_", $type, 0); should_pass("nature.participate.to-key.contrib", $type, 0); should_pass("web.in_DOM-precise_languages.Erro", $type, 0); should_pass("signature.the-lack.to-XML.discove", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet pattern with value \\c{18}." => sub { my $type = mk_type('NmToken', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){18}$)/}); should_pass("include_internatio", $type, 0); should_pass("repositories.use:c", $type, 0); should_pass("annual-data.a:lies", $type, 0); should_pass("the-A:National.hav", $type, 0); should_pass("be.files.and:of-tr", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet enumeration." => sub { my $type = mk_type('NmToken', {'enumeration' => ['Internet_will:_that:to_mad','computing-NSRL.can:a.to-of:must-perv','launching.correctness_revisions_and.sp','that.cost_Business-for_are:industries:processes_pico-','collaborate-tools-we_with.each.the_relationships_networ']}); should_pass("Internet_will:_that:to_mad", $type, 0); should_pass("Internet_will:_that:to_mad", $type, 0); should_pass("Internet_will:_that:to_mad", $type, 0); should_pass("launching.correctness_revisions_and.sp", $type, 0); should_pass("launching.correctness_revisions_and.sp", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet enumeration." => sub { my $type = mk_type('NmToken', {'enumeration' => ['led:back:must.ITL_applications:excha','and-software.help.be:shift:offer.DOM.working.automate:Co','cost:on:and_available-will.to:must.tune:creati','as:test-Markup-supply.transactions_for_Standards.for-with.sig','outfitting.donat','and-to:Simulation:pro','working.solve-']}); should_pass("working.solve-", $type, 0); should_pass("working.solve-", $type, 0); should_pass("outfitting.donat", $type, 0); should_pass("outfitting.donat", $type, 0); should_pass("and-software.help.be:shift:offer.DOM.working.automate:Co", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet enumeration." => sub { my $type = mk_type('NmToken', {'enumeration' => ['needed:as-is.Furthermore_retrieve-to.means.find','the_United-development-and-each-disco','Groups_in_','industry:Advancement.permitting_conformance.and_will-partici','than:business:ebXML-of:for.of_electronic.diagnosti','manual.that.tools.standard','discover.OASIS-versions.has.compatibility-embedded','browsers:DOM:both.chain:the:recommending.C','methods.profiles.ensure_manipulate.b','criteria:-must-tar']}); should_pass("methods.profiles.ensure_manipulate.b", $type, 0); should_pass("browsers:DOM:both.chain:the:recommending.C", $type, 0); should_pass("criteria:-must-tar", $type, 0); should_pass("manual.that.tools.standard", $type, 0); should_pass("industry:Advancement.permitting_conformance.and_will-partici", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet enumeration." => sub { my $type = mk_type('NmToken', {'enumeration' => ['trans','Objec','must_Investigators_signatures:tools_software-to.that-as:ro','that_profiles:defi','related_implementation-security.capabilities:that','The-of_files.for.Recommendation-appropriate-disco']}); should_pass("that_profiles:defi", $type, 0); should_pass("The-of_files.for.Recommendation-appropriate-disco", $type, 0); should_pass("must_Investigators_signatures:tools_software-to.that-as:ro", $type, 0); should_pass("related_implementation-security.capabilities:that", $type, 0); should_pass("trans", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet enumeration." => sub { my $type = mk_type('NmToken', {'enumeration' => ['cross-over.related.ambiguities-The.Ex','via.discussions','have_automatic','prominent_retrieve_rigorous.a:of-for.define-and:participants:Ja','only:d','object_rapid.of:partners:including.docume','define.a:Schemas-OASIS:working.Conference_profi']}); should_pass("cross-over.related.ambiguities-The.Ex", $type, 0); should_pass("object_rapid.of:partners:including.docume", $type, 0); should_pass("via.discussions", $type, 0); should_pass("object_rapid.of:partners:including.docume", $type, 0); should_pass("via.discussions", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('NmToken', {'whiteSpace' => 'collapse'}); should_pass("and_is_that_use:issues:data.t", $type, 0); should_pass("under.the_digital-among-calle", $type, 0); should_pass("is-OASIS.of_related_wide-file", $type, 0); should_pass("and_and-design-defines_first_", $type, 0); should_pass("and_operating:and.effectively", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 49." => sub { my $type = mk_type('NmToken', {'minLength' => '49'}); should_fail("l", $type, 0); should_fail("software-pro", $type, 0); should_fail("highly:of.and_by.most_l", $type, 0); should_fail("prominent.as:and:will:.retrieve-Ad", $type, 0); should_fail("will-as.developing-test-in:registries:test_co", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 51." => sub { my $type = mk_type('NmToken', {'minLength' => '51'}); should_fail("s", $type, 0); should_fail("computer-comp", $type, 0); should_fail("for-wireless_defines.buil", $type, 0); should_fail("reference:be.used.the:of.for:XML-for.", $type, 0); should_fail("as:displaying_completion:of_a.annual-into-the.als", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 17." => sub { my $type = mk_type('NmToken', {'minLength' => '17'}); should_fail("d", $type, 0); should_fail("effe", $type, 0); should_fail("partner", $type, 0); should_fail("A_improved", $type, 0); should_fail("such-retrieve", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 3." => sub { my $type = mk_type('NmToken', {'minLength' => '3'}); should_fail("d", $type, 0); should_fail("w", $type, 0); should_fail("a", $type, 0); should_fail("d", $type, 0); should_fail("l", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet minLength with value 64." => sub { my $type = mk_type('NmToken', {'minLength' => '64'}); should_fail("w", $type, 0); should_fail("implementation.t", $type, 0); should_fail("HTML:component:Standards.many_t", $type, 0); should_fail("documents:automated_XSL-FO.used.to:information", $type, 0); should_fail("for:is_etc.process-of:the.is-full-of.retrieve.Within_must:dev", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 1." => sub { my $type = mk_type('NmToken', {'maxLength' => '1'}); should_fail("th", $type, 0); should_fail("software.the-for_", $type, 0); should_fail("A.profiles-have:embedded_files.a", $type, 0); should_fail("the-related_mediums:Although.international_brow", $type, 0); should_fail("these:a-from.looking.for_help-As-to.business_dynamic-Conferenc", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 50." => sub { my $type = mk_type('NmToken', {'maxLength' => '50'}); should_fail("forum_to_for.The.using_and_widely-is:the.enable:The", $type, 0); should_fail("the.OASIS:discussions-act:to-the:the:XML.revolution-la", $type, 0); should_fail("with-Conformance_documents_data-less.To-XML.environment.i", $type, 0); should_fail("building:and:discovery:discovery_directions.define:Pervasive", $type, 0); should_fail("reference-Schemas_be_will:-automate.defines.create:any-XML.law-", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 21." => sub { my $type = mk_type('NmToken', {'maxLength' => '21'}); should_fail("ensure:the:Software-wi", $type, 0); should_fail("and_and-with.in-coupled-systems_", $type, 0); should_fail("permitting-software-the-helping:as.simulat", $type, 0); should_fail("in:be_completion_library.can-for.management_a.leader", $type, 0); should_fail("signatures:XSL-FO.build.first-generation_a_annual.four-user_re", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 27." => sub { my $type = mk_type('NmToken', {'maxLength' => '27'}); should_fail("the.defining-life-and:In:ass", $type, 0); should_fail("we-supply.the_guidelines:of-to_of_rep", $type, 0); should_fail("for_for:resources_of_memory_related:database_L", $type, 0); should_fail("effective_as-back-applications:to-reference.coupled.the", $type, 0); should_fail("deployed-OASIS:into-addressing:leadership.the_computing_componen", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet maxLength with value 64." => sub { my $type = mk_type('NmToken', {'maxLength' => '64'}); should_fail("If.will_availability-computing.networking:coupled-to-testing_part", $type, 0); should_fail("of:addressing.Investigators.a_to_partners:and_exchange-in_Such-for_service_is-to", $type, 0); should_fail("a.primarily:OASIS:to.modeling.hampered:and_those:HTML.of-devices_ability_intuitive_completion:t", $type, 0); should_fail("building.systems:to-to.as.to.known:and.related:that.and:service:challenges-their-the.international-containing_", $type, 0); should_fail("between:a-are_profiles_at.developed_registry_XSL-FO-consortiums.popular-technologies.is.of-engineering.own.typical:suites:in:", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 1." => sub { my $type = mk_type('NmToken', {'length' => '1'}); should_fail("ge", $type, 0); should_fail("typical-small-.an", $type, 0); should_fail("to.are.appropriate-would-of:as-a", $type, 0); should_fail("use-In.Experimental.SOC.be-to:are:and.the:use-t", $type, 0); should_fail("as.from-highly_opportunity:security_multidisciplinary-with:has", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 9." => sub { my $type = mk_type('NmToken', {'length' => '9'}); should_fail("It_s-Compu", $type, 0); should_fail("advent:standard-and_own", $type, 0); should_fail("and.to_XML.facilitates.and-database:", $type, 0); should_fail("repository-web.prototype_improved_robust.to-The-e", $type, 0); should_fail("no.networks_ambiguities:these:of_standardization.neutral_to_Re", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 50." => sub { my $type = mk_type('NmToken', {'length' => '50'}); should_fail("h", $type, 0); should_fail("provide.s.voc", $type, 0); should_fail("conformant.and_a:with_the", $type, 0); should_fail("through.to.of:been:software_this-reco", $type, 0); should_fail("testing.for_Developers.distributed:simulation_hav", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 52." => sub { my $type = mk_type('NmToken', {'length' => '52'}); should_fail("f", $type, 0); should_fail("hoc-reference", $type, 0); should_fail("interoperable:and-the:def", $type, 0); should_fail("Additionally-has_offer:throughout.fil", $type, 0); should_fail("stimulus_for-using.the-HTML:under_in:paradigm_and", $type, 0); done_testing; }; subtest "Type atomic/NMTOKEN is restricted by facet length with value 64." => sub { my $type = mk_type('NmToken', {'length' => '64'}); should_fail("f", $type, 0); should_fail("match.and:the.th", $type, 0); should_fail("is_manipulate-testing.as:the.co", $type, 0); should_fail("as-g_management:and-specification:be_revolutio", $type, 0); should_fail("accelerate.An:repository_as_in:creation.of_build:adoption.gra", $type, 0); done_testing; }; done_testing; 50Name.t000664001750001750 4766212404317273 13574 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/Name is restricted by facet maxLength with value 1." => sub { my $type = mk_type('Name', {'maxLength' => '1'}); should_pass("h", $type, 0); should_pass("j", $type, 0); should_pass("y", $type, 0); should_pass("_", $type, 0); should_pass("w", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 2." => sub { my $type = mk_type('Name', {'maxLength' => '2'}); should_pass("e", $type, 0); should_pass("w", $type, 0); should_pass("o", $type, 0); should_pass("p", $type, 0); should_pass("w", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 11." => sub { my $type = mk_type('Name', {'maxLength' => '11'}); should_pass(":", $type, 0); should_pass("fin", $type, 0); should_pass("cmeth", $type, 0); should_pass("ythe:fi", $type, 0); should_pass("_the_an-i", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 24." => sub { my $type = mk_type('Name', {'maxLength' => '24'}); should_pass("l", $type, 0); should_pass("_langu", $type, 0); should_pass("sof.emergin", $type, 0); should_pass(":among.systems-s", $type, 0); should_pass("vfor_portable.in_oper", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 64." => sub { my $type = mk_type('Name', {'maxLength' => '64'}); should_pass("i", $type, 0); should_pass("_information-div", $type, 0); should_pass(":the:for:wireless.reference:as:", $type, 0); should_pass("_led_technology-allow:competence:next_a:well.n", $type, 0); should_pass("gand.sense_of:academia_the-the.the:to_and_ensure-for.eliminat", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 1." => sub { my $type = mk_type('Name', {'minLength' => '1'}); should_pass("_", $type, 0); should_pass("kthe.appropriate", $type, 0); should_pass(":the_international.of_as-as-cos", $type, 0); should_pass("xregistry:shift.business:known-eliminated.of.s", $type, 0); should_pass("maddress-chosen:correction_technologies-including-the.testing", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 63." => sub { my $type = mk_type('Name', {'minLength' => '63'}); should_pass("_ensure-thus.localized:second-generation:templates.of.annual:by", $type, 0); should_pass("hif.testability_partnership-manipulation.transforming_allow-as:", $type, 0); should_pass("fwill-created.into:processes-filter_them-be.the_chairing-can:di", $type, 0); should_pass("dand.entire_recommending-organizations.development_on.in.of_voc", $type, 0); should_pass("fand:work:used:community_paradigm.filter:defining.the_repositor", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 28." => sub { my $type = mk_type('Name', {'minLength' => '28'}); should_pass("isoftware_made.tremendous:wi", $type, 0); should_pass("dif-the-security:files-5_with-with-it", $type, 0); should_pass("eto-to-with.concepts.implementation-respect_be", $type, 0); should_pass(":the_industry:discussions-as:hardware.for_these.and:res", $type, 0); should_pass("pthe_retrieve_fact-the:be_with-language:back_modeling:the.manipu", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 54." => sub { my $type = mk_type('Name', {'minLength' => '54'}); should_pass("mengineering.devices_these.used:distributed_projector.", $type, 0); should_pass("xobjects:and:systems-conformance.the_which:the_own_to-to", $type, 0); should_pass("cdeveloping:be.information-creation-both-will.repository:i", $type, 0); should_pass("jto:interconnected.and-system.a-manual-the.for:specific:prov", $type, 0); should_pass(":use_chain-lack.most:measure-help:the-creating:into.discovery:", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 64." => sub { my $type = mk_type('Name', {'minLength' => '64'}); should_pass("pconsortiums_known:the:the_market_include_the-revisions-role_mat", $type, 0); should_pass("wall_cooperation-to_industries:commerce_hardware.and:high.and-vo", $type, 0); should_pass("ghelp.of-into:used-alike-performance-contains.the_the_back_coope", $type, 0); should_pass("uusing-organizations.with-who-need-in_automating:as:can:the_be.s", $type, 0); should_pass("wis.for-within_from-of.e.for_development_the:personal:of-reputat", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 1." => sub { my $type = mk_type('Name', {'length' => '1'}); should_pass("x", $type, 0); should_pass("_", $type, 0); should_pass("e", $type, 0); should_pass("q", $type, 0); should_pass(":", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 8." => sub { my $type = mk_type('Name', {'length' => '8'}); should_pass("ssyntax:", $type, 0); should_pass("jto_of.f", $type, 0); should_pass("hcompone", $type, 0); should_pass("jenforce", $type, 0); should_pass("_tools-s", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 60." => sub { my $type = mk_type('Name', {'length' => '60'}); should_pass("yallow.results_of.for_the_is:involved:of:be.daily.led-an.ref", $type, 0); should_pass("iwill-computing.other.software.ambiguities-heterogeneous-bus", $type, 0); should_pass("_its:resource-fact-new-tools.communication:availability.a:da", $type, 0); should_pass("gincluding_other:manipulate_be_users.signature:no.enforcemen", $type, 0); should_pass("kportable_and.related-appropriate_user-including.pervasive:f", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 6." => sub { my $type = mk_type('Name', {'length' => '6'}); should_pass("iis_us", $type, 0); should_pass("ilink:", $type, 0); should_pass("iof-ro", $type, 0); should_pass(":measu", $type, 0); should_pass("fsubje", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 64." => sub { my $type = mk_type('Name', {'length' => '64'}); should_pass("sinformation-to_is_industry_engineering_object-models-voiced-and", $type, 0); should_pass("kis.the-with_a.competence:used-collaborate_technologies-informat", $type, 0); should_pass("dmanipulation.on-data_made-supply.will-a:to:implementations-tool", $type, 0); should_pass(":define_performance.the:conformance-management_developing_from_g", $type, 0); should_pass("oway:a-into-system:we-support:interoperability.led.with_the:the_", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{45}." => sub { my $type = mk_type('Name', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){45}$)/}); should_pass("finteroperability-these_files-print:a_into_or:", $type, 0); should_pass("icomputing_will:includes:capabilities:need:to:", $type, 0); should_pass("yrecognition.will:security_automating_library_", $type, 0); should_pass("wfor-and_obvious_rich_technologies:ensure:indu", $type, 0); should_pass("athe.appropriate.landscape-browsers-and.donate", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{52}." => sub { my $type = mk_type('Name', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){52}$)/}); should_pass("ldesktop_object.needs_some:in:collaborating.of-be:app", $type, 0); should_pass("rsignatures:the_are:degree_over_is:tests_technologies", $type, 0); should_pass("uthe:profile-documents-of-we:and_recent_the_own-using", $type, 0); should_pass(":provide.systems.for.specifications.partnerships-of:t", $type, 0); should_pass("himpact:filter.computer.for_than.the.must_success.cor", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{32}." => sub { my $type = mk_type('Name', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){32}$)/}); should_pass(":a-a.and_s-for-used_means-high_we", $type, 0); should_pass("_the.the-a:raised-to-review-to-hi", $type, 0); should_pass("gleadership_interacting_test.avai", $type, 0); should_pass("ywith_and.emerging.computer_to_be", $type, 0); should_pass("isoftware_graphical-the_areas.tim", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{14}." => sub { my $type = mk_type('Name', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){14}$)/}); should_pass("fof-for-pervasi", $type, 0); should_pass(":necessary_auto", $type, 0); should_pass("tdata_also_seri", $type, 0); should_pass("irelated-ensure", $type, 0); should_pass("_to.help.approp", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet pattern with value \\i\\c{31}." => sub { my $type = mk_type('Name', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar)(?:$XML::RegExp::NameChar){31}$)/}); should_pass("lscreen-contribute:2001.reposito", $type, 0); should_pass("mmore-s:software:and:each_a:to-f", $type, 0); should_pass("dcan_graphical-for.the.daily.all", $type, 0); should_pass("_computer_these:through-build_da", $type, 0); should_pass("fof.effectively_areas-the:templa", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet enumeration." => sub { my $type = mk_type('Name', {'enumeration' => ['_particular:as_participants:standardization.dat','lsoftware-quality_and:interoperability:in-commerce-test:will:.g','rthe:enabling-set_from:d','tprimary-need:the:documents_maintai',':processes_and.both.fi','ais_profiles:academia:for-be',':and-a:including_as.the-coupled.in.complex:this-at:and.a_i','oand.leadership_the.as-manufacturers_th']}); should_pass("lsoftware-quality_and:interoperability:in-commerce-test:will:.g", $type, 0); should_pass("tprimary-need:the:documents_maintai", $type, 0); should_pass("ais_profiles:academia:for-be", $type, 0); should_pass(":processes_and.both.fi", $type, 0); should_pass(":processes_and.both.fi", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet enumeration." => sub { my $type = mk_type('Name', {'enumeration' => ['uof.retrieve:the_provided_specific_in_systems-on-a-chi','pis_known:over.allow.','_discovery:designed_graphics_perv','jregistry.interoperability_hampered-o','_great-desk','ra-the-partners-that-pervasive.by_challenges:discover','pnext:creat','yr']}); should_pass("ra-the-partners-that-pervasive.by_challenges:discover", $type, 0); should_pass("yr", $type, 0); should_pass("ra-the-partners-that-pervasive.by_challenges:discover", $type, 0); should_pass("_discovery:designed_graphics_perv", $type, 0); should_pass("uof.retrieve:the_provided_specific_in_systems-on-a-chi", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet enumeration." => sub { my $type = mk_type('Name', {'enumeration' => ['uprocessors:for.publishing:methods.for:an-with:included:impleme','_and-dat','ibusiness_processes-language-chain',':specificatio',':medium-sized-testing-to:users:and-registries_su','_to_the:has_to:launchi','gprovide-back.the-are:and_shift.and-creation:is-']}); should_pass("_and-dat", $type, 0); should_pass(":specificatio", $type, 0); should_pass("ibusiness_processes-language-chain", $type, 0); should_pass(":specificatio", $type, 0); should_pass("_to_the:has_to:launchi", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet enumeration." => sub { my $type = mk_type('Name', {'enumeration' => ['sprovided:i','prigorous.must.than.s','jgeneration-deployed-consistency_vo','rservices:and:electronic_th','jfor.enabling-around-eliminated-to.for-business-oriented_i','ocan:has_of:to.unambi','mis:and.to:high-use:conference']}); should_pass("prigorous.must.than.s", $type, 0); should_pass("rservices:and:electronic_th", $type, 0); should_pass("ocan:has_of:to.unambi", $type, 0); should_pass("jfor.enabling-around-eliminated-to.for-business-oriented_i", $type, 0); should_pass("prigorous.must.than.s", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet enumeration." => sub { my $type = mk_type('Name', {'enumeration' => [':to.environments-define.it.issues.t',':fi','rand_to.and-the.c','_these-known.quality.application_available.the.','papplication_the-object.object_computing_can','dand_applica']}); should_pass("papplication_the-object.object_computing_can", $type, 0); should_pass(":to.environments-define.it.issues.t", $type, 0); should_pass("_these-known.quality.application_available.the.", $type, 0); should_pass("rand_to.and-the.c", $type, 0); should_pass("dand_applica", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Name', {'whiteSpace' => 'collapse'}); should_pass("tstandardization.a.retrie", $type, 0); should_pass("gfact:foster:own.and.inte", $type, 0); should_pass("pfact_testing.the_from:or", $type, 0); should_pass("_files-to:by_to_providing", $type, 0); should_pass(":body_signatures-testing_", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 8." => sub { my $type = mk_type('Name', {'minLength' => '8'}); should_fail("n", $type, 0); should_fail("db", $type, 0); should_fail("dfo", $type, 0); should_fail("yind", $type, 0); should_fail("glead", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 13." => sub { my $type = mk_type('Name', {'minLength' => '13'}); should_fail("f", $type, 0); should_fail("vto", $type, 0); should_fail(":do-t", $type, 0); should_fail("mas:eme", $type, 0); should_fail("rand:is-r", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 58." => sub { my $type = mk_type('Name', {'minLength' => '58'}); should_fail("i", $type, 0); should_fail("xcomputing.the-", $type, 0); should_fail(":that:will:a:between_precise:", $type, 0); should_fail("vfurther_work-adoption.is.web_significant:a", $type, 0); should_fail("dtest.choices_the:unbiased:software-are-standards:from-in", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 4." => sub { my $type = mk_type('Name', {'minLength' => '4'}); should_fail("y", $type, 0); should_fail("r", $type, 0); should_fail("r", $type, 0); should_fail("p", $type, 0); should_fail("r", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet minLength with value 64." => sub { my $type = mk_type('Name', {'minLength' => '64'}); should_fail("j", $type, 0); should_fail("cchoices_of.adop", $type, 0); should_fail("letc-include_target-base.meet-r", $type, 0); should_fail("ifor_displaying:environments:developers:e-test", $type, 0); should_fail("qto.interoperability_the:the_with.analysis.ad-are.capabilitie", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 1." => sub { my $type = mk_type('Name', {'maxLength' => '1'}); should_fail("ri", $type, 0); should_fail("hof_project-a_pro", $type, 0); should_fail("_as:cost_web:chairs.asked_is_is_", $type, 0); should_fail(":computing-hardware-older-is-computing_intercon", $type, 0); should_fail("lpopular-define-organizations.a.neutral.the.registry:these-bac", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 31." => sub { my $type = mk_type('Name', {'maxLength' => '31'}); should_fail("ebusiness-file-life:allow:to_voc", $type, 0); should_fail("yand_tools.program-measure_discover_incl", $type, 0); should_fail("edocuments_networking.the.revisions_back-revolut", $type, 0); should_fail("jan-for-testing:for.robust_for:e:wide_technologies.about", $type, 0); should_fail("qa-registries.for.provides_to:lack.and-and.interoperability:retr", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 39." => sub { my $type = mk_type('Name', {'maxLength' => '39'}); should_fail("_and.used:of:to.will-effort.provide_is:m", $type, 0); should_fail(":this:applications-targeted_files_any-all_from", $type, 0); should_fail("_development:s:and_for:must_specifications-and:and.p", $type, 0); should_fail("jcomputing-a-files.supply:such.build_work-resources_to-sta", $type, 0); should_fail("_as.that:community-can_their.from:clean.small-.retrieve-reproduc", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 53." => sub { my $type = mk_type('Name', {'maxLength' => '53'}); should_fail("ffilter_file.provided-the.in.technologies_for:security", $type, 0); should_fail("_000_a:further-more:information-chair:be_standardization", $type, 0); should_fail("aunder-use-information.for.the:to.high_to.of.means.to_will", $type, 0); should_fail("_test:will_organizations-these.for:database-software-used_ch", $type, 0); should_fail("dapplications:being_is-to_techniques:neutral_to.language.diagn", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet maxLength with value 64." => sub { my $type = mk_type('Name', {'maxLength' => '64'}); should_fail("xpervasive_of-related.and:reference_clean:to_environments.informa", $type, 0); should_fail("jusing.individual.utilities.logic_by:government:a:to-the-that.digital:software_i", $type, 0); should_fail("teach.those_investigation_technologies.directions_other:in:to:the:industry-filter.voice-enabled", $type, 0); should_fail("fcomputing:neutral:a-a-tools:reference.a_between-for:supply.users_for.performance_for.by:can-the_and:and-infor", $type, 0); should_fail("kdiscussions.intuitive_specification:to:commerce_standardization_and.object_of:will-impact:and_ensure-use:any-these_suites-de", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 1." => sub { my $type = mk_type('Name', {'length' => '1'}); should_fail("ip", $type, 0); should_fail("nraised_partnersh", $type, 0); should_fail("_measurements.s_build:these-and.", $type, 0); should_fail("msense:variety_testing.the.and:access_areas-to-", $type, 0); should_fail("ptheir-tools.for-the:business_of:that-being:partners:manipulat", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 38." => sub { my $type = mk_type('Name', {'length' => '38'}); should_fail("_", $type, 0); should_fail("fto-and.is", $type, 0); should_fail("hand.the-will:creat", $type, 0); should_fail("qto.next_business-as:and-sys", $type, 0); should_fail("yover-and.reference-throughout.for_th", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 29." => sub { my $type = mk_type('Name', {'length' => '29'}); should_fail("tcost-location_rigorous:the_ra", $type, 0); should_fail("lchallenges:browsers.documents-impleme", $type, 0); should_fail("isuch.development-methods-must_be-correctness.", $type, 0); should_fail("puse:repositories_file:and:recommending.an:that-files.", $type, 0); should_fail("rmanage_objects-users:specification:consortium-the_define-all.", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 31." => sub { my $type = mk_type('Name', {'length' => '31'}); should_fail("gnew-achieved:images.systems-com", $type, 0); should_fail("lregistry.this.for_joint.developed.organ", $type, 0); should_fail("eincluded.in.many-localized_as-repository:discus", $type, 0); should_fail("tall_repository:file_must-development.to:some:between:5.", $type, 0); should_fail("yfiles_by:for.also_and-developed-widely-modeling-and-acting.thos", $type, 0); done_testing; }; subtest "Type atomic/Name is restricted by facet length with value 64." => sub { my $type = mk_type('Name', {'length' => '64'}); should_fail(":", $type, 0); should_fail("_networks-to_wil", $type, 0); should_fail("cbeing-specific:be.business_the", $type, 0); should_fail("oas:accessible:the-made.has.will-mediums:the-t", $type, 0); should_fail("na_of-led_in.the_be:by_original_from.tasks::these:annual:upon", $type, 0); done_testing; }; done_testing; 50QName.t000664001750001750 3317112404317273 13703 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/QName is restricted by facet maxLength with value 1." => sub { my $type = mk_type('QName', {'maxLength' => '1'}); should_pass("d", $type, 0); should_pass("xthe:aand-be.qua", $type, 0); should_pass("_to:fby-execution_with_where_di", $type, 0); should_pass("ftestability.focusing-issues.measure-world_the", $type, 0); should_pass("amust.launching_the.and:greference-are_cooperation_contributo", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet maxLength with value 4." => sub { my $type = mk_type('QName', {'maxLength' => '4'}); should_pass("r", $type, 0); should_pass("f:fprofile.where", $type, 0); should_pass("dof_business.fact.many_specific", $type, 0); should_pass("sfed.and_standards.s:fsoftware-systems-related", $type, 0); should_pass("isoftware.related_per:_use-success-commerce.other-computing-s", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet maxLength with value 57." => sub { my $type = mk_type('QName', {'maxLength' => '57'}); should_pass("e", $type, 0); should_pass("uaddressing.make", $type, 0); should_pass("bwide.back_for.via_medium-sized", $type, 0); should_pass("eand_and-prod:ocomputers_as.by_that_that.these", $type, 0); should_pass("da_with.via.sense_and.development-by_this-and-specifications-", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet maxLength with value 61." => sub { my $type = mk_type('QName', {'maxLength' => '61'}); should_pass("_", $type, 0); should_pass("esoftware-files.", $type, 0); should_pass("ffor-the-as.the-provide.that.fo", $type, 0); should_pass("mfiles.if.and-specifications_as-compliant.supp", $type, 0); should_pass("_interoperability_recent.suites-embedded_retrieves_that.perva", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet maxLength with value 64." => sub { my $type = mk_type('QName', {'maxLength' => '64'}); should_pass("_", $type, 0); should_pass("sestablish_will.", $type, 0); should_pass("rmany-wil:kto.first_with-implem", $type, 0); should_pass("_be-are-systems_requires.of.is.software.data-w", $type, 0); should_pass("sand_and:gspecifications.be-and.of_wireless_accelerate-and.wh", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet minLength with value 1." => sub { my $type = mk_type('QName', {'minLength' => '1'}); should_pass("r", $type, 0); should_pass("ecom:_partners.f", $type, 0); should_pass("ebe:mto-blocks.widespread-choic", $type, 0); should_pass("_or_techn:mas-of.wireless.is_of_as_and-to.busi", $type, 0); should_pass("xin-and.availa:his-provided_better-be.particularly-to-able-an", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet minLength with value 8." => sub { my $type = mk_type('QName', {'minLength' => '8'}); should_pass("t", $type, 0); should_pass("rfor.related_on_", $type, 0); should_pass("xjoint_f:pand_for.web.repositor", $type, 0); should_pass("mquality.for-the_the.significant.versions_and-", $type, 0); should_pass("vdiagnost:atools_versions_for_support-for-be.if.first-generat", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet minLength with value 50." => sub { my $type = mk_type('QName', {'minLength' => '50'}); should_pass("j", $type, 0); should_pass("ksi:bwith_techno", $type, 0); should_pass("eintuit:ptesting.is.mechanism.a", $type, 0); should_pass("tsoftw:cprimary.from.contained.the.is_for_serv", $type, 0); should_pass("ruser.pervasive_typ:qbuild-tool_these-both_advent-and.to.as.c", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet minLength with value 18." => sub { my $type = mk_type('QName', {'minLength' => '18'}); should_pass("a", $type, 0); should_pass("_both.a:ythem_wo", $type, 0); should_pass("_has_is.file_u:was_key.file-fil", $type, 0); should_pass("his_support.for.retrieve.service_a.for-filter-", $type, 0); should_pass("oaspects_the_the_applications.and.and.computer.problems_indus", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet minLength with value 64." => sub { my $type = mk_type('QName', {'minLength' => '64'}); should_pass("d", $type, 0); should_pass("gprovides.cost-e", $type, 0); should_pass("urepository-that_file_and.many.", $type, 0); should_pass("fand.fed-to_is_fac:gand.will.as-the_enough_and", $type, 0); should_pass("yexecution.those.context-rich:_through_and_that-cross-referen", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet length with value 1." => sub { my $type = mk_type('QName', {'length' => '1'}); should_pass("_", $type, 0); should_pass("_outfit:_this_st", $type, 0); should_pass("dw:fand_the-tools_heterogeneous", $type, 0); should_pass("vfor.the.define_portable_disseminate_allow.dat", $type, 0); should_pass("brecent-one-adoption-:lmore.include_allow_available_files_man", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet length with value 7." => sub { my $type = mk_type('QName', {'length' => '7'}); should_pass("a", $type, 0); should_pass("qasked_fact_tech", $type, 0); should_pass("lof_:binteracting.and_of.build.", $type, 0); should_pass("x:frich-and-revolution.particularly-support_in", $type, 0); should_pass("_of_we-and_adoption_these_used-unbiased_documents.will-versio", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet length with value 33." => sub { my $type = mk_type('QName', {'length' => '33'}); should_pass("e", $type, 0); should_pass("mretrieve-simple", $type, 0); should_pass("_met:ka.partnerships_reference-", $type, 0); should_pass("rits_test.of_tests-standard.different-registry", $type, 0); should_pass("sa.e_by.l:etests_criteria-of.networks-recognition-bandwidth_s", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet length with value 34." => sub { my $type = mk_type('QName', {'length' => '34'}); should_pass("t", $type, 0); should_pass("win_ava:sdevices", $type, 0); should_pass("o:rfurther-and-and-around_the-w", $type, 0); should_pass("kincluding_define_implementation_structured_hi", $type, 0); should_pass("sin.associated-pico-cellular_:mchallenges_the-been-data-with.", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet length with value 64." => sub { my $type = mk_type('QName', {'length' => '64'}); should_pass("h", $type, 0); should_pass("_w:lscreen-into_", $type, 0); should_pass("oled-digital-with-related-as-ch", $type, 0); should_pass("_project_will.technolo:keliminate_documents.co", $type, 0); should_pass("wbase.service.well.soft:_standards_enabling_measurement-a.for", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{40}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('QName', {}); should_pass("mas_the.and-significant.find-way.environm", $type, 0); should_pass("swork_must_and.partners-and:jmanage_and-of_partnerships.industry-prof", $type, 0); should_pass("ithe.by.and.tools.software-adoption-in-wi", $type, 0); should_pass("vnext-visibl:_with_bottlenecks_software.testability-in", $type, 0); should_pass("hare-and-to.which-of_stand:nbuild_one_help-having.to_objects.systems", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{20}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('QName', {}); should_pass("ithat.and_for_the.in_", $type, 0); should_pass("rwith_s.vir:ddevices.ensure.to_to", $type, 0); should_pass("uknow_provide.must_in", $type, 0); should_pass("qmanipul:vtestable-in.software", $type, 0); should_pass("_and-organization.to.its:qprovided-interoperab", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{33}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('QName', {}); should_pass("_buil:hby_to-of.to-computing_significant", $type, 0); should_pass("boffer_draft.obtained-to_systems-g", $type, 0); should_pass("_registry-both-understandi:opopular-processors.is-new_establi", $type, 0); should_pass("_chair_known-same.necessary.open_a", $type, 0); should_pass("ne:oenable-rapidly_pico-cellular.data", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{27}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('QName', {}); should_pass("_known.embed:fdiscover.to.transactional-w", $type, 0); should_pass("qg_o:oboth.to.location-that.of.sy", $type, 0); should_pass("luser-and-that.business_inte", $type, 0); should_pass("pvertical_on_industry-and-an", $type, 0); should_pass("_will_new.embedded-a_con:uand.and.well_efforts_busine", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet pattern with value ([\\i-[:]][\\c-[:]]*:)?[\\i-[:]][\\c-[:]]{58}." => sub { local $TODO = "XML Schema regexp not easily translated to Perl"; my $type = mk_type('QName', {}); should_pass("pare.to-debug-discover.hardware-information-is_frameworks_i", $type, 0); should_pass("sall_ability.emerging-lacking_a.to-registry.are_retrieval_p", $type, 0); should_pass("_original:efirst_intelligent_industries_who.repository-as.the_to.defi", $type, 0); should_pass("yare-collaborate-specifications_measurement-the_their.which", $type, 0); should_pass("wregistries_and.organizations:pembedded-among_g_can.discovery_eliminated.and-language-dis", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet enumeration." => sub { my $type = mk_type('QName', {'enumeration' => ['_:cengine','_for.be_provide_relat','rinfluence-create_information_reviewed_as.re','_those-to_business_and.issues-data.for','wspecifications.emerging.that_and.is_','_also.to_t:pvocabularies_any-promi']}); should_pass("_for.be_provide_relat", $type, 0); should_pass("_those-to_business_and.issues-data.for", $type, 0); should_pass("wspecifications.emerging.that_and.is_", $type, 0); should_pass("_for.be_provide_relat", $type, 0); should_pass("_:cengine", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet enumeration." => sub { my $type = mk_type('QName', {'enumeration' => ['_also.to_t:pvocabularies_any-promi','dpervasive:ndevelopment_be','awith.and-as.and-by-world.t:cinformation-information.langua','ncreate','c:xsolutions.filter_reviewed-led-allow_by_industry_pr','_a:vreach-s','kdomains-as.automatic-academia_work-ensure_tes']}); should_pass("awith.and-as.and-by-world.t:cinformation-information.langua", $type, 0); should_pass("dpervasive:ndevelopment_be", $type, 0); should_pass("awith.and-as.and-by-world.t:cinformation-information.langua", $type, 0); should_pass("_a:vreach-s", $type, 0); should_pass("ncreate", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet enumeration." => sub { my $type = mk_type('QName', {'enumeration' => ['kdomains-as.automatic-academia_work-ensure_tes','lfine-d:vcomputing.of-as_','_languages-and-transforming.technologies.is_impa','xstandard-file_use-ea','_lan:iand-must.effecti','ton.and_its.t','yinvolved.e-effor','q:tthe.with-']}); should_pass("ton.and_its.t", $type, 0); should_pass("_lan:iand-must.effecti", $type, 0); should_pass("xstandard-file_use-ea", $type, 0); should_pass("lfine-d:vcomputing.of-as_", $type, 0); should_pass("_languages-and-transforming.technologies.is_impa", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet enumeration." => sub { my $type = mk_type('QName', {'enumeration' => ['q:tthe.with-','etransforming-specific.emerging_is-developed.act_rela','yof_automatic-partnerships.and.set-series_is.key.e','fand_is_include.voca:jwork.tools-and.widely.electronic_manipul','tmany-retrieval-with_language.both-be.results-is-of-b','ito_d:lcomputing-object_for_a_must-be-from-design-ro','_interoperability.s.led_also-specifications_provide_with.is.thu','_the:lwhich_','uthe.base_the_ability-into-target_the_testability-discove']}); should_pass("yof_automatic-partnerships.and.set-series_is.key.e", $type, 0); should_pass("ito_d:lcomputing-object_for_a_must-be-from-design-ro", $type, 0); should_pass("fand_is_include.voca:jwork.tools-and.widely.electronic_manipul", $type, 0); should_pass("ito_d:lcomputing-object_for_a_must-be-from-design-ro", $type, 0); should_pass("etransforming-specific.emerging_is-developed.act_rela", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet enumeration." => sub { my $type = mk_type('QName', {'enumeration' => ['uthe.base_the_ability-into-target_the_testability-discove','_for-files.supply.for.to-must_measur','d:i','ps.pervasive.in-house_on.performance-als','_build.retrieves.cor:_among.to.must_and.industry-from-that_','hmanipulate-us']}); should_pass("d:i", $type, 0); should_pass("_for-files.supply.for.to-must_measur", $type, 0); should_pass("d:i", $type, 0); should_pass("_for-files.supply.for.to-must_measur", $type, 0); should_pass("d:i", $type, 0); done_testing; }; subtest "Type atomic/QName is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('QName', {'whiteSpace' => 'collapse'}); should_pass("mis.both_to.such-info", $type, 0); should_pass("fcertai:sfor.test_ver", $type, 0); should_pass("iinformation.testing.", $type, 0); should_pass("fto.foru:rin.process-", $type, 0); should_pass("_test_library_to.medi", $type, 0); done_testing; }; done_testing; 50anyURI.t000664001750001750 7270512404317273 14057 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/anyURI is restricted by facet maxLength with value 11." => sub { my $type = mk_type('AnyURI', {'maxLength' => '11'}); should_pass("ftp://p.org", $type, 0); should_pass("ftp://w.edu", $type, 0); should_pass("ftp://h.com", $type, 0); should_pass("ftp://y.edu", $type, 0); should_pass("ftp://w.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 40." => sub { my $type = mk_type('AnyURI', {'maxLength' => '40'}); should_pass("ftp://a.edu", $type, 0); should_pass("ftp://ftp.beca.net", $type, 0); should_pass("gopher://displayspeci.com", $type, 0); should_pass("http://www.usingvocabu.aries.gov", $type, 0); should_pass("gopher://LanguageSch.mashasforb.ilda.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 26." => sub { my $type = mk_type('AnyURI', {'maxLength' => '26'}); should_pass("ftp://u.gov", $type, 0); should_pass("mailto:p\@p.com", $type, 0); should_pass("gopher://more.gov", $type, 0); should_pass("ftp://ftp.suiter.gov", $type, 0); should_pass("ftp://ftp.tosoftwareVi.net", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 31." => sub { my $type = mk_type('AnyURI', {'maxLength' => '31'}); should_pass("ftp://c.gov", $type, 0); should_pass("http://topro.edu", $type, 0); should_pass("http://simplestwi.org", $type, 0); should_pass("http://www.softwaretoc.com", $type, 0); should_pass("http://www.mustafromtw.Inve.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 63." => sub { my $type = mk_type('AnyURI', {'maxLength' => '63'}); should_pass("ftp://i.edu", $type, 0); should_pass("ftp://ftp.andforbeco.gov", $type, 0); should_pass("gopher://information.implicityf.l.org", $type, 0); should_pass("ftp://ftp.interoperab.litytheisC.mmitteeoff.rp.org", $type, 0); should_pass("gopher://theofDOMvoc.bulariesre.ositoryAso.complexand.ilter.net", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 11." => sub { my $type = mk_type('AnyURI', {'minLength' => '11'}); should_pass("ftp://r.org", $type, 0); should_pass("gopher://andforSubco.edu", $type, 0); should_pass("gopher://transformin.datasbuilt.d.gov", $type, 0); should_pass("gopher://inregistryp.ofilesapro.essorscand.vel.edu", $type, 0); should_pass("http://www.andatforens.csUsingapp.icationsty.eadoptiona.dme.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 41." => sub { my $type = mk_type('AnyURI', {'minLength' => '41'}); should_pass("ftp://ftp.earlythespe.ifications.bjec.edu", $type, 0); should_pass("ftp://ftp.ECrelatedvi.tuallySuch.tErrorsne.net", $type, 0); should_pass("mailto:w\@transactionsfedensureknowndesignreposi.edu", $type, 0); should_pass("news://governmentc.meebXMLpro.essTheMark.pdynamicXML.net", $type, 0); should_pass("http://www.technologie.aforandbyO.ePCreposit.rytopartne.shi.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 36." => sub { my $type = mk_type('AnyURI', {'minLength' => '36'}); should_pass("mailto:filef\@andAofimplementatio.org", $type, 0); should_pass("http://www.development.uildandbas.data.org", $type, 0); should_pass("gopher://alanguagePr.jecttodocu.entsmanual.h.gov", $type, 0); should_pass("ftp://testatoolcr.ationinspe.ificationt.stingembed.edu", $type, 0); should_pass("http://www.scriteriath.XMLchainto.pplication.mprovedtes.toa.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 50." => sub { my $type = mk_type('AnyURI', {'minLength' => '50'}); should_pass("gopher://businessInd.gitalapart.ersindustr.and.gov", $type, 0); should_pass("telnet://formustalld.tadefineso.particular.ndaSim.org", $type, 0); should_pass("ftp://ftp.implementat.onstoservi.esandconsi.tencysui.edu", $type, 0); should_pass("http://www.andcompatib.lityXMLthr.ughfilethe.SLarethero.edu", $type, 0); should_pass("telnet://theofamongt.eTheisissu.swirelessO.SISforneed.ddisc.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 63." => sub { my $type = mk_type('AnyURI', {'minLength' => '63'}); should_pass("http://www.oftheunbias.dInternetn.wdynamicpa.tnersissar.tec.org", $type, 0); should_pass("gopher://criteriaTou.estechnolo.ycorrectne.sandforbui.dInte.gov", $type, 0); should_pass("mailto:isberesultbeingofuseapp\@canandeffortshelpinrelatedma.gov", $type, 0); should_pass("ftp://toreviewedh.sprovideda.heobtained.tructuredw.relesstw.net", $type, 0); should_pass("gopher://XMLisbuilds.rintXMLsig.ificanteli.inatetoXML.easur.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 11." => sub { my $type = mk_type('AnyURI', {'length' => '11'}); should_pass("ftp://o.gov", $type, 0); should_pass("ftp://a.edu", $type, 0); should_pass("ftp://e.gov", $type, 0); should_pass("ftp://v.edu", $type, 0); should_pass("ftp://n.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 11." => sub { my $type = mk_type('AnyURI', {'length' => '11'}); should_pass("ftp://f.org", $type, 0); should_pass("ftp://b.edu", $type, 0); should_pass("ftp://p.org", $type, 0); should_pass("ftp://x.gov", $type, 0); should_pass("ftp://d.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 34." => sub { my $type = mk_type('AnyURI', {'length' => '34'}); should_pass("http://www.OASISofinin.ormatio.net", $type, 0); should_pass("http://www.MarkupXMLso.twareen.edu", $type, 0); should_pass("ftp://discoverbui.dObjectXML.n.org", $type, 0); should_pass("telnet://befileXMLus.technolog.edu", $type, 0); should_pass("telnet://toolsandwit.reference.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 12." => sub { my $type = mk_type('AnyURI', {'length' => '12'}); should_pass("http://t.gov", $type, 0); should_pass("http://t.gov", $type, 0); should_pass("http://d.edu", $type, 0); should_pass("news://a.org", $type, 0); should_pass("news://d.net", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 63." => sub { my $type = mk_type('AnyURI', {'length' => '63'}); should_pass("ftp://partnership.registrysu.portcontai.ingaobject.roupsmak.org", $type, 0); should_pass("http://information.ndcanXMLTh.choicesath.sechairsis.illonto.net", $type, 0); should_pass("http://www.filedatabet.eofarecomp.tibilityTh.ebXMLStand.rds.gov", $type, 0); should_pass("ftp://ofprovidesc.mpatibilit.vocabulary.bjectSchem.sinorgan.com", $type, 0); should_pass("ftp://ftp.constituent.roupsobjec.iveNSRLcri.eriacanisO.ethe.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,7}\\.){1,2}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,7}\.){1,2}(?:$XML::RegExp::NameChar){3}$)/}); should_pass("gopher://Sty.reques.org", $type, 0); should_pass("telnet://wirel.oldert.org", $type, 0); should_pass("telnet://beth.edu", $type, 0); should_pass("gopher://fort.ham.org", $type, 0); should_pass("news://mode.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,3}\\.){1,4}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,3}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/}); should_pass("telnet://mo.X.th.com", $type, 0); should_pass("news://thu.o.pro.wid.com", $type, 0); should_pass("ftp://b.Co.and.net", $type, 0); should_pass("telnet://s.an.to.org", $type, 0); should_pass("telnet://Th.int.e.r.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,7}\\.){1,4}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,7}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/}); should_pass("ftp://XSLthat.incons.isdispl.softwa.org", $type, 0); should_pass("ftp://too.edu", $type, 0); should_pass("ftp://indust.Aso.dra.gov", $type, 0); should_pass("news://r.di.gov", $type, 0); should_pass("news://busin.pa.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,6}\\.){1,2}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,6}\.){1,2}(?:$XML::RegExp::NameChar){3}$)/}); should_pass("ftp://techn.using.gov", $type, 0); should_pass("ftp://the.com", $type, 0); should_pass("telnet://these.s.org", $type, 0); should_pass("gopher://area.gov", $type, 0); should_pass("news://ap.refe.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,10}\\.){1,5}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,10}\.){1,5}(?:$XML::RegExp::NameChar){3}$)/}); should_pass("telnet://and.the.thattesti.andspeci.im.gov", $type, 0); should_pass("ftp://beingamon.I.net", $type, 0); should_pass("gopher://whoservi.theXSL.fact.ma.net", $type, 0); should_pass("ftp://furtherre.th.i.forconso.gov", $type, 0); should_pass("telnet://allowtec.recognitio.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['http://Theiste.com','mailto:@prov.org','ftp://h.com','mailto:devic@manipulationandabilityspecifica.gov','http://www.systemswebi.teroperabi.itybeandof.hic.edu','gopher://Conformance.up.com','telnet://f.org','http://www.asseries.gov','telnet://wit.edu','ftp://ftp.atheconstit.entOASISre.rie.net']}); should_pass("telnet://f.org", $type, 0); should_pass("mailto:devic\@manipulationandabilityspecifica.gov", $type, 0); should_pass("gopher://Conformance.up.com", $type, 0); should_pass("gopher://Conformance.up.com", $type, 0); should_pass("http://www.systemswebi.teroperabi.itybeandof.hic.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['ftp://ftp.relatedtool.aandofinve.ticalofeff.rthaveEC.edu','news://th.gov','http://www.withouttheR.commendati.nsmeasureme.gov','mailto:methodsIttech@librarieswithbet.net','ftp://forInvestig.org','http://www.signaturesr.acht.org']}); should_pass("http://www.signaturesr.acht.org", $type, 0); should_pass("ftp://forInvestig.org", $type, 0); should_pass("ftp://forInvestig.org", $type, 0); should_pass("http://www.withouttheR.commendati.nsmeasureme.gov", $type, 0); should_pass("news://th.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['http://www.APIsinCompu.ingte.com','telnet://academi.org','gopher://thatoverJav.throught.com','http://www.ensureaddre.sasspecifi.ationsimag.sandst.org','ftp://ftp.prot.edu','ftp://ftp.computingHT.Lheterogen.ousretriev.vendorsbe.edu','ftp://newdevelopm.ntcomplexa.ongadvance.Consequent.yallow.org']}); should_pass("http://www.ensureaddre.sasspecifi.ationsimag.sandst.org", $type, 0); should_pass("ftp://ftp.computingHT.Lheterogen.ousretriev.vendorsbe.edu", $type, 0); should_pass("http://www.ensureaddre.sasspecifi.ationsimag.sandst.org", $type, 0); should_pass("ftp://ftp.computingHT.Lheterogen.ousretriev.vendorsbe.edu", $type, 0); should_pass("ftp://ftp.prot.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['gopher://thesedefine.escribesof.hoseindustr.edu','news://ableresultp.ovidedfo.org','telnet://correctiono.forinforma.ionbuildca.abilities.com','ftp://bysyntaxinf.rmationret.ieva.org','gopher://Groupsrela.gov','ftp://ftp.issuesquali.yensureand.histestscr.ationforc.com','news://XMLAofMarku.oninofstan.ardslackre.rieveDe.gov']}); should_pass("news://ableresultp.ovidedfo.org", $type, 0); should_pass("gopher://thesedefine.escribesof.hoseindustr.edu", $type, 0); should_pass("news://ableresultp.ovidedfo.org", $type, 0); should_pass("ftp://ftp.issuesquali.yensureand.histestscr.ationforc.com", $type, 0); should_pass("telnet://correctiono.forinforma.ionbuildca.abilities.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['mailto:ofdiscoveryst@GroupsAtoofofwhichiscrea.gov','gopher://programacce.sbynewtheI.ternetinfo.mationinte.org','mailto:computingexecutiontoac@industryprovidesandinandPer.gov','mailto:matchcreat@electronicbeenyearsdocumentsInve.gov','ftp://ftp.areandaComm.tteetransa.tthembusin.ssisfilt.edu','http://worldonenab.ingthrough.utcanprint.efi.net']}); should_pass("gopher://programacce.sbynewtheI.ternetinfo.mationinte.org", $type, 0); should_pass("ftp://ftp.areandaComm.tteetransa.tthembusin.ssisfilt.edu", $type, 0); should_pass("ftp://ftp.areandaComm.tteetransa.tthembusin.ssisfilt.edu", $type, 0); should_pass("ftp://ftp.areandaComm.tteetransa.tthembusin.ssisfilt.edu", $type, 0); should_pass("ftp://ftp.areandaComm.tteetransa.tthembusin.ssisfilt.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('AnyURI', {'whiteSpace' => 'collapse'}); should_pass("mailto:Ch\@futureinterconnectedbusinesspartnerscommunityof.org", $type, 0); should_pass("telnet://adventdatab.seensureis.awcreateor.anizations.elp.org", $type, 0); should_pass("ftp://ftp.transactcon.ributerigo.oustoproto.ypesConfor.an.org", $type, 0); should_pass("ftp://ftp.ofknownOrga.izationint.olsfiveinc.udeinforma.io.org", $type, 0); should_pass("mailto:industr\@providethethisobjectsadNISTforeachcomputer.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 25." => sub { my $type = mk_type('AnyURI', {'minLength' => '25'}); should_fail("ftp://b.org", $type, 0); should_fail("gopher://i.com", $type, 0); should_fail("http://ensure.com", $type, 0); should_fail("gopher://forthea.org", $type, 0); should_fail("http://investigati.n.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 32." => sub { my $type = mk_type('AnyURI', {'minLength' => '32'}); should_fail("ftp://q.edu", $type, 0); should_fail("gopher://ton.gov", $type, 0); should_fail("http://ascommerce.gov", $type, 0); should_fail("telnet://oneasTheand.e.com", $type, 0); should_fail("http://www.pervasiveen.urei.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 48." => sub { my $type = mk_type('AnyURI', {'minLength' => '48'}); should_fail("ftp://f.gov", $type, 0); should_fail("ftp://transmitin.org", $type, 0); should_fail("gopher://canbuiltbui.dtha.com", $type, 0); should_fail("http://Standardsan.toprocessp.rtne.org", $type, 0); should_fail("mailto:ofjoint\@goodthenusingbytheandsoftwar.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 47." => sub { my $type = mk_type('AnyURI', {'minLength' => '47'}); should_fail("ftp://g.org", $type, 0); should_fail("http://www.meth.com", $type, 0); should_fail("mailto:gl\@businessconso.org", $type, 0); should_fail("ftp://Businessani.Nationalto.ac.edu", $type, 0); should_fail("http://www.thisOASISUn.versityand.serewell.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet minLength with value 63." => sub { my $type = mk_type('AnyURI', {'minLength' => '63'}); should_fail("ftp://o.org", $type, 0); should_fail("telnet://aasthrough.edu", $type, 0); should_fail("news://oftheimeasu.ementsiswi.e.com", $type, 0); should_fail("ftp://exchangeuse.ofandtheot.ercorrecti.nsy.net", $type, 0); should_fail("mailto:naturereviewedrev\@anddiscoverchoicesotherimprovedla.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 11." => sub { my $type = mk_type('AnyURI', {'maxLength' => '11'}); should_fail("http://c.edu", $type, 0); should_fail("telnet://bedevelopme.gov", $type, 0); should_fail("news://aeachthetoa.dimproveda.re.org", $type, 0); should_fail("http://environment.accessofto.anguagetoa.dla.com", $type, 0); should_fail("mailto:\@cooperationthenandandisFurthermoreCPUdatainconstitu.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 60." => sub { my $type = mk_type('AnyURI', {'maxLength' => '60'}); should_fail("news://ofstructure.uiteandoft.theinterna.ionalrefer.nceeb.org", $type, 0); should_fail("news://usertoitsfi.dmeasurede.endability.ellareObje.tdefin.gov", $type, 0); should_fail("ftp://constituent.eadershipc.mputerSoft.areSoftwar.chairsus.net", $type, 0); should_fail("ftp://ftp.hasandebXML.rganizatio.sExtensibl.meetsVirtu.ll.gov", $type, 0); should_fail("ftp://ftp.manualOASIS.rganizatio.objectivec.eatesobjec.too.net", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 33." => sub { my $type = mk_type('AnyURI', {'maxLength' => '33'}); should_fail("ftp://ftp.facilitates.sedversi.org", $type, 0); should_fail("telnet://becomethene.workingthe.ffaci.gov", $type, 0); should_fail("http://www.implementat.oncomplian.ofsfileoff.org", $type, 0); should_fail("telnet://Architectur.lemergingm.morybusine.sinfrast.edu", $type, 0); should_fail("ftp://Individualr.gardobtain.dtoNISTiss.essoftware.ilesbetw.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 37." => sub { my $type = mk_type('AnyURI', {'maxLength' => '37'}); should_fail("telnet://firstDOMfed.theandperv.si.org", $type, 0); should_fail("mailto:templateslarge\@involveddevelopmen.gov", $type, 0); should_fail("http://rangeincorp.ratedPCres.urcelangua.esind.edu", $type, 0); should_fail("telnet://certainmatc.electronic.MLspecific.tionofdev.net", $type, 0); should_fail("ftp://heterogeneo.spervasive.sinteroper.bilityhelp.ngandand.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet maxLength with value 17." => sub { my $type = mk_type('AnyURI', {'maxLength' => '17'}); should_fail("http://www.lan.edu", $type, 0); should_fail("telnet://aresystemst.olsb.edu", $type, 0); should_fail("gopher://arebuildsec.ritythesei.assu.org", $type, 0); should_fail("news://inhardwared.velopmentI.formationl.nguage.com", $type, 0); should_fail("http://www.thatcompute.sLibraryto.aisedawill.oftwareser.ice.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 11." => sub { my $type = mk_type('AnyURI', {'length' => '11'}); should_fail("http://s.org", $type, 0); should_fail("ftp://ftp.inreferenc.edu", $type, 0); should_fail("telnet://draftpervas.veretrievep.gov", $type, 0); should_fail("ftp://anddiscussi.nsalsonetw.rksforelim.nate.edu", $type, 0); should_fail("gopher://libraryserv.cestoprofi.esAtobothS.ructuredre.osito.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 53." => sub { my $type = mk_type('AnyURI', {'length' => '53'}); should_fail("ftp://j.edu", $type, 0); should_fail("ftp://computerele.edu", $type, 0); should_fail("ftp://ftp.toolsrangeG.oupsc.gov", $type, 0); should_fail("news://Atotechnolo.iesreposit.ryeffor.gov", $type, 0); should_fail("http://andmediumso.enablingty.icalthatbl.cksThet.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 15." => sub { my $type = mk_type('AnyURI', {'length' => '15'}); should_fail("gopher://the.edu", $type, 0); should_fail("ftp://ftp.mechanismth.A.org", $type, 0); should_fail("telnet://themrevolut.onaccompli.he.org", $type, 0); should_fail("http://www.theseXMLoft.chniquesse.sorssoftwar.com", $type, 0); should_fail("http://andOrganiza.ionanddata.usinessofc.nformancei.methods.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 14." => sub { my $type = mk_type('AnyURI', {'length' => '14'}); should_fail("ftp://ftp.h.edu", $type, 0); should_fail("ftp://ftp.development.n.org", $type, 0); should_fail("ftp://ftp.eXtensibler.centofmana.eu.org", $type, 0); should_fail("mailto:all\@doreferenceandtechnologiessuccessunb.gov", $type, 0); should_fail("ftp://ftp.sinformatio.InAdatabas.implementa.ionsthatfi.espr.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet length with value 63." => sub { my $type = mk_type('AnyURI', {'length' => '63'}); should_fail("ftp://p.org", $type, 0); should_fail("ftp://ftp.Groupsand.org", $type, 0); should_fail("gopher://definesConf.rmanceTrad.org", $type, 0); should_fail("ftp://ftp.issuesantec.nicalwides.readwebthu.org", $type, 0); should_fail("mailto:toOASISandaredevelopme\@vocabulariestestingthesefrom.net", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,2}\\.){1,5}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,2}\.){1,5}(?:$XML::RegExp::NameChar){3}$)/}); should_fail("ftp://eachbewit.otherwilleXtens.follow.lawbeaande.XMLus.repositor.com", $type, 0); should_fail("http://build.theamongimag.becom.OASIScompu.thedue.XMLbusinessis.organizations.gov", $type, 0); should_fail("http://regist.stimu.waysmanyth.andprofil.exchang.knownagraphi.ECprovidedCom.otherSchemape.edu", $type, 0); should_fail("ftp://Theask.toolseto.theacceleratef.andtesttest.the.disseminateToin.ofAdistribu.edu", $type, 0); should_fail("news://libr.ssolvetoolsto.metrologypr.software.sup.beknow.theseabil.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,3}\\.){1,4}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,3}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/}); should_fail("ftp://toregist.thesecanther.NISTme.thefor.amongthosesuch.andtonetw.org", $type, 0); should_fail("gopher://aInternetthela.Virtuallyso.software.communi.widelyTo.usedtheover.andeachS.com", $type, 0); should_fail("ftp://andbothreposit.regis.revolutioniz.oncreatedt.resourcesI.usingandmakeNI.org", $type, 0); should_fail("telnet://interoperabilit.donatea.portable.ofandE.knownforaut.bothNa.comput.isITLProvid.edu", $type, 0); should_fail("gopher://successand.isconformanto.enterprisesm.andErrorswes.devel.andAd.someModelA.com", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,5}\\.){1,4}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,5}\.){1,4}(?:$XML::RegExp::NameChar){3}$)/}); should_fail("news://olderperfo.totempla.forlanguageth.thesethecreate.towidetotheb.abilitySchema.useofyears.edu", $type, 0); should_fail("telnet://filewithinD.thecomputera.byresidesitp.nointhemsi.arecreates.withtodocuments.accomplishsec.gov", $type, 0); should_fail("ftp://Businessdepe.thebenefitswo.SOCgovernment.referencech.deployedTh.aroledistrib.andXMLarepub.com", $type, 0); should_fail("gopher://vendor.buildfiles.theandparticip.browserssetTof.fororganiz.industry.edu", $type, 0); should_fail("telnet://anddisc.fromdesktopi.addition.onlypro.XMLasthet.versionss.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,10}\\.){1,3}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,10}\.){1,3}(?:$XML::RegExp::NameChar){3}$)/}); should_fail("telnet://aboutdevelopm.referenceofreg.mustthebuildLan.ofamongAtois.andtheandmust.certainOASI.theInternetaan.thethetheseus.com", $type, 0); should_fail("gopher://CPUtographics.ebXMLArchitec.furthertheofa.thecomplexadd.fourcorrection.ofrelatedvo.com", $type, 0); should_fail("ftp://scomputingth.certaintheof.issueselectroni.thetechnologie.partnersofthis.gov", $type, 0); should_fail("gopher://forandandpervas.testingthisde.andStandardscha.DelawareandviaS.repositoryaProv.Organizationsp.theSchemassig.willbothsof.com", $type, 0); should_fail("telnet://registryourde.includecanof.testableleade.discoveryobtai.thatreferen.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet pattern with value \\c{3,6}://(\\c{1,7}\\.){1,3}\\c{3}." => sub { my $type = mk_type('AnyURI', {'pattern' => qr/(?ms:^(?:$XML::RegExp::NameChar){3,6}:\/\/((?:$XML::RegExp::NameChar){1,7}\.){1,3}(?:$XML::RegExp::NameChar){3}$)/}); should_fail("gopher://mustNISTproc.aselectronican.systemsstan.andwireles.Informationa.definecanfo.completi.wouldofanat.gov", $type, 0); should_fail("telnet://aparadigmsta.XMLstake.dataaregr.repositori.signaturesNat.andprocessdocum.gov", $type, 0); should_fail("news://understandthe.including.whichamong.partnerships.andsupplytest.contribut.forofhel.net", $type, 0); should_fail("ftp://distributed.anofandbusin.typespecific.databaseinclu.thesetestbrow.creationwhereTh.theconsortiu.supplyasv.edu", $type, 0); should_fail("ftp://availableobj.theDevelopand.thatmostfori.fromAnsignif.allowswo.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['http://ultimateapp.icati.gov','ftp://themNavalIn.ormati.com','telnet://specificati.nsknowinto.n.org','telnet://prototypeso.automating.rogramwebd.taofdistri.utedn.edu','http://www.mechanismao.participat.ngchaineb.edu','http://www.unbiasedsuc.essavailab.eaccessDOM.hetheXML.org']}); should_fail("ftp://organizatio.sobjectneu.ralledtech.ol.gov", $type, 0); should_fail("http://systemsis.org", $type, 0); should_fail("ftp://ftp.theviaXMLme.rolo.edu", $type, 0); should_fail("http://www.i.com", $type, 0); should_fail("http://www.suchma.edu", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['telnet://OnlyOASISth.groupsInfor.com','news://compliantme.hods.org','ftp://backToolloc.tiondiscov.rprofilesi.fl.gov','gopher://Standardscr.atestheand.takeho.org','ftp://ftp.andpartners.mplementat.onscomp.gov']}); should_fail("ftp://preciseboth.ndicationa.dOASISthis.othethetoo.s.edu", $type, 0); should_fail("gopher://theFacilita.iondomains.pecificati.nsofprovide.gov", $type, 0); should_fail("mailto:partnershipsbe\@itsofsoftwarenaturethatorganiza.gov", $type, 0); should_fail("news://standardsth.stakeholde.sfr.org", $type, 0); should_fail("ftp://ensurewayst.etoisSoftw.readdres.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['ftp://ftp.Theledamong.fforandass.ci.net','mailto:maint@thosemanipulateAwithdai.edu','http://andthebeare.sofsoftwar.rev.edu','telnet://otherthedis.ussionsfor.mplementat.onchoicesa.nfor.org','gopher://andataiTheo.specif.gov','http://pa.gov','ftp://andforcontr.buteOASISD.velopavail.bilitytest.n.edu','ftp://filehightra.sactionsas.ociatedaco.pliantasel.ctronic.gov','telnet://forconforman.net']}); should_fail("telnet://DOMwiththeh.ssensorspro.gov", $type, 0); should_fail("ftp://ftp.specificati.nsthetarge.andn.gov", $type, 0); should_fail("telnet://fiveXSLalso.echnologie.TothetheXS.widewil.org", $type, 0); should_fail("ftp://DOMcontaini.ginobvious.ngofECst.gov", $type, 0); should_fail("http://www.collaborate.p.gov", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['ftp://specificati.nstoindust.ystandardi.ation.net','ftp://ftp.nextperform.ncemustANI.TCPUexerci.ela.com','mailto:areassimu@theminDOMeModelsignaturesspec.gov','http://forissuesmo.elstotocre.tesinengin.er.gov','telnet://setisspecif.cunb.edu','gopher://tochallen.org','http://www.theallowint.r.gov','http://t.edu','ftp://inallows.gov']}); should_fail("http://www.issuesbysta.dardssigni.icantSXMLS.yles.net", $type, 0); should_fail("ftp://havingclean.hehashasFu.thermorewo.kSME.edu", $type, 0); should_fail("ftp://repositorie.organizati.nsofDOMthe.OASIS.org", $type, 0); should_fail("http://willthebyBu.inessneede.incan.org", $type, 0); should_fail("http://www.forNSRLfilt.r.org", $type, 0); done_testing; }; subtest "Type atomic/anyURI is restricted by facet enumeration." => sub { my $type = mk_type('AnyURI', {'enumeration' => ['telnet://arereposito.yassociate.andAPIscon.orti.org','telnet://ofandtechno.ogiessens.org','telnet://specificMar.upfilerepo.itoryisfor.rovidecrea.ionT.gov','ftp://ftp.asthea.org','telnet://locationava.lablealack.gov','ftp://suiteutiliz.testab.edu','news://Co.net','gopher://aofOASIScre.tetemplate.comm.edu','http://testseameet.itssimu.edu']}); should_fail("ftp://ftp.technologyk.ownHTMLtoo.sArchitect.ralch.net", $type, 0); should_fail("mailto:prominentEXiSTrais\@implementationsofitwellandexecu.gov", $type, 0); should_fail("http://suchItebXML.ecurityand.fw.org", $type, 0); should_fail("telnet://largehighth.AXMLvocabul.org", $type, 0); should_fail("http://Stylesheetf.rOrganizati.com", $type, 0); done_testing; }; done_testing; 50base64Binary.t000664001750001750 4026512404317273 15135 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/base64Binary is restricted by facet maxLength with value 1." => sub { my $type = mk_type('Base64Binary', {'maxLength' => '1'}); should_pass("YQ==", $type, 0); should_pass("aA==", $type, 0); should_pass("Yw==", $type, 0); should_pass("aQ==", $type, 0); should_pass("ZA==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet maxLength with value 45." => sub { my $type = mk_type('Base64Binary', {'maxLength' => '45'}); should_pass("ZQ==", $type, 0); should_pass("bGNlbmdnamh4eXBy", $type, 0); should_pass("bnJyY2J0b3Zhb2pqaXdsd2tiam5kc3I=", $type, 0); should_pass("YWR2eHdicnVzdmx3YW1tdnV2c3drZHVlbHBjb29vbHR3ZA==", $type, 0); should_pass("ZmNhYWNvY3l5a3d0bGF5bmRidHVvY2lmcmt5ZGdxcmtxcXNnZHlsZG94bmJ2", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet maxLength with value 54." => sub { my $type = mk_type('Base64Binary', {'maxLength' => '54'}); should_pass("Yg==", $type, 0); should_pass("Y3V2bmFka3dxZHdiY2U=", $type, 0); should_pass("eXNidmxsbnF3Z3JiYWRodWF5aW9paHViZ2Vm", $type, 0); should_pass("ZHZtamxud2doaGNpZ3F0bGVxdXNlZGhucHh2anZtYmxia2Zwcm5sZg==", $type, 0); should_pass("cmp4c2NlYnRsc3d2d25ld2tld215eXNzdWVkdWp3ZGpwaWdsbWlhYnVxZ2l3Y2ZqZ2Nkb2o=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet maxLength with value 61." => sub { my $type = mk_type('Base64Binary', {'maxLength' => '61'}); should_pass("Yw==", $type, 0); should_pass("b3l1a3F5dWJpa3dkcmdoeQ==", $type, 0); should_pass("dGRweWRkY3ZoYnFuaGZ4ampsdHBibXFldGx1ZHd1cA==", $type, 0); should_pass("Ymp4cmVva2R4dmJ4am9wbWdyc255Zm1mcWZpZ3VxZXJ3eHZ4ZmdrdnVmZmJmYQ==", $type, 0); should_pass("cW93dWRoa2pub2FtaWNkdmNldWF3ZXNnYm9taXR2eG93eG5uYmJxanJudXZ3ZHFldmhiZ3NoYXRndWtxaw==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet maxLength with value 74." => sub { my $type = mk_type('Base64Binary', {'maxLength' => '74'}); should_pass("aQ==", $type, 0); should_pass("ZGFldHZrZGlsYm94Ymx4YXVwaQ==", $type, 0); should_pass("c3ViaGl3ZWFsZmdqaGJneXh3and4bnR3am9neGtkbGhrbnllaA==", $type, 0); should_pass("YmNnc3lqYmZvYnBscmhqamZraHZ5dndxZG90cnB1dXJuZWp0bnlzamx0ZWh5ZGxkcG1hY25hdg==", $type, 0); should_pass("aWN0YXJlam94am9yaWhybWhkaGFuY2Fza2FsaXFyZWhsa21qY2hnZWl0aWh0eGJvZGlyaWtmdXJicG14cmh5Z2x5eHF3Y2Focw==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet minLength with value 1." => sub { my $type = mk_type('Base64Binary', {'minLength' => '1'}); should_pass("aA==", $type, 0); should_pass("dHVzd2VtY3lidXZ0ZmhydXFzZg==", $type, 0); should_pass("YXN5b3JwbXJubGxraWFzYmZucGd2Y3NpbWxkbnhpaXBtd3ZveA==", $type, 0); should_pass("bWpjbGNxY2ZvamFicmxhamZic2NnbXF4c2JsZXdzdnRlZHh5d210anVobnl2Zm9wZWdka2hrYg==", $type, 0); should_pass("eWlmYWh3c29zZGJ1YWtldGh2cXBpcG1iZXZya2d5b2VtcGdmc3BjbGNvcG1tbHZqZHdtYmZ5Ymt1Z3N0eW9rdmllYXFxYnBuYw==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet minLength with value 27." => sub { my $type = mk_type('Base64Binary', {'minLength' => '27'}); should_pass("aGZkb2Jub2x1Y2p1YXhlbWRxb2Rwa3F5dmpw", $type, 0); should_pass("bXVqY3NwdG53aXh0eWp2ZGZzc3VxcGpramt2Y2JqeHBpbnNicHg=", $type, 0); should_pass("Y2JmdnR3ZHh1amFjZnV2Z2RpcmJvcWxhYXBlcGpsY2dia2JianVmaGdqcGlncWllaw==", $type, 0); should_pass("a3NtZ2pmdmVreHl4ZXJhaHR5eGpzaGJzcXBucWpob2VycnlybHZ3bWlmb295c2NibHNncGhjcmVkaGtx", $type, 0); should_pass("ZHlta3ljbW9pY25tdnNtYXZna2hmdXJzaWZwZ3RwbG1iZ3R3a3d4Y3Nwbmh4cnZzbGZneG5rZ2ZucHFlZGhmZ21sZWF0ZXk=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet minLength with value 14." => sub { my $type = mk_type('Base64Binary', {'minLength' => '14'}); should_pass("a2tjYnBrcXNod3Roc3A=", $type, 0); should_pass("amVxdGtzbW9jdHNpaWFkbXBwd2pycXBpamhndGQ=", $type, 0); should_pass("cHR1anZoZHBxaWZxcmJya3Rhb21zcWptZ25kZWh2amdkd2p2ZHJ1cWx0c2U=", $type, 0); should_pass("ZGNzamRveHZ5cXRsbXNva3NtamNid2hsc3dvbW9udm13Z3ljZHdhYXdxZGtlYWRmc2FqeXdlbmZjbmk=", $type, 0); should_pass("c3V5bnRocm5oc2pqZWhxdm5mZnNsd2pkaG1tbHhrbHdmd2N5c3Vuc2dsZ2NpYXJndGh4a2Fwc3JsaGhsc3NrZWxhYmp0ZWxleGo=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet minLength with value 11." => sub { my $type = mk_type('Base64Binary', {'minLength' => '11'}); should_pass("a3JubmtudXVvbmk=", $type, 0); should_pass("dm14dWN1YXFwZWljd3dtYnNudWJrZmFoaWw=", $type, 0); should_pass("cWVwc2djeHlranR3cmJ1b29ucWhwdHhpaGF0dnNnZ3ZtaW9veGZ5dmg=", $type, 0); should_pass("ZmtycHFnanh5cnh5d2hnb2Rtc3JleG1pcnZ1ZWVhZ3FtdHdnZWtwZW11dWF4aHhhZHVrd3l3Y3E=", $type, 0); should_pass("Y3hxdWljeGFwcXhoZ3JhaXNwdWlmdGtnZHlmbGlxanhibmFpeXZ1Y294dHJoZXdmbWZ3b2JudHVtd3V3aWFrYWN3ZnB4dmw=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet minLength with value 74." => sub { my $type = mk_type('Base64Binary', {'minLength' => '74'}); should_pass("dnBwcmh3dGFocGN5b25jeHJjYW9zaXJpbGdpc2xmY2dzZWRna25peXBqaW1iaHV0ZHhhZ2hmZ2NnY3lnYWVvbWdiYXZzZGZya3U=", $type, 0); should_pass("YWVnc2NnYnhkYnF0aHF2cHh1ZG5qdnBzcWhuZnlja210cHVoY21jdXRzZ2pxa2lybG9yY3Jhd2Nvb2NpbGV2bnV3ZmJud2xwYmg=", $type, 0); should_pass("dmJnd3Rwbmx1aGt2ZmhteWtrYmhrcWJxZXRwdnd4dmxibXNsZWJvZ3NscmhqeWZuY3Vic3N1b3Zqd21vcXh5eHVudm5keHF4aHA=", $type, 0); should_pass("YWJrbmlubGRyZ3d3ZHVrdnNmd2h0aGJ4cWNqeXBjbnBpZ3d5Z2tkcXRpZm9oZmR1aHlubXN3d2dmZXZlcHhrZm5meXFzd3B4aGg=", $type, 0); should_pass("aXBpb2RuaGF3aGtld3hrdHVyYmFmcHl3eGtqZ2VvcXdyaHhiaWtzd3lvd3hydmdjbHdrd3FncmZlZWtjZGVxYXdncGRjd3JheGk=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet length with value 1." => sub { my $type = mk_type('Base64Binary', {'length' => '1'}); should_pass("Yw==", $type, 0); should_pass("eQ==", $type, 0); should_pass("cw==", $type, 0); should_pass("aQ==", $type, 0); should_pass("dQ==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet length with value 1." => sub { my $type = mk_type('Base64Binary', {'length' => '1'}); should_pass("cw==", $type, 0); should_pass("aw==", $type, 0); should_pass("cA==", $type, 0); should_pass("dQ==", $type, 0); should_pass("aw==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet length with value 31." => sub { my $type = mk_type('Base64Binary', {'length' => '31'}); should_pass("c3dqYWFmdml0dGZyeG9lanJsYWR3eHF4b3JuYm53ag==", $type, 0); should_pass("YnRvYmlzZnFmcmhrcHB3eGJ1eXhmZ3l0aWtoZmVubg==", $type, 0); should_pass("YWlnb3RqcmFoeWZ2eGJhZG5sdHBkYWV3aGxpaGRyYw==", $type, 0); should_pass("YW13cHJpcmhwbmJuZW93cmpqaWdwbWxlaG53d2t5aw==", $type, 0); should_pass("YXVoaGVnZXBic2Nzb3NveXVvbmd4eXNsZmh2aXdvbA==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet length with value 47." => sub { my $type = mk_type('Base64Binary', {'length' => '47'}); should_pass("c3dtdG9ka2lrbmhsZ2ZjYmV3b3BxdG1od2p4aWpnaWZsZm92d3d1cmF1cHBueGU=", $type, 0); should_pass("bGFnaHhkd3F2dHRzcnFiY3Z4cWVubmxhZ3h5ZmV2aXhjZmFmdWVzZ2x0eWdqZmM=", $type, 0); should_pass("ZGVmcGhiYWF2eWZkcHBxa3dncWhnZHNqd3N2am1nZGhnYXN4d2JwY21qc2h0c2Q=", $type, 0); should_pass("cnFraW5sbG1ieXBrdXh4bXVndndkYWV4cWNhY3lkdGxwdXFlaHF3ZHl1dWhzZWQ=", $type, 0); should_pass("aWFjYmdtY3Jia2tyZXByZHNxeGxnYWxwc2t5Y21qdWpmYnlldnNsbW10YmVpb24=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet length with value 74." => sub { my $type = mk_type('Base64Binary', {'length' => '74'}); should_pass("d3d4YW1iam5qeGNhbHBmaXhyaHZqcHRsbXRzbWJ1ZGxpd3R2Y2xuYm9yc2lxYnFuYWtnZHFjc2l4ZHZ1eWd2d3JqYmZtYnhtYnE=", $type, 0); should_pass("dWhhZmNiZHl2b211aHJpa2FoeG5oZGdqYm1wZGNtd3Zxcmt2ZWV3bHNxb2RkY2hod29hYXJxcWZqbWVodmhvbXZocXdkdHhidXc=", $type, 0); should_pass("YmV4YXZwZHZoc2h4bXdocHBxdmFndnN1dmlydnl5am1waWVzeGhnanl5bmdibmhhdmxkbnF1aGFpcXZ2amphb29rbnljYmpocmk=", $type, 0); should_pass("cHhqY3Fqdmx4bGxpZGZveGpudGNhYWF5bmZxc3Nya3BvdHJuc25wYWNoYWZ2c29hYWRheGZnb3JleHJyc3FhZmRydXV5dmhnaWI=", $type, 0); should_pass("ZWhzeGlja21qdHFzZmphaXRtZGNzdGlxYnFvZndpeHdpcGlqbmZhdHhtdmFpdm54b3draGphdndnZGV2dWhzYnhkdGN2bmdjaXE=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet pattern with value [a-zA-Z0-9+/]{20}." => sub { my $type = mk_type('Base64Binary', {'pattern' => qr/(?ms:^[a-zA-Z0-9+\/]{20}$)/}); should_pass("dGRoYWx5anVnZnRydGRl", $type, 0); should_pass("dnBtZWFvZHNkcWNjbHBx", $type, 0); should_pass("bWhqcWdjd2ZwdGtjbXJs", $type, 0); should_pass("ZHFrcWt4eWRjZ2d4YnR0", $type, 0); should_pass("Y25hc3dxZGd2eGlqZGx0", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet pattern with value [a-zA-Z0-9+/]{68}." => sub { my $type = mk_type('Base64Binary', {'pattern' => qr/(?ms:^[a-zA-Z0-9+\/]{68}$)/}); should_pass("ZWxxdXJyanJuanFodGZ3Z25sc3VrZGJ0cGp5dHFoaGJxYmVyZ2RpbXl0c3NueWJpdXVq", $type, 0); should_pass("eGpycXh2dXFsa3lsbWtwcWt4d2hkcHVicXFlcWp2b2FtcGRucmNmbmFwcHFpcG9tdm9j", $type, 0); should_pass("Y2V5c2dic3R0Z3V0eHdwb3JlY2hmbGlkZW9yb25xZGl1aXZsaG9mcGVrdnd4bXlid3Fv", $type, 0); should_pass("Z2htb25kbmRycWpjc2pmYXVpamFtZGtsdm1sa3Fjc3RrdWRybWRlaGdmeGNxZHhzeW1v", $type, 0); should_pass("b2tsb3lpd3Rjcm5ybWt2c3dqdWRzcGFtbWlmbmFlZHJ0a3d3bGR1b3V4b2xhbmZ4eWx5", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet pattern with value [a-zA-Z0-9+/]{64}." => sub { my $type = mk_type('Base64Binary', {'pattern' => qr/(?ms:^[a-zA-Z0-9+\/]{64}$)/}); should_pass("b21pbWV3Ym9ibm1pbnBmdGdyYnl1Ymxybm9kcGhqbXNydmthamFocGtwaW55b2t1", $type, 0); should_pass("dGx4aHlyaWxkY29hc25md3hqZnBnc214Ymlwb2t1dGdvZnNjaWljY3N1Z2NuZnB4", $type, 0); should_pass("aXRhcmxvbW9lZW1zaGR3ZnF1ZW5jdHdjdG9hZmxvdnV4dWtseHd3YmJybWl1aGJo", $type, 0); should_pass("Ym5rbmJxZ2V2ZmxoZHdhZnBtbXlnbGZ5cnBta3lhZGtpb2dwbW1ha29iY2pxYm9i", $type, 0); should_pass("Z2pvYmZwaHhxeGZxdW1od2ZpYWlld2pwbHZlY3J5bmV4bmNjZG1qbWVrYmx3dmd3", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet pattern with value [a-zA-Z0-9+/]{24}." => sub { my $type = mk_type('Base64Binary', {'pattern' => qr/(?ms:^[a-zA-Z0-9+\/]{24}$)/}); should_pass("bmxscXJ5bWRpeWJraWxybW1l", $type, 0); should_pass("cmRnd3drb291cWhnaGFpdGZz", $type, 0); should_pass("ZGJ4cHFzdnVxZXd5a2RvZnJz", $type, 0); should_pass("dmp1amFhandsY21yeWJ0dHNp", $type, 0); should_pass("aXZkcGl3eWdyd2ZleG9pbmly", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet pattern with value [a-zA-Z0-9+/]{60}." => sub { my $type = mk_type('Base64Binary', {'pattern' => qr/(?ms:^[a-zA-Z0-9+\/]{60}$)/}); should_pass("a2dicW9mY29ybWdjb2tycGRscWNxamp0ZWxxbWlzaXFrZm9oZ2twdWR5eHh5", $type, 0); should_pass("c3V1d2ZqdHJ1eG1nZm1kdHN4bWtoYXdrdWNzbGhrdmhxc2R5Y2tpb25lbXZx", $type, 0); should_pass("a2VzdXZub2hscG53aHZsdml4aGZxdGZ3aXl3cmRocXdkcmNuaWpxZGVpYmlx", $type, 0); should_pass("b3FocGJvcmtrdG5nZnFkcWtsb3NnZ3FnbWtnZ2JzbmZ3d3BvanZkZmVveWNv", $type, 0); should_pass("aW9wdmhldHRkc2t3cXllZXZjbm9haXNhcWhvZXFpdXNpdXh3dmpqY25oZWJs", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet enumeration." => sub { my $type = mk_type('Base64Binary', {'enumeration' => ['ZmFyaml5Zm1i','dHJhZWJmc3Zhcg==','Y29zaXB5amtvZnhwb2lpanhvZnRrcHVxa3BybnByZGhjeHR3c2dqcGRrdmFqbm9seXhyeHZzYnFjZm10','b250Z21mb2x5bGluYmduandpbnBwb3V1YWhqd2NidA==','c3Rjb2xycnd2bWpza29wdmdjbnk=']}); should_pass("b250Z21mb2x5bGluYmduandpbnBwb3V1YWhqd2NidA==", $type, 0); should_pass("dHJhZWJmc3Zhcg==", $type, 0); should_pass("b250Z21mb2x5bGluYmduandpbnBwb3V1YWhqd2NidA==", $type, 0); should_pass("dHJhZWJmc3Zhcg==", $type, 0); should_pass("dHJhZWJmc3Zhcg==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet enumeration." => sub { my $type = mk_type('Base64Binary', {'enumeration' => ['dmxpbXRpbnJ3aWlwamp3ZXhiZXJ0cXBx','d2xnbmNkZWN4ZWZleHNqYXZkc2xlcXRidnZ1aXV0aGhzdmZ0ZWxwbndiZmln','ZGdqbG5hc2tzeWN2bW5qcHdhcnhucnFndXZicXF5cmRj','ZHFzbWxnbWVw','dGVmd3BsbWRmY3htcG1kd2JoaWZtcnhobXZlYWVnYXRlYWxwbm1meW14dXU=','cWFoYnd1dGZleWV3d3Rra3NpbnFiZGNqamdrcWF4YXZ5Y3Ri','c2dmc2ZhZXBuZGZnY214Z2Rsd2N4am1hbXl3ZGRuY3hpcHZscHlzeWpkZHNwcGdwbGlpZXJzaHRqaw==','dXZiZ3RkcGxwZ3hkc3FqeGZtcmVsbHNqaW5qeHlma2Z5bXZiYmVrZmZ2Z2xxdHB4bW5ycHZ0anZ2amtvd2N1aWh2dWdiZGltdw==','d3N5cHJoZ250aWtmYml2ZGN2bGZ4cnZk']}); should_pass("c2dmc2ZhZXBuZGZnY214Z2Rsd2N4am1hbXl3ZGRuY3hpcHZscHlzeWpkZHNwcGdwbGlpZXJzaHRqaw==", $type, 0); should_pass("ZHFzbWxnbWVw", $type, 0); should_pass("dGVmd3BsbWRmY3htcG1kd2JoaWZtcnhobXZlYWVnYXRlYWxwbm1meW14dXU=", $type, 0); should_pass("dmxpbXRpbnJ3aWlwamp3ZXhiZXJ0cXBx", $type, 0); should_pass("d2xnbmNkZWN4ZWZleHNqYXZkc2xlcXRidnZ1aXV0aGhzdmZ0ZWxwbndiZmln", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet enumeration." => sub { my $type = mk_type('Base64Binary', {'enumeration' => ['eGJjeXJjbHVjcXJlbHZhbmRzamthcmprbXZydGV4Z3hoZXZtcXZ0bmx0dnh4dGRvd2ZxcmtqY2s=','cXNraWVxYWN1ZXh5b3F0dmRnZ2ZnbGl2eGRsdGk=','cnVmZGRucWV5c3ZsZ2ZzdGVyZHlyb2VtaGFtb211cG50eHN3','cnVia21pZ3d3cWF5dHlvZGtrY2tvZXF4dmRkZmthZmNwamp1ZGRvcGRrdndnZnJmdGttdnVoZ3I=','YnVuanVxZnh0aXhzYmpjeHFmcXNxd3lrYmtjdnRrd2lqbXh3aG9xdmphdnVnampkeWdndGx1dXBzYmlnanY=','YnZ0cGVzYXlwZ2lvc3NoYWZodWNxb3B1cGt5Y2NudGpueXlhd29wdXFhY25qZXl1dm5ydGFn']}); should_pass("cXNraWVxYWN1ZXh5b3F0dmRnZ2ZnbGl2eGRsdGk=", $type, 0); should_pass("YnVuanVxZnh0aXhzYmpjeHFmcXNxd3lrYmtjdnRrd2lqbXh3aG9xdmphdnVnampkeWdndGx1dXBzYmlnanY=", $type, 0); should_pass("cnVia21pZ3d3cWF5dHlvZGtrY2tvZXF4dmRkZmthZmNwamp1ZGRvcGRrdndnZnJmdGttdnVoZ3I=", $type, 0); should_pass("cnVmZGRucWV5c3ZsZ2ZzdGVyZHlyb2VtaGFtb211cG50eHN3", $type, 0); should_pass("YnVuanVxZnh0aXhzYmpjeHFmcXNxd3lrYmtjdnRrd2lqbXh3aG9xdmphdnVnampkeWdndGx1dXBzYmlnanY=", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet enumeration." => sub { my $type = mk_type('Base64Binary', {'enumeration' => ['aGo=','YWZkcWd2a2ZzcHN5cnNjbWF3eGR2Z3Nwa2xkdWd4YXBlcHludGFvcmd3eWJsbHlz','dW15anlkeWxuZHhkaXF1ZWl0bHNma2pleXRhd3ViYmlxeG9reXNlZXV5c2NiY3l5aWtlc21xdHNpaWdvbA==','c3RmdHZoeGFmdHF3aWJmYW9wdmliY3JiZA==','ZXJueG91cG9zYmtwcXZleGhmeHljc3RsdWdqcXA=','dHJna3FscXJ1aHVwZ2h5dGx5bXV1d2xpdGxxYnBqaWJwcHdmZGxhZ25tdnN2ZHFtdGJhaXlicnZqdGViaWthYWV3','YmZ1c21md3R2bmd3bnZ4cnRubG15cHJhamFsb2Rscg==']}); should_pass("YmZ1c21md3R2bmd3bnZ4cnRubG15cHJhamFsb2Rscg==", $type, 0); should_pass("dW15anlkeWxuZHhkaXF1ZWl0bHNma2pleXRhd3ViYmlxeG9reXNlZXV5c2NiY3l5aWtlc21xdHNpaWdvbA==", $type, 0); should_pass("YWZkcWd2a2ZzcHN5cnNjbWF3eGR2Z3Nwa2xkdWd4YXBlcHludGFvcmd3eWJsbHlz", $type, 0); should_pass("ZXJueG91cG9zYmtwcXZleGhmeHljc3RsdWdqcXA=", $type, 0); should_pass("YmZ1c21md3R2bmd3bnZ4cnRubG15cHJhamFsb2Rscg==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet enumeration." => sub { my $type = mk_type('Base64Binary', {'enumeration' => ['ZWNkbmVkcnJhZG9mYmpwb3Jwc25ic3c=','ZmJkZ3FtY2h0dXd5eGRnb2VzZmFoc25sYWZteHZ4cWNncWRzaWxwZWNkYmptbXRiZnc=','dWtyamFvdGtjbW93bXBpZWhxcGFxbHB1a2ZrZW95eHN1b2pvaXVyamVreG9zY2p2bmdybW10aHV5a2lscW1tY2thbw==','dGdmY2dlbmZudm14bHF5ZnlieXBreG9kZXV4cmxhanVjdGdvbXFqeGlidXNreW1ucGJiaGtkbnB5YWpscw==','eHRhdnFkaXNxZQ==','anV0YnBvY2JueXB0YXBtcHFycnFybWxvanFkeXdtY3llb3N0bmdtbmRxYQ==','cGJ1bGhkeGZwc2hoa3B3aWtmYWpqaW5nbGxkaGlwanh0aHliaW9qaWNpdmJpdm54cQ==']}); should_pass("ZWNkbmVkcnJhZG9mYmpwb3Jwc25ic3c=", $type, 0); should_pass("ZmJkZ3FtY2h0dXd5eGRnb2VzZmFoc25sYWZteHZ4cWNncWRzaWxwZWNkYmptbXRiZnc=", $type, 0); should_pass("ZmJkZ3FtY2h0dXd5eGRnb2VzZmFoc25sYWZteHZ4cWNncWRzaWxwZWNkYmptbXRiZnc=", $type, 0); should_pass("ZmJkZ3FtY2h0dXd5eGRnb2VzZmFoc25sYWZteHZ4cWNncWRzaWxwZWNkYmptbXRiZnc=", $type, 0); should_pass("eHRhdnFkaXNxZQ==", $type, 0); done_testing; }; subtest "Type atomic/base64Binary is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Base64Binary', {'whiteSpace' => 'collapse'}); should_pass("cGdjb2VtcGF1d29ramhld2d2bm53bnR3d3B5b3dkeGpnc29sY2Y=", $type, 0); should_pass("Y3JvaGxveW9maXhlandleGhhZnFza3RicG5wbmRndW94aXlsYXY=", $type, 0); should_pass("ZWJteW90cXVvcWp0dHhiYWhhcWpzdHh4dmFuamp3dW5hcm11dHA=", $type, 0); should_pass("eWJtYm1jaWFhZnBjcWxxa3FwaWVsdW1pd2xzcmd0aW90cnZqY2s=", $type, 0); should_pass("dW1pbGlmb2R1dWNjbHd5ZGJyZXNhcmVlb3JwamJqZmpxb2pubGs=", $type, 0); done_testing; }; done_testing; 50boolean.t000664001750001750 662512404317273 14305 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/boolean is restricted by facet pattern with value [1]{1}." => sub { my $type = mk_type('Boolean', {'pattern' => qr/(?ms:^[1]{1}$)/}); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet pattern with value false." => sub { my $type = mk_type('Boolean', {'pattern' => qr/(?ms:^false$)/}); should_pass("false", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet pattern with value [1]{1}." => sub { my $type = mk_type('Boolean', {'pattern' => qr/(?ms:^[1]{1}$)/}); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet pattern with value false." => sub { my $type = mk_type('Boolean', {'pattern' => qr/(?ms:^false$)/}); should_pass("false", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet pattern with value [1]{1}." => sub { my $type = mk_type('Boolean', {'pattern' => qr/(?ms:^[1]{1}$)/}); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Boolean', {'whiteSpace' => 'collapse'}); should_pass("false", $type, 0); should_pass("1", $type, 0); should_pass("true", $type, 0); should_pass("false", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Boolean', {'whiteSpace' => 'collapse'}); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("true", $type, 0); should_pass("false", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Boolean', {'whiteSpace' => 'collapse'}); should_pass("false", $type, 0); should_pass("true", $type, 0); should_pass("false", $type, 0); should_pass("1", $type, 0); should_pass("false", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Boolean', {'whiteSpace' => 'collapse'}); should_pass("true", $type, 0); should_pass("false", $type, 0); should_pass("true", $type, 0); should_pass("false", $type, 0); should_pass("false", $type, 0); done_testing; }; subtest "Type atomic/boolean is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Boolean', {'whiteSpace' => 'collapse'}); should_pass("false", $type, 0); should_pass("0", $type, 0); should_pass("true", $type, 0); should_pass("true", $type, 0); should_pass("true", $type, 0); done_testing; }; done_testing; 50byte.t000664001750001750 5071012404317273 13643 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/byte is restricted by facet minExclusive with value -128." => sub { my $type = mk_type('Byte', {'minExclusive' => '-128'}); should_pass("-127", $type, 0); should_pass("-3", $type, 0); should_pass("125", $type, 0); should_pass("97", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 32." => sub { my $type = mk_type('Byte', {'minExclusive' => '32'}); should_pass("33", $type, 0); should_pass("56", $type, 0); should_pass("47", $type, 0); should_pass("110", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 79." => sub { my $type = mk_type('Byte', {'minExclusive' => '79'}); should_pass("80", $type, 0); should_pass("111", $type, 0); should_pass("113", $type, 0); should_pass("84", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 95." => sub { my $type = mk_type('Byte', {'minExclusive' => '95'}); should_pass("96", $type, 0); should_pass("122", $type, 0); should_pass("109", $type, 0); should_pass("97", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 126." => sub { my $type = mk_type('Byte', {'minExclusive' => '126'}); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value -128." => sub { my $type = mk_type('Byte', {'minInclusive' => '-128'}); should_pass("-128", $type, 0); should_pass("125", $type, 0); should_pass("-103", $type, 0); should_pass("122", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value 35." => sub { my $type = mk_type('Byte', {'minInclusive' => '35'}); should_pass("35", $type, 0); should_pass("56", $type, 0); should_pass("36", $type, 0); should_pass("47", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value 28." => sub { my $type = mk_type('Byte', {'minInclusive' => '28'}); should_pass("28", $type, 0); should_pass("60", $type, 0); should_pass("113", $type, 0); should_pass("35", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value -50." => sub { my $type = mk_type('Byte', {'minInclusive' => '-50'}); should_pass("-50", $type, 0); should_pass("52", $type, 0); should_pass("124", $type, 0); should_pass("62", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value 127." => sub { my $type = mk_type('Byte', {'minInclusive' => '127'}); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value -127." => sub { my $type = mk_type('Byte', {'maxExclusive' => '-127'}); should_pass("-128", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value -15." => sub { my $type = mk_type('Byte', {'maxExclusive' => '-15'}); should_pass("-128", $type, 0); should_pass("-116", $type, 0); should_pass("-56", $type, 0); should_pass("-41", $type, 0); should_pass("-16", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value 103." => sub { my $type = mk_type('Byte', {'maxExclusive' => '103'}); should_pass("-128", $type, 0); should_pass("-1", $type, 0); should_pass("44", $type, 0); should_pass("68", $type, 0); should_pass("102", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value 110." => sub { my $type = mk_type('Byte', {'maxExclusive' => '110'}); should_pass("-128", $type, 0); should_pass("-100", $type, 0); should_pass("-59", $type, 0); should_pass("-42", $type, 0); should_pass("109", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value 127." => sub { my $type = mk_type('Byte', {'maxExclusive' => '127'}); should_pass("-128", $type, 0); should_pass("3", $type, 0); should_pass("-73", $type, 0); should_pass("-19", $type, 0); should_pass("126", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value -128." => sub { my $type = mk_type('Byte', {'maxInclusive' => '-128'}); should_pass("-128", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value 123." => sub { my $type = mk_type('Byte', {'maxInclusive' => '123'}); should_pass("-128", $type, 0); should_pass("117", $type, 0); should_pass("-75", $type, 0); should_pass("11", $type, 0); should_pass("123", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value 17." => sub { my $type = mk_type('Byte', {'maxInclusive' => '17'}); should_pass("-128", $type, 0); should_pass("1", $type, 0); should_pass("-5", $type, 0); should_pass("-112", $type, 0); should_pass("17", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value -47." => sub { my $type = mk_type('Byte', {'maxInclusive' => '-47'}); should_pass("-128", $type, 0); should_pass("-81", $type, 0); should_pass("-69", $type, 0); should_pass("-98", $type, 0); should_pass("-47", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value 127." => sub { my $type = mk_type('Byte', {'maxInclusive' => '127'}); should_pass("-128", $type, 0); should_pass("96", $type, 0); should_pass("-55", $type, 0); should_pass("-57", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Byte', {'fractionDigits' => '0'}); should_pass("-128", $type, 0); should_pass("31", $type, 0); should_pass("24", $type, 0); should_pass("-13", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Byte', {'totalDigits' => '1'}); should_pass("7", $type, 0); should_pass("6", $type, 0); should_pass("8", $type, 0); should_pass("5", $type, 0); should_pass("4", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('Byte', {'totalDigits' => '2'}); should_pass("4", $type, 0); should_pass("31", $type, 0); should_pass("8", $type, 0); should_pass("81", $type, 0); should_pass("5", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('Byte', {'totalDigits' => '3'}); should_pass("4", $type, 0); should_pass("78", $type, 0); should_pass("118", $type, 0); should_pass("7", $type, 0); should_pass("40", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\-\\d{3}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\-\d{3}$)/}); should_pass("-113", $type, 0); should_pass("-114", $type, 0); should_pass("-113", $type, 0); should_pass("-114", $type, 0); should_pass("-112", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\-\\d{2}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\-\d{2}$)/}); should_pass("-84", $type, 0); should_pass("-58", $type, 0); should_pass("-64", $type, 0); should_pass("-44", $type, 0); should_pass("-52", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-4", $type, 0); should_pass("-4", $type, 0); should_pass("-1", $type, 0); should_pass("-2", $type, 0); should_pass("-7", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("8", $type, 0); should_pass("2", $type, 0); should_pass("6", $type, 0); should_pass("5", $type, 0); should_pass("6", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\d{3}$)/}); should_pass("114", $type, 0); should_pass("113", $type, 0); should_pass("113", $type, 0); should_pass("114", $type, 0); should_pass("116", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['-5','-4','-7','88','-128','20','127','-59','84']}); should_pass("-59", $type, 0); should_pass("127", $type, 0); should_pass("-128", $type, 0); should_pass("-128", $type, 0); should_pass("-59", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['9','127','64','-81','3','-7','-93','50']}); should_pass("-93", $type, 0); should_pass("3", $type, 0); should_pass("-93", $type, 0); should_pass("-7", $type, 0); should_pass("50", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['60','62','5','-128','4','57','127','30']}); should_pass("62", $type, 0); should_pass("127", $type, 0); should_pass("-128", $type, 0); should_pass("-128", $type, 0); should_pass("-128", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['-5','96','127','-48','33','69','-60','-86']}); should_pass("-48", $type, 0); should_pass("69", $type, 0); should_pass("33", $type, 0); should_pass("-48", $type, 0); should_pass("-60", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['-3','-128','41','127','-5','14','-45','-35','-89']}); should_pass("-35", $type, 0); should_pass("14", $type, 0); should_pass("-45", $type, 0); should_pass("-128", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Byte', {'whiteSpace' => 'collapse'}); should_pass("-128", $type, 0); should_pass("-125", $type, 0); should_pass("90", $type, 0); should_pass("-89", $type, 0); should_pass("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value -17." => sub { my $type = mk_type('Byte', {'minInclusive' => '-17'}); should_fail("-128", $type, 0); should_fail("-102", $type, 0); should_fail("-24", $type, 0); should_fail("-53", $type, 0); should_fail("-18", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('Byte', {'minInclusive' => '0'}); should_fail("-128", $type, 0); should_fail("-124", $type, 0); should_fail("-110", $type, 0); should_fail("-15", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value -107." => sub { my $type = mk_type('Byte', {'minInclusive' => '-107'}); should_fail("-128", $type, 0); should_fail("-125", $type, 0); should_fail("-117", $type, 0); should_fail("-124", $type, 0); should_fail("-108", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value 19." => sub { my $type = mk_type('Byte', {'minInclusive' => '19'}); should_fail("-128", $type, 0); should_fail("4", $type, 0); should_fail("-64", $type, 0); should_fail("-14", $type, 0); should_fail("18", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minInclusive with value 127." => sub { my $type = mk_type('Byte', {'minInclusive' => '127'}); should_fail("-128", $type, 0); should_fail("-85", $type, 0); should_fail("64", $type, 0); should_fail("36", $type, 0); should_fail("126", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value -128." => sub { my $type = mk_type('Byte', {'maxInclusive' => '-128'}); should_fail("-127", $type, 0); should_fail("67", $type, 0); should_fail("15", $type, 0); should_fail("123", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value 122." => sub { my $type = mk_type('Byte', {'maxInclusive' => '122'}); should_fail("123", $type, 0); should_fail("125", $type, 0); should_fail("126", $type, 0); should_fail("124", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value -93." => sub { my $type = mk_type('Byte', {'maxInclusive' => '-93'}); should_fail("-92", $type, 0); should_fail("6", $type, 0); should_fail("-16", $type, 0); should_fail("-84", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value -91." => sub { my $type = mk_type('Byte', {'maxInclusive' => '-91'}); should_fail("-90", $type, 0); should_fail("-56", $type, 0); should_fail("-22", $type, 0); should_fail("-41", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxInclusive with value -100." => sub { my $type = mk_type('Byte', {'maxInclusive' => '-100'}); should_fail("-99", $type, 0); should_fail("-11", $type, 0); should_fail("91", $type, 0); should_fail("-1", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Byte', {'totalDigits' => '1'}); should_fail("99", $type, 0); should_fail("108", $type, 0); should_fail("44", $type, 0); should_fail("113", $type, 0); should_fail("45", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('Byte', {'totalDigits' => '2'}); should_fail("116", $type, 0); should_fail("126", $type, 0); should_fail("109", $type, 0); should_fail("111", $type, 0); should_fail("115", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value -128." => sub { my $type = mk_type('Byte', {'minExclusive' => '-128'}); should_fail("-128", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 17." => sub { my $type = mk_type('Byte', {'minExclusive' => '17'}); should_fail("-128", $type, 0); should_fail("-120", $type, 0); should_fail("-78", $type, 0); should_fail("-9", $type, 0); should_fail("17", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 113." => sub { my $type = mk_type('Byte', {'minExclusive' => '113'}); should_fail("-128", $type, 0); should_fail("8", $type, 0); should_fail("34", $type, 0); should_fail("75", $type, 0); should_fail("113", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value -118." => sub { my $type = mk_type('Byte', {'minExclusive' => '-118'}); should_fail("-128", $type, 0); should_fail("-118", $type, 0); should_fail("-119", $type, 0); should_fail("-121", $type, 0); should_fail("-118", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet minExclusive with value 126." => sub { my $type = mk_type('Byte', {'minExclusive' => '126'}); should_fail("-128", $type, 0); should_fail("75", $type, 0); should_fail("-69", $type, 0); should_fail("91", $type, 0); should_fail("126", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value -127." => sub { my $type = mk_type('Byte', {'maxExclusive' => '-127'}); should_fail("-127", $type, 0); should_fail("113", $type, 0); should_fail("-100", $type, 0); should_fail("2", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value 48." => sub { my $type = mk_type('Byte', {'maxExclusive' => '48'}); should_fail("48", $type, 0); should_fail("119", $type, 0); should_fail("59", $type, 0); should_fail("74", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value 100." => sub { my $type = mk_type('Byte', {'maxExclusive' => '100'}); should_fail("100", $type, 0); should_fail("113", $type, 0); should_fail("110", $type, 0); should_fail("115", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value -38." => sub { my $type = mk_type('Byte', {'maxExclusive' => '-38'}); should_fail("-38", $type, 0); should_fail("35", $type, 0); should_fail("80", $type, 0); should_fail("-22", $type, 0); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet maxExclusive with value 127." => sub { my $type = mk_type('Byte', {'maxExclusive' => '127'}); should_fail("127", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\-\\d{3}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\-\d{3}$)/}); should_fail("32", $type, 0); should_fail("3", $type, 0); should_fail("9", $type, 0); should_fail("5", $type, 0); should_fail("2", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\-\\d{2}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\-\d{2}$)/}); should_fail("115", $type, 0); should_fail("-112", $type, 0); should_fail("-113", $type, 0); should_fail("3", $type, 0); should_fail("112", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("63", $type, 0); should_fail("-86", $type, 0); should_fail("111", $type, 0); should_fail("-77", $type, 0); should_fail("116", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("-115", $type, 0); should_fail("72", $type, 0); should_fail("-112", $type, 0); should_fail("-95", $type, 0); should_fail("-43", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('Byte', {'pattern' => qr/(?ms:^\d{3}$)/}); should_fail("24", $type, 0); should_fail("1", $type, 0); should_fail("-25", $type, 0); should_fail("9", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['1','5','-2','-128','-21']}); should_fail("101", $type, 0); should_fail("-53", $type, 0); should_fail("39", $type, 0); should_fail("-110", $type, 0); should_fail("33", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['55','2','-6','38','11','127','28','86']}); should_fail("-92", $type, 0); should_fail("-120", $type, 0); should_fail("-122", $type, 0); should_fail("-80", $type, 0); should_fail("44", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['-128','-3','-13','-68','-36','63','-8','-71','75']}); should_fail("-18", $type, 0); should_fail("127", $type, 0); should_fail("79", $type, 0); should_fail("-82", $type, 0); should_fail("-82", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['-50','-128','127','-6','69','-11','-51','3']}); should_fail("20", $type, 0); should_fail("-24", $type, 0); should_fail("10", $type, 0); should_fail("27", $type, 0); should_fail("28", $type, 0); done_testing; }; subtest "Type atomic/byte is restricted by facet enumeration." => sub { my $type = mk_type('Byte', {'enumeration' => ['-2','-85','82','127','17','-3','10']}); should_fail("-126", $type, 0); should_fail("-23", $type, 0); should_fail("22", $type, 0); should_fail("-102", $type, 0); should_fail("-102", $type, 0); done_testing; }; done_testing; 50date.t000664001750001750 5360212404317273 13620 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/date is restricted by facet minExclusive with value 1970-01-01." => sub { my $type = mk_type('Date', {'minExclusive' => '1970-01-01'}); should_pass("1970-01-02", $type, 0); should_pass("2016-05-28", $type, 0); should_pass("2020-11-21", $type, 0); should_pass("2003-11-08", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2027-03-05." => sub { my $type = mk_type('Date', {'minExclusive' => '2027-03-05'}); should_pass("2027-03-06", $type, 0); should_pass("2027-11-29", $type, 0); should_pass("2030-05-22", $type, 0); should_pass("2029-12-10", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2005-11-17." => sub { my $type = mk_type('Date', {'minExclusive' => '2005-11-17'}); should_pass("2005-11-18", $type, 0); should_pass("2014-03-09", $type, 0); should_pass("2015-05-23", $type, 0); should_pass("2015-07-12", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2025-01-09." => sub { my $type = mk_type('Date', {'minExclusive' => '2025-01-09'}); should_pass("2025-01-10", $type, 0); should_pass("2025-02-13", $type, 0); should_pass("2029-03-07", $type, 0); should_pass("2028-04-05", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2030-12-30." => sub { my $type = mk_type('Date', {'minExclusive' => '2030-12-30'}); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 1970-01-01." => sub { my $type = mk_type('Date', {'minInclusive' => '1970-01-01'}); should_pass("1970-01-01", $type, 0); should_pass("1992-02-28", $type, 0); should_pass("2002-08-18", $type, 0); should_pass("2020-03-01", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 1973-09-08." => sub { my $type = mk_type('Date', {'minInclusive' => '1973-09-08'}); should_pass("1973-09-08", $type, 0); should_pass("2017-08-17", $type, 0); should_pass("1975-08-29", $type, 0); should_pass("1995-01-12", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2005-07-30." => sub { my $type = mk_type('Date', {'minInclusive' => '2005-07-30'}); should_pass("2005-07-30", $type, 0); should_pass("2022-05-28", $type, 0); should_pass("2017-06-11", $type, 0); should_pass("2013-12-12", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 1979-03-05." => sub { my $type = mk_type('Date', {'minInclusive' => '1979-03-05'}); should_pass("1979-03-05", $type, 0); should_pass("2014-06-05", $type, 0); should_pass("2022-09-30", $type, 0); should_pass("1994-09-26", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2030-12-31." => sub { my $type = mk_type('Date', {'minInclusive' => '2030-12-31'}); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 1970-01-02." => sub { my $type = mk_type('Date', {'maxExclusive' => '1970-01-02'}); should_pass("1970-01-01", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2016-09-05." => sub { my $type = mk_type('Date', {'maxExclusive' => '2016-09-05'}); should_pass("1970-01-01", $type, 0); should_pass("1987-02-26", $type, 0); should_pass("1994-04-13", $type, 0); should_pass("1986-10-18", $type, 0); should_pass("2016-09-04", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 1990-01-30." => sub { my $type = mk_type('Date', {'maxExclusive' => '1990-01-30'}); should_pass("1970-01-01", $type, 0); should_pass("1975-12-28", $type, 0); should_pass("1984-11-27", $type, 0); should_pass("1978-10-23", $type, 0); should_pass("1990-01-29", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2027-10-13." => sub { my $type = mk_type('Date', {'maxExclusive' => '2027-10-13'}); should_pass("1970-01-01", $type, 0); should_pass("1975-06-19", $type, 0); should_pass("2011-10-11", $type, 0); should_pass("1977-03-18", $type, 0); should_pass("2027-10-12", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2030-12-31." => sub { my $type = mk_type('Date', {'maxExclusive' => '2030-12-31'}); should_pass("1970-01-01", $type, 0); should_pass("1971-11-24", $type, 0); should_pass("2003-11-21", $type, 0); should_pass("2013-07-19", $type, 0); should_pass("2030-12-30", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 1970-01-01." => sub { my $type = mk_type('Date', {'maxInclusive' => '1970-01-01'}); should_pass("1970-01-01", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 2029-09-09." => sub { my $type = mk_type('Date', {'maxInclusive' => '2029-09-09'}); should_pass("1970-01-01", $type, 0); should_pass("1982-06-16", $type, 0); should_pass("2005-09-03", $type, 0); should_pass("2023-12-26", $type, 0); should_pass("2029-09-09", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 2020-12-27." => sub { my $type = mk_type('Date', {'maxInclusive' => '2020-12-27'}); should_pass("1970-01-01", $type, 0); should_pass("2016-06-30", $type, 0); should_pass("1994-03-09", $type, 0); should_pass("2014-12-19", $type, 0); should_pass("2020-12-27", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 1971-01-23." => sub { my $type = mk_type('Date', {'maxInclusive' => '1971-01-23'}); should_pass("1970-01-01", $type, 0); should_pass("1970-06-21", $type, 0); should_pass("1970-11-24", $type, 0); should_pass("1970-03-11", $type, 0); should_pass("1971-01-23", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 2030-12-31." => sub { my $type = mk_type('Date', {'maxInclusive' => '2030-12-31'}); should_pass("1970-01-01", $type, 0); should_pass("2006-09-25", $type, 0); should_pass("2022-02-18", $type, 0); should_pass("1982-05-02", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d58-0\\d-\\d8." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d58-0\d-\d8$)/}); should_pass("1858-06-28", $type, 0); should_pass("1858-05-08", $type, 0); should_pass("1958-02-08", $type, 0); should_pass("1958-08-28", $type, 0); should_pass("1958-08-18", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d10-\\d4-1\\d." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d10-\d4-1\d$)/}); should_pass("1910-04-16", $type, 0); should_pass("1710-04-16", $type, 0); should_pass("1910-04-16", $type, 0); should_pass("1810-04-17", $type, 0); should_pass("1710-04-17", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d90-\\d7-2\\d." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d90-\d7-2\d$)/}); should_pass("1890-07-24", $type, 0); should_pass("2090-07-21", $type, 0); should_pass("1990-07-23", $type, 0); should_pass("1990-07-27", $type, 0); should_pass("1990-07-22", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value 17\\d\\d-\\d0-1\\d." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^17\d\d-\d0-1\d$)/}); should_pass("1748-10-16", $type, 0); should_pass("1731-10-17", $type, 0); should_pass("1734-10-17", $type, 0); should_pass("1769-10-12", $type, 0); should_pass("1728-10-16", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d44-\\d2-\\d5." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d44-\d2-\d5$)/}); should_pass("1844-02-15", $type, 0); should_pass("1744-02-05", $type, 0); should_pass("1944-02-05", $type, 0); should_pass("2044-02-15", $type, 0); should_pass("1944-02-25", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['1975-06-11','1997-12-26','1998-11-16','2023-08-17','2010-04-24','2028-06-23','2015-03-13','2026-01-04']}); should_pass("2028-06-23", $type, 0); should_pass("2026-01-04", $type, 0); should_pass("1998-11-16", $type, 0); should_pass("1997-12-26", $type, 0); should_pass("2023-08-17", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['2013-10-28','2009-09-16','1974-02-14','2027-04-22','2027-07-03','2001-08-03','2015-12-10']}); should_pass("2009-09-16", $type, 0); should_pass("2009-09-16", $type, 0); should_pass("1974-02-14", $type, 0); should_pass("2009-09-16", $type, 0); should_pass("2027-07-03", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['2005-06-19','1973-10-26','1992-08-14','1973-09-16','1990-04-07','1995-07-16','1985-09-24']}); should_pass("1973-10-26", $type, 0); should_pass("1995-07-16", $type, 0); should_pass("1990-04-07", $type, 0); should_pass("1992-08-14", $type, 0); should_pass("1973-09-16", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['1991-09-06','2022-07-25','2021-10-20','1984-08-15','1975-11-02','2000-02-01']}); should_pass("1991-09-06", $type, 0); should_pass("2021-10-20", $type, 0); should_pass("1975-11-02", $type, 0); should_pass("1975-11-02", $type, 0); should_pass("2022-07-25", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['1972-02-04','2010-06-24','2022-08-04','2006-12-31','1992-01-14','2027-09-16','1980-07-02','2013-06-03']}); should_pass("2006-12-31", $type, 0); should_pass("2027-09-16", $type, 0); should_pass("2006-12-31", $type, 0); should_pass("2027-09-16", $type, 0); should_pass("2010-06-24", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Date', {'whiteSpace' => 'collapse'}); should_pass("1970-01-01", $type, 0); should_pass("1988-10-01", $type, 0); should_pass("1980-12-11", $type, 0); should_pass("2006-08-12", $type, 0); should_pass("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2010-10-14." => sub { my $type = mk_type('Date', {'minInclusive' => '2010-10-14'}); should_fail("1970-01-01", $type, 0); should_fail("2005-09-16", $type, 0); should_fail("1974-02-08", $type, 0); should_fail("1976-04-01", $type, 0); should_fail("2010-10-13", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2022-10-26." => sub { my $type = mk_type('Date', {'minInclusive' => '2022-10-26'}); should_fail("1970-01-01", $type, 0); should_fail("2001-09-15", $type, 0); should_fail("1997-06-24", $type, 0); should_fail("2022-01-05", $type, 0); should_fail("2022-10-25", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2004-12-05." => sub { my $type = mk_type('Date', {'minInclusive' => '2004-12-05'}); should_fail("1970-01-01", $type, 0); should_fail("1995-11-19", $type, 0); should_fail("1997-12-03", $type, 0); should_fail("1970-05-18", $type, 0); should_fail("2004-12-04", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2023-07-31." => sub { my $type = mk_type('Date', {'minInclusive' => '2023-07-31'}); should_fail("1970-01-01", $type, 0); should_fail("2004-08-16", $type, 0); should_fail("1972-01-13", $type, 0); should_fail("1994-08-02", $type, 0); should_fail("2023-07-30", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minInclusive with value 2030-12-31." => sub { my $type = mk_type('Date', {'minInclusive' => '2030-12-31'}); should_fail("1970-01-01", $type, 0); should_fail("2012-02-22", $type, 0); should_fail("1974-04-29", $type, 0); should_fail("2023-01-19", $type, 0); should_fail("2030-12-30", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 1970-01-01." => sub { my $type = mk_type('Date', {'maxInclusive' => '1970-01-01'}); should_fail("1970-01-02", $type, 0); should_fail("2014-06-29", $type, 0); should_fail("1994-05-21", $type, 0); should_fail("1978-04-13", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 1995-12-15." => sub { my $type = mk_type('Date', {'maxInclusive' => '1995-12-15'}); should_fail("1995-12-16", $type, 0); should_fail("1997-04-27", $type, 0); should_fail("1998-11-29", $type, 0); should_fail("2007-04-14", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 2020-08-23." => sub { my $type = mk_type('Date', {'maxInclusive' => '2020-08-23'}); should_fail("2020-08-24", $type, 0); should_fail("2025-02-08", $type, 0); should_fail("2026-06-28", $type, 0); should_fail("2023-11-28", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 2013-11-30." => sub { my $type = mk_type('Date', {'maxInclusive' => '2013-11-30'}); should_fail("2013-12-01", $type, 0); should_fail("2030-12-20", $type, 0); should_fail("2017-12-03", $type, 0); should_fail("2029-07-17", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxInclusive with value 1985-01-05." => sub { my $type = mk_type('Date', {'maxInclusive' => '1985-01-05'}); should_fail("1985-01-06", $type, 0); should_fail("2017-10-04", $type, 0); should_fail("1991-08-21", $type, 0); should_fail("2019-05-04", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 1970-01-01." => sub { my $type = mk_type('Date', {'minExclusive' => '1970-01-01'}); should_fail("1970-01-01", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2026-12-09." => sub { my $type = mk_type('Date', {'minExclusive' => '2026-12-09'}); should_fail("1970-01-01", $type, 0); should_fail("1970-09-30", $type, 0); should_fail("2020-02-25", $type, 0); should_fail("2015-05-09", $type, 0); should_fail("2026-12-09", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2010-09-26." => sub { my $type = mk_type('Date', {'minExclusive' => '2010-09-26'}); should_fail("1970-01-01", $type, 0); should_fail("1997-01-26", $type, 0); should_fail("1978-01-21", $type, 0); should_fail("2004-01-25", $type, 0); should_fail("2010-09-26", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2027-08-11." => sub { my $type = mk_type('Date', {'minExclusive' => '2027-08-11'}); should_fail("1970-01-01", $type, 0); should_fail("1977-04-20", $type, 0); should_fail("1976-10-24", $type, 0); should_fail("1985-05-27", $type, 0); should_fail("2027-08-11", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet minExclusive with value 2030-12-30." => sub { my $type = mk_type('Date', {'minExclusive' => '2030-12-30'}); should_fail("1970-01-01", $type, 0); should_fail("2011-12-16", $type, 0); should_fail("2004-05-15", $type, 0); should_fail("1983-10-10", $type, 0); should_fail("2030-12-30", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 1970-01-02." => sub { my $type = mk_type('Date', {'maxExclusive' => '1970-01-02'}); should_fail("1970-01-02", $type, 0); should_fail("2014-07-21", $type, 0); should_fail("2023-12-27", $type, 0); should_fail("1971-11-15", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2003-05-06." => sub { my $type = mk_type('Date', {'maxExclusive' => '2003-05-06'}); should_fail("2003-05-06", $type, 0); should_fail("2028-05-02", $type, 0); should_fail("2027-11-22", $type, 0); should_fail("2004-08-11", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2011-10-16." => sub { my $type = mk_type('Date', {'maxExclusive' => '2011-10-16'}); should_fail("2011-10-16", $type, 0); should_fail("2027-07-04", $type, 0); should_fail("2022-07-19", $type, 0); should_fail("2024-08-04", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2012-11-19." => sub { my $type = mk_type('Date', {'maxExclusive' => '2012-11-19'}); should_fail("2012-11-19", $type, 0); should_fail("2025-08-14", $type, 0); should_fail("2013-08-06", $type, 0); should_fail("2028-07-19", $type, 0); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet maxExclusive with value 2030-12-31." => sub { my $type = mk_type('Date', {'maxExclusive' => '2030-12-31'}); should_fail("2030-12-31", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d54-0\\d-\\d8." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d54-0\d-\d8$)/}); should_fail("1842-11-10", $type, 0); should_fail("1944-12-23", $type, 0); should_fail("1940-11-25", $type, 0); should_fail("1944-12-06", $type, 0); should_fail("1936-11-14", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d79-0\\d-\\d5." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d79-0\d-\d5$)/}); should_fail("1817-10-11", $type, 0); should_fail("1994-12-07", $type, 0); should_fail("1712-10-24", $type, 0); should_fail("1945-11-16", $type, 0); should_fail("1949-11-07", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d35-0\\d-\\d7." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d35-0\d-\d7$)/}); should_fail("1910-10-18", $type, 0); should_fail("1939-11-06", $type, 0); should_fail("2011-11-22", $type, 0); should_fail("1898-10-23", $type, 0); should_fail("2066-11-26", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value 19\\d\\d-\\d0-2\\d." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^19\d\d-\d0-2\d$)/}); should_fail("1868-04-03", $type, 0); should_fail("1775-08-02", $type, 0); should_fail("1816-07-12", $type, 0); should_fail("1871-03-05", $type, 0); should_fail("2029-09-17", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet pattern with value \\d\\d32-0\\d-\\d7." => sub { my $type = mk_type('Date', {'pattern' => qr/(?ms:^\d\d32-0\d-\d7$)/}); should_fail("2039-11-14", $type, 0); should_fail("1914-11-02", $type, 0); should_fail("1992-11-13", $type, 0); should_fail("2012-12-20", $type, 0); should_fail("1931-11-06", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['1976-06-22','2010-12-07','1970-04-11','2027-10-27','1983-05-21','2027-03-15','1997-05-10','1976-08-08']}); should_fail("2022-07-14", $type, 0); should_fail("1993-01-02", $type, 0); should_fail("1983-12-28", $type, 0); should_fail("1989-01-15", $type, 0); should_fail("1976-03-07", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['2023-02-23','1995-09-28','1995-12-10','2006-07-02','1995-09-08','2021-08-05','1995-01-21','2000-08-30','2003-12-04']}); should_fail("2003-10-14", $type, 0); should_fail("2025-03-18", $type, 0); should_fail("1990-12-20", $type, 0); should_fail("2003-04-17", $type, 0); should_fail("1974-03-26", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['1992-02-13','1972-08-22','1994-03-25','2003-03-09','1987-01-18','1987-03-10','1984-12-12']}); should_fail("1985-03-29", $type, 0); should_fail("2012-08-17", $type, 0); should_fail("2019-05-15", $type, 0); should_fail("2025-05-20", $type, 0); should_fail("1988-02-08", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['1995-02-10','2027-11-23','1999-02-04','2008-04-14','2030-03-15','1993-02-19','2024-09-17']}); should_fail("1994-06-04", $type, 0); should_fail("1994-11-01", $type, 0); should_fail("1975-01-06", $type, 0); should_fail("1974-04-22", $type, 0); should_fail("2019-12-30", $type, 0); done_testing; }; subtest "Type atomic/date is restricted by facet enumeration." => sub { my $type = mk_type('Date', {'enumeration' => ['2021-08-02','1979-08-30','1978-11-27','1988-03-05','2019-10-13','1988-10-15','1982-07-19','2021-06-12','2010-08-11']}); should_fail("2023-06-17", $type, 0); should_fail("1999-06-24", $type, 0); should_fail("1979-02-19", $type, 0); should_fail("2022-06-20", $type, 0); should_fail("1984-01-21", $type, 0); done_testing; }; done_testing; 50dateTime.t000664001750001750 6500112404317273 14433 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/dateTime is restricted by facet minExclusive with value 1970-01-01T00:00:00." => sub { my $type = mk_type('DateTime', {'minExclusive' => '1970-01-01T00:00:00'}); should_pass("1970-01-01T00:00:01", $type, 0); should_pass("2027-06-01T06:03:52", $type, 0); should_pass("1972-03-04T12:42:23", $type, 0); should_pass("2012-02-17T19:25:05", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 1974-04-26T23:23:51." => sub { my $type = mk_type('DateTime', {'minExclusive' => '1974-04-26T23:23:51'}); should_pass("1974-04-26T23:23:52", $type, 0); should_pass("1985-02-07T10:25:40", $type, 0); should_pass("1988-10-16T19:12:29", $type, 0); should_pass("2019-01-10T02:21:44", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 1981-06-08T06:29:37." => sub { my $type = mk_type('DateTime', {'minExclusive' => '1981-06-08T06:29:37'}); should_pass("1981-06-08T06:29:38", $type, 0); should_pass("2017-06-14T03:12:11", $type, 0); should_pass("1983-05-12T11:48:28", $type, 0); should_pass("1998-02-06T16:36:46", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 2001-09-04T00:13:18." => sub { my $type = mk_type('DateTime', {'minExclusive' => '2001-09-04T00:13:18'}); should_pass("2001-09-04T00:13:19", $type, 0); should_pass("2008-07-28T04:38:47", $type, 0); should_pass("2026-09-04T17:05:14", $type, 0); should_pass("2014-11-06T02:46:17", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 2030-12-31T23:59:58." => sub { my $type = mk_type('DateTime', {'minExclusive' => '2030-12-31T23:59:58'}); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 1970-01-01T00:00:00." => sub { my $type = mk_type('DateTime', {'minInclusive' => '1970-01-01T00:00:00'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1989-08-09T14:53:55", $type, 0); should_pass("2001-10-06T04:45:24", $type, 0); should_pass("2024-08-29T12:07:59", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 1972-10-10T11:07:03." => sub { my $type = mk_type('DateTime', {'minInclusive' => '1972-10-10T11:07:03'}); should_pass("1972-10-10T11:07:03", $type, 0); should_pass("1985-06-18T11:28:03", $type, 0); should_pass("2005-03-07T13:01:30", $type, 0); should_pass("1991-09-12T05:14:01", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 1978-11-30T10:14:33." => sub { my $type = mk_type('DateTime', {'minInclusive' => '1978-11-30T10:14:33'}); should_pass("1978-11-30T10:14:33", $type, 0); should_pass("2010-07-19T04:52:34", $type, 0); should_pass("1995-05-24T13:31:48", $type, 0); should_pass("2002-08-05T20:23:56", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 2006-07-21T01:32:21." => sub { my $type = mk_type('DateTime', {'minInclusive' => '2006-07-21T01:32:21'}); should_pass("2006-07-21T01:32:21", $type, 0); should_pass("2017-08-28T19:07:05", $type, 0); should_pass("2009-02-10T19:11:06", $type, 0); should_pass("2020-12-28T10:12:14", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 2030-12-31T23:59:59." => sub { my $type = mk_type('DateTime', {'minInclusive' => '2030-12-31T23:59:59'}); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 1970-01-01T00:00:01." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '1970-01-01T00:00:01'}); should_pass("1970-01-01T00:00:00", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 1980-05-22T13:12:09." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '1980-05-22T13:12:09'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1977-04-13T14:25:05", $type, 0); should_pass("1971-08-21T22:26:27", $type, 0); should_pass("1978-04-13T16:51:02", $type, 0); should_pass("1980-05-22T13:12:08", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 1996-08-13T00:44:39." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '1996-08-13T00:44:39'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1988-05-22T00:32:31", $type, 0); should_pass("1992-04-09T20:02:24", $type, 0); should_pass("1976-01-14T17:55:37", $type, 0); should_pass("1996-08-13T00:44:38", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 2018-06-17T15:34:43." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '2018-06-17T15:34:43'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1988-02-05T04:45:18", $type, 0); should_pass("1986-07-28T23:17:07", $type, 0); should_pass("2002-06-24T02:55:38", $type, 0); should_pass("2018-06-17T15:34:42", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 2030-12-31T23:59:59." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '2030-12-31T23:59:59'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1996-08-07T20:33:24", $type, 0); should_pass("1988-07-12T00:50:57", $type, 0); should_pass("1989-09-24T02:35:47", $type, 0); should_pass("2030-12-31T23:59:58", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 1970-01-01T00:00:00." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '1970-01-01T00:00:00'}); should_pass("1970-01-01T00:00:00", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 1982-05-22T18:01:37." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '1982-05-22T18:01:37'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1973-11-06T05:46:55", $type, 0); should_pass("1976-01-06T16:31:01", $type, 0); should_pass("1972-01-03T01:59:05", $type, 0); should_pass("1982-05-22T18:01:37", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 2003-03-09T02:00:23." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '2003-03-09T02:00:23'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1984-04-06T04:33:04", $type, 0); should_pass("1985-09-14T06:20:20", $type, 0); should_pass("1979-11-20T13:55:06", $type, 0); should_pass("2003-03-09T02:00:23", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 1972-09-29T19:51:19." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '1972-09-29T19:51:19'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1970-03-02T17:58:01", $type, 0); should_pass("1971-08-30T06:44:31", $type, 0); should_pass("1970-03-27T07:06:53", $type, 0); should_pass("1972-09-29T19:51:19", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 2030-12-31T23:59:59." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '2030-12-31T23:59:59'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("2011-01-30T06:50:16", $type, 0); should_pass("1989-01-21T04:59:59", $type, 0); should_pass("2010-12-10T06:21:51", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value 19\\d\\d-0\\d-\\d8T\\d8:\\d5:5\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^19\d\d-0\d-\d8T\d8:\d5:5\d$)/}); should_pass("1900-06-08T18:25:54", $type, 0); should_pass("1957-07-18T18:25:53", $type, 0); should_pass("1952-01-18T18:55:54", $type, 0); should_pass("1922-05-08T18:55:51", $type, 0); should_pass("1930-03-18T18:45:58", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d55-0\\d-\\d8T\\d6:1\\d:0\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d55-0\d-\d8T\d6:1\d:0\d$)/}); should_pass("1955-03-28T16:11:07", $type, 0); should_pass("1955-05-18T16:15:05", $type, 0); should_pass("2055-08-18T16:13:07", $type, 0); should_pass("1855-04-28T06:14:09", $type, 0); should_pass("2055-04-28T16:10:07", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value 19\\d\\d-0\\d-0\\dT\\d5:1\\d:3\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^19\d\d-0\d-0\dT\d5:1\d:3\d$)/}); should_pass("1958-07-04T15:13:32", $type, 0); should_pass("1961-08-08T15:12:38", $type, 0); should_pass("1953-08-03T05:18:33", $type, 0); should_pass("1974-07-07T05:14:32", $type, 0); should_pass("1947-04-03T05:10:38", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d89-\\d2-\\d0T1\\d:2\\d:1\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d89-\d2-\d0T1\d:2\d:1\d$)/}); should_pass("1889-02-10T12:26:15", $type, 0); should_pass("1889-02-10T18:26:16", $type, 0); should_pass("1989-02-10T17:24:12", $type, 0); should_pass("1989-02-10T10:21:16", $type, 0); should_pass("1889-02-20T17:23:14", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d77-0\\d-0\\dT1\\d:\\d5:\\d5." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d77-0\d-0\dT1\d:\d5:\d5$)/}); should_pass("2077-02-04T11:05:35", $type, 0); should_pass("2077-02-04T14:15:25", $type, 0); should_pass("1777-03-02T13:15:15", $type, 0); should_pass("1877-02-07T11:25:55", $type, 0); should_pass("1977-04-01T13:35:05", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['2010-02-12T03:22:00','1972-11-27T20:41:04','2015-08-04T06:44:16','2011-05-07T03:49:38','2029-12-13T21:03:46','2029-04-19T14:21:30']}); should_pass("1972-11-27T20:41:04", $type, 0); should_pass("2029-04-19T14:21:30", $type, 0); should_pass("2029-12-13T21:03:46", $type, 0); should_pass("1972-11-27T20:41:04", $type, 0); should_pass("2010-02-12T03:22:00", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['2016-12-24T10:20:27','2013-04-14T17:20:13','1997-07-18T03:59:37','2004-04-06T20:47:16','2024-07-02T09:44:13','1980-08-25T23:48:17']}); should_pass("1997-07-18T03:59:37", $type, 0); should_pass("2016-12-24T10:20:27", $type, 0); should_pass("2004-04-06T20:47:16", $type, 0); should_pass("1980-08-25T23:48:17", $type, 0); should_pass("1980-08-25T23:48:17", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['1978-10-23T05:45:02','1985-02-19T04:06:18','2019-08-14T05:07:30','2030-09-14T23:19:53','2000-08-25T10:14:42','1975-03-11T11:29:35','2019-01-15T02:01:47','1977-04-10T16:52:34','1996-03-21T14:27:49']}); should_pass("1975-03-11T11:29:35", $type, 0); should_pass("1977-04-10T16:52:34", $type, 0); should_pass("2030-09-14T23:19:53", $type, 0); should_pass("2019-01-15T02:01:47", $type, 0); should_pass("1975-03-11T11:29:35", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['2000-08-27T05:34:53','1999-01-22T23:05:35','2018-02-02T20:25:48','1990-10-27T15:40:41','1989-06-12T23:17:57','2019-11-24T15:12:13','2011-02-13T13:12:56','1975-03-26T02:01:19']}); should_pass("2018-02-02T20:25:48", $type, 0); should_pass("2018-02-02T20:25:48", $type, 0); should_pass("2019-11-24T15:12:13", $type, 0); should_pass("2000-08-27T05:34:53", $type, 0); should_pass("1999-01-22T23:05:35", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['1990-01-04T22:40:05','2011-07-27T05:09:10','1996-12-01T14:47:04','1998-08-05T19:34:41','1989-04-17T09:42:01','1980-08-05T22:54:49']}); should_pass("1989-04-17T09:42:01", $type, 0); should_pass("1996-12-01T14:47:04", $type, 0); should_pass("1996-12-01T14:47:04", $type, 0); should_pass("1989-04-17T09:42:01", $type, 0); should_pass("2011-07-27T05:09:10", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('DateTime', {'whiteSpace' => 'collapse'}); should_pass("1970-01-01T00:00:00", $type, 0); should_pass("1986-07-08T16:33:18", $type, 0); should_pass("1989-05-06T16:03:34", $type, 0); should_pass("2009-06-16T02:15:50", $type, 0); should_pass("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 1995-07-23T18:55:18." => sub { my $type = mk_type('DateTime', {'minInclusive' => '1995-07-23T18:55:18'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1977-04-04T01:57:42", $type, 0); should_fail("1979-12-22T00:46:29", $type, 0); should_fail("1970-07-17T19:04:58", $type, 0); should_fail("1995-07-23T18:55:17", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 2020-05-11T02:01:37." => sub { my $type = mk_type('DateTime', {'minInclusive' => '2020-05-11T02:01:37'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1975-10-25T04:00:55", $type, 0); should_fail("1979-10-18T13:55:12", $type, 0); should_fail("1991-09-25T05:46:39", $type, 0); should_fail("2020-05-11T02:01:36", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 2007-02-14T09:11:44." => sub { my $type = mk_type('DateTime', {'minInclusive' => '2007-02-14T09:11:44'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1988-09-17T06:02:09", $type, 0); should_fail("1983-07-27T21:54:26", $type, 0); should_fail("2000-08-26T12:38:57", $type, 0); should_fail("2007-02-14T09:11:43", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 2003-12-13T22:56:59." => sub { my $type = mk_type('DateTime', {'minInclusive' => '2003-12-13T22:56:59'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1974-07-12T22:32:41", $type, 0); should_fail("1973-08-11T15:28:10", $type, 0); should_fail("1994-06-27T22:33:39", $type, 0); should_fail("2003-12-13T22:56:58", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minInclusive with value 2030-12-31T23:59:59." => sub { my $type = mk_type('DateTime', {'minInclusive' => '2030-12-31T23:59:59'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1985-09-29T04:34:41", $type, 0); should_fail("1984-09-17T22:13:04", $type, 0); should_fail("2002-11-08T07:18:24", $type, 0); should_fail("2030-12-31T23:59:58", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 1970-01-01T00:00:00." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '1970-01-01T00:00:00'}); should_fail("1970-01-01T00:00:01", $type, 0); should_fail("1978-11-22T17:37:16", $type, 0); should_fail("1975-09-30T17:03:00", $type, 0); should_fail("1989-06-27T18:42:04", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 1994-02-25T03:11:05." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '1994-02-25T03:11:05'}); should_fail("1994-02-25T03:11:06", $type, 0); should_fail("1996-08-18T07:44:57", $type, 0); should_fail("1999-07-22T13:11:01", $type, 0); should_fail("2005-04-11T16:31:40", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 1979-10-05T09:19:23." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '1979-10-05T09:19:23'}); should_fail("1979-10-05T09:19:24", $type, 0); should_fail("2003-04-10T16:45:22", $type, 0); should_fail("2020-10-15T19:51:38", $type, 0); should_fail("1984-06-25T08:40:37", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 2010-06-21T08:46:41." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '2010-06-21T08:46:41'}); should_fail("2010-06-21T08:46:42", $type, 0); should_fail("2019-10-25T02:13:37", $type, 0); should_fail("2023-07-02T01:50:00", $type, 0); should_fail("2027-01-03T05:59:32", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxInclusive with value 2014-02-07T21:55:18." => sub { my $type = mk_type('DateTime', {'maxInclusive' => '2014-02-07T21:55:18'}); should_fail("2014-02-07T21:55:19", $type, 0); should_fail("2024-12-06T20:15:18", $type, 0); should_fail("2016-11-03T15:51:28", $type, 0); should_fail("2028-11-30T22:31:00", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 1970-01-01T00:00:00." => sub { my $type = mk_type('DateTime', {'minExclusive' => '1970-01-01T00:00:00'}); should_fail("1970-01-01T00:00:00", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 1972-03-14T12:38:28." => sub { my $type = mk_type('DateTime', {'minExclusive' => '1972-03-14T12:38:28'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1971-02-24T22:57:40", $type, 0); should_fail("1970-09-23T02:03:55", $type, 0); should_fail("1970-03-18T11:34:06", $type, 0); should_fail("1972-03-14T12:38:28", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 1985-09-09T17:03:02." => sub { my $type = mk_type('DateTime', {'minExclusive' => '1985-09-09T17:03:02'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1983-03-07T07:44:54", $type, 0); should_fail("1978-10-06T11:31:46", $type, 0); should_fail("1976-05-07T04:41:18", $type, 0); should_fail("1985-09-09T17:03:02", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 2010-03-03T22:44:36." => sub { my $type = mk_type('DateTime', {'minExclusive' => '2010-03-03T22:44:36'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1989-01-16T17:14:43", $type, 0); should_fail("1994-06-18T01:00:17", $type, 0); should_fail("1992-01-01T10:34:42", $type, 0); should_fail("2010-03-03T22:44:36", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet minExclusive with value 2030-12-31T23:59:58." => sub { my $type = mk_type('DateTime', {'minExclusive' => '2030-12-31T23:59:58'}); should_fail("1970-01-01T00:00:00", $type, 0); should_fail("1997-03-24T19:39:12", $type, 0); should_fail("2030-12-14T12:32:08", $type, 0); should_fail("2005-11-16T03:56:15", $type, 0); should_fail("2030-12-31T23:59:58", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 1970-01-01T00:00:01." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '1970-01-01T00:00:01'}); should_fail("1970-01-01T00:00:01", $type, 0); should_fail("2001-05-23T02:51:50", $type, 0); should_fail("2005-07-15T12:00:28", $type, 0); should_fail("1974-01-23T08:30:04", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 2005-05-16T14:28:30." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '2005-05-16T14:28:30'}); should_fail("2005-05-16T14:28:30", $type, 0); should_fail("2027-09-25T09:41:07", $type, 0); should_fail("2022-05-24T20:55:16", $type, 0); should_fail("2014-09-07T05:28:34", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 1999-05-23T06:56:49." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '1999-05-23T06:56:49'}); should_fail("1999-05-23T06:56:49", $type, 0); should_fail("2024-10-19T18:04:30", $type, 0); should_fail("2028-11-25T19:57:00", $type, 0); should_fail("2002-08-27T20:38:39", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 2025-12-09T05:41:30." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '2025-12-09T05:41:30'}); should_fail("2025-12-09T05:41:30", $type, 0); should_fail("2030-05-04T05:09:58", $type, 0); should_fail("2030-03-08T03:03:10", $type, 0); should_fail("2029-02-02T06:32:37", $type, 0); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet maxExclusive with value 2030-12-31T23:59:59." => sub { my $type = mk_type('DateTime', {'maxExclusive' => '2030-12-31T23:59:59'}); should_fail("2030-12-31T23:59:59", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d69-\\d9-\\d9T\\d8:\\d1:3\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d69-\d9-\d9T\d8:\d1:3\d$)/}); should_fail("1804-03-13T14:44:07", $type, 0); should_fail("1857-04-20T12:48:24", $type, 0); should_fail("1844-06-17T11:28:01", $type, 0); should_fail("1837-02-13T03:46:42", $type, 0); should_fail("2053-07-20T14:07:26", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d94-\\d9-\\d7T1\\d:0\\d:0\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d94-\d9-\d7T1\d:0\d:0\d$)/}); should_fail("1900-01-15T27:42:43", $type, 0); should_fail("1860-07-20T47:29:29", $type, 0); should_fail("1945-05-01T23:30:29", $type, 0); should_fail("1915-04-22T37:37:17", $type, 0); should_fail("1852-03-12T02:26:41", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value 20\\d\\d-\\d8-\\d5T\\d1:\\d1:0\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^20\d\d-\d8-\d5T\d1:\d1:0\d$)/}); should_fail("1870-07-17T16:19:31", $type, 0); should_fail("1853-05-24T07:12:41", $type, 0); should_fail("1886-04-20T06:27:46", $type, 0); should_fail("1890-05-16T15:52:42", $type, 0); should_fail("1784-01-12T19:18:16", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d58-\\d2-2\\dT0\\d:1\\d:3\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d58-\d2-2\dT0\d:1\d:3\d$)/}); should_fail("2088-09-01T58:01:14", $type, 0); should_fail("1822-04-03T48:25:22", $type, 0); should_fail("2045-05-17T25:35:03", $type, 0); should_fail("1984-06-12T22:54:26", $type, 0); should_fail("1757-07-03T24:21:49", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet pattern with value \\d\\d59-\\d3-\\d4T1\\d:\\d9:3\\d." => sub { my $type = mk_type('DateTime', {'pattern' => qr/(?ms:^\d\d59-\d3-\d4T1\d:\d9:3\d$)/}); should_fail("1915-09-15T04:17:25", $type, 0); should_fail("2080-04-01T02:55:00", $type, 0); should_fail("1773-02-07T22:02:16", $type, 0); should_fail("1928-08-16T05:10:23", $type, 0); should_fail("1821-05-26T40:44:50", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['1997-12-16T22:31:40','2024-07-08T09:19:42','1978-03-14T10:09:23','2017-06-20T05:24:09','1991-02-19T22:13:31','1983-02-06T22:19:51']}); should_fail("1982-04-07T08:02:06", $type, 0); should_fail("2011-07-06T00:53:58", $type, 0); should_fail("1988-07-25T00:53:54", $type, 0); should_fail("1980-08-23T16:18:42", $type, 0); should_fail("2005-08-30T12:44:12", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['1990-03-02T16:40:09','1994-04-25T04:42:21','1994-07-25T18:36:49','1996-12-08T17:57:34','2030-09-16T14:55:48','2029-07-09T10:05:42','2016-02-08T16:25:13','1987-11-01T04:17:26','1995-01-25T03:42:52','1996-04-12T03:42:54']}); should_fail("2019-01-01T06:19:23", $type, 0); should_fail("1988-11-25T10:48:28", $type, 0); should_fail("2005-11-03T19:40:14", $type, 0); should_fail("1983-10-29T00:26:08", $type, 0); should_fail("2024-06-30T20:10:04", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['2014-01-28T18:33:05','1994-11-11T22:16:25','2023-05-20T07:09:40','2029-02-22T18:22:38','1992-03-27T14:40:18','2009-05-13T08:53:45','2021-01-11T20:06:41','1985-02-24T23:46:33','1993-11-23T09:47:43']}); should_fail("2028-06-22T03:58:25", $type, 0); should_fail("2014-06-11T03:26:09", $type, 0); should_fail("1983-09-29T15:42:36", $type, 0); should_fail("2027-11-04T16:09:15", $type, 0); should_fail("2007-08-29T05:30:08", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['2016-10-14T16:26:22','1970-09-08T21:09:47','1997-01-26T13:30:30','2005-05-13T17:33:47','2029-09-17T03:28:03','2008-12-05T15:31:29','1997-07-19T02:18:36','2017-12-26T05:57:53','2023-02-01T12:53:10']}); should_fail("1990-06-06T11:43:20", $type, 0); should_fail("1979-10-08T13:20:30", $type, 0); should_fail("2013-09-21T12:11:08", $type, 0); should_fail("1973-03-15T16:34:41", $type, 0); should_fail("2009-06-03T05:27:26", $type, 0); done_testing; }; subtest "Type atomic/dateTime is restricted by facet enumeration." => sub { my $type = mk_type('DateTime', {'enumeration' => ['2026-01-13T22:29:02','1977-04-29T10:22:43','1984-02-02T17:09:49','1971-10-20T08:53:35','2022-01-16T21:19:09','2005-12-05T00:58:08','1970-10-30T16:36:45','1975-10-01T17:36:14','1990-08-28T16:51:38']}); should_fail("2017-04-19T00:44:12", $type, 0); should_fail("2010-12-29T10:32:23", $type, 0); should_fail("1984-02-20T04:39:36", $type, 0); should_fail("2025-05-15T02:29:24", $type, 0); should_fail("2012-10-19T23:46:22", $type, 0); done_testing; }; done_testing; 50decimal.t000664001750001750 10000212404317273 14304 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/decimal is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('Decimal', {'minExclusive' => '-999999999999999999'}); should_pass("-999999999999999998", $type, 0); should_pass("743242983065211192", $type, 0); should_pass("-298277777844702550", $type, 0); should_pass("-489622089249996726", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value 631308414640570968." => sub { my $type = mk_type('Decimal', {'minExclusive' => '631308414640570968'}); should_pass("631308414640570969", $type, 0); should_pass("655270940327769770", $type, 0); should_pass("633688260227604501", $type, 0); should_pass("724204691061185475", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value -67428259604688900." => sub { my $type = mk_type('Decimal', {'minExclusive' => '-67428259604688900'}); should_pass("-67428259604688899.9", $type, 0); should_pass("964512941415486691.7", $type, 0); should_pass("929574180872636469.1", $type, 0); should_pass("10009076448161849.4", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value -294253147230818967." => sub { my $type = mk_type('Decimal', {'minExclusive' => '-294253147230818967'}); should_pass("-294253147230818966", $type, 0); should_pass("42621829743492400", $type, 0); should_pass("778328217399065823", $type, 0); should_pass("303014161192265037", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('Decimal', {'minExclusive' => '999999999999999998'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value -999999999999999999." => sub { my $type = mk_type('Decimal', {'minInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-479965255856956706", $type, 0); should_pass("870254101268362444", $type, 0); should_pass("934935134052641058", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 229822855408968073." => sub { my $type = mk_type('Decimal', {'minInclusive' => '229822855408968073'}); should_pass("229822855408968073", $type, 0); should_pass("583563079235933449", $type, 0); should_pass("693743199641761298", $type, 0); should_pass("877108449600715506", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value -785368448026986020." => sub { my $type = mk_type('Decimal', {'minInclusive' => '-785368448026986020'}); should_pass("-785368448026986020", $type, 0); should_pass("-286947689254679556", $type, 0); should_pass("126998522279017820", $type, 0); should_pass("-119719541893928025", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 325207740352921658." => sub { my $type = mk_type('Decimal', {'minInclusive' => '325207740352921658'}); should_pass("325207740352921658", $type, 0); should_pass("707562012596744786", $type, 0); should_pass("748498012179183663", $type, 0); should_pass("330318245307241752", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('Decimal', {'minInclusive' => '999999999999999999'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '-999999999999999998'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value 78119693427168402." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '78119693427168402'}); should_pass("-999999999999999999", $type, 0); should_pass("-96490893692868357.6", $type, 0); should_pass("-755590101850159647.2", $type, 0); should_pass("-5141080192436564.5", $type, 0); should_pass("78119693427168401.9", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value 171942968603657986." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '171942968603657986'}); should_pass("-999999999999999999", $type, 0); should_pass("-949549894722090902", $type, 0); should_pass("-322109878631769832", $type, 0); should_pass("-879600105740250893", $type, 0); should_pass("171942968603657985", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value -214771926190724381." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '-214771926190724381'}); should_pass("-999999999999999999", $type, 0); should_pass("-673138182227871496", $type, 0); should_pass("-790816317239260538", $type, 0); should_pass("-771501840474373263", $type, 0); should_pass("-214771926190724382", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-898677092665433495", $type, 0); should_pass("-811125566986646839", $type, 0); should_pass("252077093927926209", $type, 0); should_pass("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value 625897845365533055." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '625897845365533055'}); should_pass("-999999999999999999", $type, 0); should_pass("-904949153608526819", $type, 0); should_pass("89736250999809495", $type, 0); should_pass("316378507306027046", $type, 0); should_pass("625897845365533055", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value -888403528420030673." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '-888403528420030673'}); should_pass("-999999999999999999", $type, 0); should_pass("-892559497148452709", $type, 0); should_pass("-963657554932478572", $type, 0); should_pass("-931230510007482365", $type, 0); should_pass("-888403528420030673", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value -95776055693671313." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '-95776055693671313'}); should_pass("-999999999999999999", $type, 0); should_pass("-286380458379470656", $type, 0); should_pass("-461116417455741628", $type, 0); should_pass("-561010407438011614", $type, 0); should_pass("-95776055693671313", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value 999999999999999999." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-868387287908872983", $type, 0); should_pass("-58200625491938273", $type, 0); should_pass("-77940022604026548", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("99137122271968136", $type, 0); should_pass("-256179772521919035", $type, 0); should_pass("794953751044983335", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 4." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '4'}); should_pass("123456789123456789", $type, 0); should_pass("12345678912345678.9", $type, 0); should_pass("1234567891234567.89", $type, 0); should_pass("123456789123456.789", $type, 0); should_pass("12345678912345.6789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 8." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '8'}); should_pass("123456789123456789", $type, 0); should_pass("1234567891234567.89", $type, 0); should_pass("12345678912345.6789", $type, 0); should_pass("123456789123.456789", $type, 0); should_pass("1234567891.23456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 12." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '12'}); should_pass("123456789123456789", $type, 0); should_pass("123456789123456.789", $type, 0); should_pass("123456789123.456789", $type, 0); should_pass("123456789.123456789", $type, 0); should_pass("123456.789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 18." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '18'}); should_pass("123456789123456789", $type, 0); should_pass("12345678912345.6789", $type, 0); should_pass("1234567891.23456789", $type, 0); should_pass("123456.789123456789", $type, 0); should_pass(".123456789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Decimal', {'totalDigits' => '1'}); should_pass("9", $type, 0); should_pass("7", $type, 0); should_pass("9", $type, 0); should_pass("1", $type, 0); should_pass("8", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('Decimal', {'totalDigits' => '5'}); should_pass("3", $type, 0); should_pass("82", $type, 0); should_pass("513", $type, 0); should_pass("5330", $type, 0); should_pass("17254", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('Decimal', {'totalDigits' => '9'}); should_pass("2", $type, 0); should_pass("353", $type, 0); should_pass("95326", $type, 0); should_pass("2513421", $type, 0); should_pass("581216683", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('Decimal', {'totalDigits' => '13'}); should_pass("9", $type, 0); should_pass("5514", $type, 0); should_pass("1524616", $type, 0); should_pass("8864756997", $type, 0); should_pass("8178688412222", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('Decimal', {'totalDigits' => '18'}); should_pass("4", $type, 0); should_pass("82757", $type, 0); should_pass("321149124", $type, 0); should_pass("4303115591742", $type, 0); should_pass("526575824825222369", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("3", $type, 0); should_pass("2", $type, 0); should_pass("2", $type, 0); should_pass("4", $type, 0); should_pass("9", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\-\\d{2}\\.\\d{3}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\-\d{2}\.\d{3}$)/}); should_pass("-24.547", $type, 0); should_pass("-65.424", $type, 0); should_pass("-31.228", $type, 0); should_pass("-46.582", $type, 0); should_pass("-12.216", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\-\\d{1}\\.\\d{8}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\-\d{1}\.\d{8}$)/}); should_pass("-7.48951421", $type, 0); should_pass("-4.34531931", $type, 0); should_pass("-7.37470534", $type, 0); should_pass("-4.58314140", $type, 0); should_pass("-7.73893515", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\.\\d{13}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\.\d{13}$)/}); should_pass(".2684842045582", $type, 0); should_pass(".1165417431543", $type, 0); should_pass(".1055532252427", $type, 0); should_pass(".2338485411688", $type, 0); should_pass(".7974769556356", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\d{5}\\.\\d{13}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\d{5}\.\d{13}$)/}); should_pass("55217.9736118850526", $type, 0); should_pass("16876.8783301171042", $type, 0); should_pass("11416.7935261225030", $type, 0); should_pass("67916.2046755544972", $type, 0); should_pass("67535.5493283257017", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['0.774','885368.72','8.63882452','-0.92','549.95','-1914.0']}); should_pass("8.63882452", $type, 0); should_pass("-0.92", $type, 0); should_pass("-1914.0", $type, 0); should_pass("8.63882452", $type, 0); should_pass("549.95", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['89.20902289982400','729089.6','108747.8431','89.98169071278','8.843008676','7.682949472786','31588397646362.1','-61113534938.0','0.575']}); should_pass("-61113534938.0", $type, 0); should_pass("729089.6", $type, 0); should_pass("0.575", $type, 0); should_pass("7.682949472786", $type, 0); should_pass("89.20902289982400", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['840','-584.55228','-97585886185','0.672','-75.62365','-7.335','0.86054905','-5439.8474996']}); should_pass("-97585886185", $type, 0); should_pass("-7.335", $type, 0); should_pass("0.672", $type, 0); should_pass("0.672", $type, 0); should_pass("-5439.8474996", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['613.87','1906433845.89','-2.39446916113','-5286034.1','8838363181.0150']}); should_pass("613.87", $type, 0); should_pass("-2.39446916113", $type, 0); should_pass("613.87", $type, 0); should_pass("1906433845.89", $type, 0); should_pass("1906433845.89", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['856.89','6.9307231814179','-150','337920.941','0.3316','-82.78605057','-0.61']}); should_pass("-82.78605057", $type, 0); should_pass("0.3316", $type, 0); should_pass("337920.941", $type, 0); should_pass("0.3316", $type, 0); should_pass("-150", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Decimal', {'whiteSpace' => 'collapse'}); should_pass("-999999999999999999", $type, 0); should_pass("208837336784347682", $type, 0); should_pass("831121983923768014", $type, 0); should_pass("463294725437835008", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 46766021207033325." => sub { my $type = mk_type('Decimal', {'minInclusive' => '46766021207033325'}); should_fail("-999999999999999999", $type, 0); should_fail("-82035416317982814.9", $type, 0); should_fail("-116283630323041617.3", $type, 0); should_fail("-507102669884162774.8", $type, 0); should_fail("46766021207033324.9", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 217527397529179155." => sub { my $type = mk_type('Decimal', {'minInclusive' => '217527397529179155'}); should_fail("-999999999999999999", $type, 0); should_fail("-642389304015569471", $type, 0); should_fail("194432658843846068", $type, 0); should_fail("-320930938798775041", $type, 0); should_fail("217527397529179154", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value -484062845034851418." => sub { my $type = mk_type('Decimal', {'minInclusive' => '-484062845034851418'}); should_fail("-999999999999999999", $type, 0); should_fail("-744312015684597677", $type, 0); should_fail("-798318711162899803", $type, 0); should_fail("-756444991985341836", $type, 0); should_fail("-484062845034851419", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 913110463857996767." => sub { my $type = mk_type('Decimal', {'minInclusive' => '913110463857996767'}); should_fail("-999999999999999999", $type, 0); should_fail("219067290813932176", $type, 0); should_fail("476222585470221001", $type, 0); should_fail("-977179111791051587", $type, 0); should_fail("913110463857996766", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('Decimal', {'minInclusive' => '999999999999999999'}); should_fail("-999999999999999999", $type, 0); should_fail("948164537304475361", $type, 0); should_fail("347408282265509792", $type, 0); should_fail("-213987886304789709", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '-999999999999999999'}); should_fail("-999999999999999998", $type, 0); should_fail("704874057733450020", $type, 0); should_fail("209113495339849242", $type, 0); should_fail("833990441992082941", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value 334974685437745555." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '334974685437745555'}); should_fail("334974685437745556", $type, 0); should_fail("854169634314423861", $type, 0); should_fail("573806945776759695", $type, 0); should_fail("807371345967442368", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value -873150926158042127." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '-873150926158042127'}); should_fail("-873150926158042126", $type, 0); should_fail("305728505095716730", $type, 0); should_fail("-283733388508344998", $type, 0); should_fail("917584284119832151", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value -276828978495828214." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '-276828978495828214'}); should_fail("-276828978495828213", $type, 0); should_fail("-168341274308303273", $type, 0); should_fail("-55137136585436293", $type, 0); should_fail("468581798712038836", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxInclusive with value 187840545667389724." => sub { my $type = mk_type('Decimal', {'maxInclusive' => '187840545667389724'}); should_fail("187840545667389725", $type, 0); should_fail("339229216664273730", $type, 0); should_fail("934076830476541443", $type, 0); should_fail("983589035502023346", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '0'}); should_fail("12345678912345678.9", $type, 0); should_fail("1234567891234.56789", $type, 0); should_fail("123456789.123456789", $type, 0); should_fail("12345.6789123456789", $type, 0); should_fail(".123456789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 3." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '3'}); should_fail("12345678912345.6789", $type, 0); should_fail("12345678912.3456789", $type, 0); should_fail("12345678.9123456789", $type, 0); should_fail("12345.6789123456789", $type, 0); should_fail(".123456789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 6." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '6'}); should_fail("12345678912.3456789", $type, 0); should_fail("123456789.123456789", $type, 0); should_fail("1234567.89123456789", $type, 0); should_fail("12345.6789123456789", $type, 0); should_fail(".123456789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 9." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '9'}); should_fail("12345678.9123456789", $type, 0); should_fail("123456.789123456789", $type, 0); should_fail("1234.56789123456789", $type, 0); should_fail("12.3456789123456789", $type, 0); should_fail(".123456789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet fractionDigits with value 12." => sub { my $type = mk_type('Decimal', {'fractionDigits' => '12'}); should_fail("12345.6789123456789", $type, 0); should_fail("1234.56789123456789", $type, 0); should_fail("123.456789123456789", $type, 0); should_fail("12.3456789123456789", $type, 0); should_fail(".123456789123456789", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Decimal', {'totalDigits' => '1'}); should_fail("61", $type, 0); should_fail("777054", $type, 0); should_fail("3113816699", $type, 0); should_fail("61315691291273", $type, 0); should_fail("354128147257253653", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('Decimal', {'totalDigits' => '4'}); should_fail("28265", $type, 0); should_fail("85558005", $type, 0); should_fail("70552163453", $type, 0); should_fail("17566155886475", $type, 0); should_fail("692412876221863375", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('Decimal', {'totalDigits' => '7'}); should_fail("16365494", $type, 0); should_fail("2968213192", $type, 0); should_fail("470843264218", $type, 0); should_fail("12171827714185", $type, 0); should_fail("426453427863172041", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('Decimal', {'totalDigits' => '10'}); should_fail("18747415133", $type, 0); should_fail("111010154613", $type, 0); should_fail("8568256181607", $type, 0); should_fail("34732211933321", $type, 0); should_fail("338610360158571185", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('Decimal', {'totalDigits' => '13'}); should_fail("18521730524616", $type, 0); should_fail("178163458326868", $type, 0); should_fail("3921554721062893", $type, 0); should_fail("21558713367427384", $type, 0); should_fail("373687644748891316", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('Decimal', {'minExclusive' => '-999999999999999999'}); should_fail("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value -742667420521034182." => sub { my $type = mk_type('Decimal', {'minExclusive' => '-742667420521034182'}); should_fail("-999999999999999999", $type, 0); should_fail("-873668702595663188", $type, 0); should_fail("-875371982501205708", $type, 0); should_fail("-746298922746964699", $type, 0); should_fail("-742667420521034182", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value -990296746466916787." => sub { my $type = mk_type('Decimal', {'minExclusive' => '-990296746466916787'}); should_fail("-999999999999999999", $type, 0); should_fail("-994232159881783270", $type, 0); should_fail("-990366049657691773", $type, 0); should_fail("-994038375252986787", $type, 0); should_fail("-990296746466916787", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value 604887570436412057." => sub { my $type = mk_type('Decimal', {'minExclusive' => '604887570436412057'}); should_fail("-999999999999999999", $type, 0); should_fail("587916849690211326", $type, 0); should_fail("-505435956225881732", $type, 0); should_fail("-362094017196074591", $type, 0); should_fail("604887570436412057", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('Decimal', {'minExclusive' => '999999999999999998'}); should_fail("-999999999999999999", $type, 0); should_fail("990234289529774656", $type, 0); should_fail("-168010106926399727", $type, 0); should_fail("-758263458208696671", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '-999999999999999998'}); should_fail("-999999999999999998", $type, 0); should_fail("-735099782760447738", $type, 0); should_fail("-701067706877750217", $type, 0); should_fail("563399700388934165", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value -407946586294197554." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '-407946586294197554'}); should_fail("-407946586294197554", $type, 0); should_fail("170561410536352337", $type, 0); should_fail("834811255246798541", $type, 0); should_fail("263175454538351659", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value -663400175032719417." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '-663400175032719417'}); should_fail("-663400175032719417", $type, 0); should_fail("281117135260569906", $type, 0); should_fail("-341239977425938983", $type, 0); should_fail("-53150907639494195", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value -491326681056714730." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '-491326681056714730'}); should_fail("-491326681056714730", $type, 0); should_fail("449964112725542981", $type, 0); should_fail("781090115734859921", $type, 0); should_fail("248281740579833699", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('Decimal', {'maxExclusive' => '999999999999999999'}); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("33485.142484370", $type, 0); should_fail("22277333688275456.1", $type, 0); should_fail("533.47561744", $type, 0); should_fail("-32143132.775", $type, 0); should_fail("583.07", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\d{1}\\.\\d{4}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\d{1}\.\d{4}$)/}); should_fail("-8554.601982", $type, 0); should_fail("944224585854343587", $type, 0); should_fail("421252945.60641372", $type, 0); should_fail("75538277749.623", $type, 0); should_fail("866392.8623164201", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\-\\d{5}\\.\\d{4}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\-\d{5}\.\d{4}$)/}); should_fail("2978258.516875716", $type, 0); should_fail("-3333144481863.7", $type, 0); should_fail("5976326.11677485", $type, 0); should_fail("559.5603990704", $type, 0); should_fail("-642.26405", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\d{10}\\.\\d{3}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\d{10}\.\d{3}$)/}); should_fail("-84225859357429657.5", $type, 0); should_fail("844382745.346644", $type, 0); should_fail("-85.56736916122194", $type, 0); should_fail("4.2536055668381", $type, 0); should_fail("463434.957553725", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet pattern with value \\-\\d{17}\\.\\d{1}." => sub { my $type = mk_type('Decimal', {'pattern' => qr/(?ms:^\-\d{17}\.\d{1}$)/}); should_fail("222935976.00581813", $type, 0); should_fail("4763.344745968", $type, 0); should_fail("-41338645.5464910", $type, 0); should_fail("2589394455884.5340", $type, 0); should_fail("-5388.7212686", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['37.3299','538557030.40878244','5784970.9','-427178192921.58787','-21.68136395279','-57647479233521647','693700.4405008','4.6311217','3.7','-3073.80']}); should_fail("-502354523120606799", $type, 0); should_fail("221533348282852537", $type, 0); should_fail("-853805601507541477", $type, 0); should_fail("-433480763327352080", $type, 0); should_fail("124650441041409543", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['832.6061','-644441.60','-43.9537851','-3.6993897','-935734286.436217144','5386.68991312147','2205242375326.127']}); should_fail("-408689031972378824", $type, 0); should_fail("-106409202240518085", $type, 0); should_fail("-769651937952429587", $type, 0); should_fail("772891982319434011", $type, 0); should_fail("-755901886467195138", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['304640092.2488','7081563.27','2564389.772','-4141.50462135505','-358827.0','-153426.61','5.150156720404','-0.7144']}); should_fail("177925645621303640", $type, 0); should_fail("-965869140580617234", $type, 0); should_fail("-795893491728559609", $type, 0); should_fail("-815977366399654568", $type, 0); should_fail("87705392143277105", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['-10.5985919','620.809990','454134390717.3','35','-525268.515823','-7827798518.104','-1293739.34']}); should_fail("13775870503200948", $type, 0); should_fail("-38941978700236967", $type, 0); should_fail("-707626978704362529", $type, 0); should_fail("13775870503200948", $type, 0); should_fail("-587995474964697616", $type, 0); done_testing; }; subtest "Type atomic/decimal is restricted by facet enumeration." => sub { my $type = mk_type('Decimal', {'enumeration' => ['-328074519.2','-16250.3','-198.9','2.82436570042079448','927.15']}); should_fail("359155983938342026", $type, 0); should_fail("319004331918121497", $type, 0); should_fail("748689826255232170", $type, 0); should_fail("125609983152650927", $type, 0); should_fail("-888196266682436784", $type, 0); done_testing; }; done_testing; 50double.t000664001750001750 2465112404317273 14157 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/double is restricted by facet pattern with value \\d{1}E\\-\\d{3}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}E\-\d{3}$)/}); should_pass("4E-289", $type, 0); should_pass("3E-238", $type, 0); should_pass("2E-173", $type, 0); should_pass("2E-153", $type, 0); should_pass("3E-137", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{4}E\\-\\d{2}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{4}E\-\d{2}$)/}); should_pass("5.2185E-22", $type, 0); should_pass("4.3272E-51", $type, 0); should_pass("3.1138E-51", $type, 0); should_pass("8.3266E-55", $type, 0); should_pass("8.3968E-76", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{8}E\\-\\d{1}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{8}E\-\d{1}$)/}); should_pass("4.54918975E-8", $type, 0); should_pass("9.82585255E-8", $type, 0); should_pass("7.42727726E-4", $type, 0); should_pass("6.83242786E-5", $type, 0); should_pass("8.34238582E-8", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{12}E\\d{1}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{12}E\d{1}$)/}); should_pass("4.319926813832E4", $type, 0); should_pass("4.462166867158E3", $type, 0); should_pass("4.642845497493E5", $type, 0); should_pass("8.388325397297E5", $type, 0); should_pass("3.693914247175E4", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{16}E\\d{3}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{16}E\d{3}$)/}); should_pass("8.9765779385971216E261", $type, 0); should_pass("6.8222841673422587E283", $type, 0); should_pass("4.9578685246487246E116", $type, 0); should_pass("7.9774272498493962E262", $type, 0); should_pass("5.2646546428267367E153", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','2.2133245030541942E-234','2.2871337380701436E-144','4.8330246595957178E-54','3.5861613937406181E36','2.7457332729808998E126','2.8407030485906319E216','1.7976931348623157E308']}); should_pass("3.5861613937406181E36", $type, 0); should_pass("2.8407030485906319E216", $type, 0); should_pass("4.9E-324", $type, 0); should_pass("4.9E-324", $type, 0); should_pass("2.8407030485906319E216", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','4.8523411539849754E-234','2.8869019830516350E-144','3.3925700348046903E-54','2.7311892445441031E36','2.9181385291440688E126','2.4983147023924484E216','1.7976931348623157E308']}); should_pass("2.4983147023924484E216", $type, 0); should_pass("2.9181385291440688E126", $type, 0); should_pass("2.7311892445441031E36", $type, 0); should_pass("2.9181385291440688E126", $type, 0); should_pass("4.8523411539849754E-234", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','3.0828824769404266E-234','2.4426721708407727E-144','3.3142672291800245E-54','2.1028238996196812E36','2.5674850917565879E126','4.6505307100535510E216','1.7976931348623157E308']}); should_pass("4.6505307100535510E216", $type, 0); should_pass("2.4426721708407727E-144", $type, 0); should_pass("2.1028238996196812E36", $type, 0); should_pass("3.3142672291800245E-54", $type, 0); should_pass("4.6505307100535510E216", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','1.9543492578327128E-234','4.6337466732941437E-144','4.2180257301126178E-54','2.0744434746534796E36','4.3411284761058989E126','3.4043189586904751E216','1.7976931348623157E308']}); should_pass("4.3411284761058989E126", $type, 0); should_pass("2.0744434746534796E36", $type, 0); should_pass("3.4043189586904751E216", $type, 0); should_pass("4.3411284761058989E126", $type, 0); should_pass("4.9E-324", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','2.7409799988042133E-219','3.6407481234147934E-114','2.0102746771275176E-9','2.8428374096671001E96','4.6999860123584760E201','1.7976931348623157E308']}); should_pass("2.0102746771275176E-9", $type, 0); should_pass("4.6999860123584760E201", $type, 0); should_pass("2.7409799988042133E-219", $type, 0); should_pass("2.0102746771275176E-9", $type, 0); should_pass("2.8428374096671001E96", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Double', {'whiteSpace' => 'collapse'}); should_pass("-INF", $type, 0); should_pass("-1.7976931348623157E308", $type, 0); should_pass("-4.5400409861528464E150", $type, 0); should_pass("-2.4656082617219581E-8", $type, 0); should_pass("-2.4465657314964493E-166", $type, 0); should_pass("-4.9E-324", $type, 0); should_pass("-0", $type, 0); should_pass("0", $type, 0); should_pass("4.9E-324", $type, 0); should_pass("3.9962074390640384E-166", $type, 0); should_pass("4.7083935269121063E-8", $type, 0); should_pass("4.7439793877361399E150", $type, 0); should_pass("1.7976931348623157E308", $type, 0); should_pass("INF", $type, 0); should_pass("NaN", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}E\\-\\d{3}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}E\-\d{3}$)/}); should_fail("3E6", $type, 0); should_fail("1E-12", $type, 0); should_fail("5E-47", $type, 0); should_fail("7E36", $type, 0); should_fail("5E-42", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{4}E\\-\\d{2}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{4}E\-\d{2}$)/}); should_fail("5.532777422E-262", $type, 0); should_fail("4.84496778864735E7", $type, 0); should_fail("3.3664231457E-8", $type, 0); should_fail("5.39693584258676E139", $type, 0); should_fail("1.977777E-227", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{8}E\\-\\d{1}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{8}E\-\d{1}$)/}); should_fail("2.938778577292527E-112", $type, 0); should_fail("8.687E-228", $type, 0); should_fail("7.2552325433887758E57", $type, 0); should_fail("6.264672671344E55", $type, 0); should_fail("4.564652616398648E-53", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{12}E\\d{1}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{12}E\d{1}$)/}); should_fail("7.377E277", $type, 0); should_fail("7.44122758643E172", $type, 0); should_fail("5.37737654663E193", $type, 0); should_fail("9.253644E228", $type, 0); should_fail("3.61775E52", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet pattern with value \\d{1}\\.\\d{16}E\\d{3}." => sub { my $type = mk_type('Double', {'pattern' => qr/(?ms:^\d{1}\.\d{16}E\d{3}$)/}); should_fail("8.9396649815531E32", $type, 0); should_fail("7.2936652792E4", $type, 0); should_fail("3.5827872E2", $type, 0); should_fail("6.49517724E8", $type, 0); should_fail("9.953E7", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','2.9847235681660356E-219','2.4705585733094389E-114','2.8648830854472200E-9','3.6123848814665702E96','4.8249539413456660E201','1.7976931348623157E308']}); should_fail("-4.4342657606591980E-49", $type, 0); should_fail("3.7575966972397818E-198", $type, 0); should_fail("3.3981202785445614E201", $type, 0); should_fail("-1.7976931348623157E308", $type, 0); should_fail("-2.0203071715201305E119", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','4.3928576546766641E-234','3.3347484045339821E-144','2.2386392124584646E-54','3.8647439182760973E36','4.1209222777910337E126','3.7649749033120186E216','1.7976931348623157E308']}); should_fail("3.0290494958619612E-240", $type, 0); should_fail("4.6549602908266423E-303", $type, 0); should_fail("-3.1835210975897257E56", $type, 0); should_fail("2.9265667529149958E-282", $type, 0); should_fail("-2.7763292621557008E-70", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','4.0820793024851395E-245','3.8230588179392781E-166','2.6979669918834709E-87','2.0834987530951218E-8','1.8962326902306018E71','2.0638057320113563E150','2.0453110403825455E229','1.7976931348623157E308']}); should_fail("1.9833779215040069E96", $type, 0); should_fail("2.2670473638907323E-282", $type, 0); should_fail("-2.5987908015975612E-196", $type, 0); should_fail("3.4125183524111053E-135", $type, 0); should_fail("-1.8627286721557672E161", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','2.9770718680565462E-166','2.3503189286792878E-8','4.7144691099845778E150','1.7976931348623157E308']}); should_fail("-3.2497254652116023E14", $type, 0); should_fail("-3.9755079320248947E-112", $type, 0); should_fail("4.6005443625421961E-177", $type, 0); should_fail("-1.8167207834888545E-217", $type, 0); should_fail("3.2695765668213063E-261", $type, 0); done_testing; }; subtest "Type atomic/double is restricted by facet enumeration." => sub { my $type = mk_type('Double', {'enumeration' => ['4.9E-324','3.6799173280388714E-166','3.4791243588260355E-8','3.9190770335351561E150','1.7976931348623157E308']}); should_fail("-3.1145780814992152E-196", $type, 0); should_fail("2.8562046481936448E12", $type, 0); should_fail("-4.7955738439334855E182", $type, 0); should_fail("-4.9E-324", $type, 0); should_fail("1.9560810896697008E-240", $type, 0); done_testing; }; done_testing; 50duration.t000664001750001750 6770612404317273 14542 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/duration is restricted by facet minExclusive with value P1970Y01M01DT00H00M00S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P1970Y01M01DT00H00M00S'}); should_pass("P1970Y01M01DT00H00M01S", $type, 0); should_pass("P1997Y11M11DT15H19M36S", $type, 0); should_pass("P2024Y03M19DT10H24M27S", $type, 0); should_pass("P2001Y12M19DT16H30M37S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P2015Y06M12DT06H42M35S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P2015Y06M12DT06H42M35S'}); should_pass("P2015Y06M12DT06H42M36S", $type, 0); should_pass("P2024Y04M08DT18H43M25S", $type, 0); should_pass("P2028Y04M14DT22H36M57S", $type, 0); should_pass("P2026Y02M06DT14H13M13S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P2030Y05M22DT14H53M02S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P2030Y05M22DT14H53M02S'}); should_pass("P2030Y05M22DT14H53M03S", $type, 0); should_pass("P2030Y06M21DT17H53M15S", $type, 0); should_pass("P2030Y11M13DT15H22M10S", $type, 0); should_pass("P2030Y09M30DT06H34M42S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P2029Y10M29DT21H06M18S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P2029Y10M29DT21H06M18S'}); should_pass("P2029Y10M29DT21H06M19S", $type, 0); should_pass("P2030Y03M28DT20H53M50S", $type, 0); should_pass("P2030Y05M25DT04H06M40S", $type, 0); should_pass("P2030Y11M30DT20H45M46S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P2030Y12M31DT23H59M58S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P2030Y12M31DT23H59M58S'}); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P1970Y01M01DT00H00M00S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P1970Y01M01DT00H00M00S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P2013Y09M12DT12H40M18S", $type, 0); should_pass("P2008Y03M14DT18H40M18S", $type, 0); should_pass("P2005Y12M19DT06H31M58S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P1978Y12M21DT17H22M44S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P1978Y12M21DT17H22M44S'}); should_pass("P1978Y12M21DT17H22M44S", $type, 0); should_pass("P2013Y06M18DT09H18M34S", $type, 0); should_pass("P2010Y05M06DT16H52M15S", $type, 0); should_pass("P1990Y01M25DT15H51M01S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P1989Y09M10DT10H34M11S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P1989Y09M10DT10H34M11S'}); should_pass("P1989Y09M10DT10H34M11S", $type, 0); should_pass("P2017Y07M19DT04H37M22S", $type, 0); should_pass("P2009Y10M12DT09H40M36S", $type, 0); should_pass("P1994Y08M12DT06H51M28S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P2024Y01M12DT09H17M54S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P2024Y01M12DT09H17M54S'}); should_pass("P2024Y01M12DT09H17M54S", $type, 0); should_pass("P2027Y02M19DT00H14M52S", $type, 0); should_pass("P2024Y10M23DT20H30M30S", $type, 0); should_pass("P2029Y08M03DT08H51M30S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P2030Y12M31DT23H59M59S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P2030Y12M31DT23H59M59S'}); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P1970Y01M01DT00H00M01S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P1970Y01M01DT00H00M01S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P1990Y06M11DT15H00M05S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P1990Y06M11DT15H00M05S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1986Y04M24DT00H21M12S", $type, 0); should_pass("P1971Y09M17DT08H19M32S", $type, 0); should_pass("P1987Y09M12DT13H23M05S", $type, 0); should_pass("P1990Y06M11DT15H00M04S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P2009Y03M30DT15H11M46S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P2009Y03M30DT15H11M46S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1987Y01M13DT23H21M22S", $type, 0); should_pass("P1989Y12M31DT02H47M51S", $type, 0); should_pass("P1972Y10M22DT15H02M48S", $type, 0); should_pass("P2009Y03M30DT15H11M45S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P1983Y12M12DT16H37M58S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P1983Y12M12DT16H37M58S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1983Y05M10DT03H50M24S", $type, 0); should_pass("P1970Y08M29DT13H31M28S", $type, 0); should_pass("P1971Y05M25DT10H29M29S", $type, 0); should_pass("P1983Y12M12DT16H37M57S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P2030Y12M31DT23H59M59S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P2030Y12M31DT23H59M59S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1993Y07M20DT18H29M29S", $type, 0); should_pass("P2010Y06M27DT18H05M25S", $type, 0); should_pass("P2023Y01M15DT16H37M06S", $type, 0); should_pass("P2030Y12M31DT23H59M58S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1970Y01M01DT00H00M00S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1970Y01M01DT00H00M00S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1970Y02M12DT08H03M16S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1970Y02M12DT08H03M16S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1970Y01M15DT15H39M46S", $type, 0); should_pass("P1970Y01M16DT05H01M14S", $type, 0); should_pass("P1970Y01M24DT03H56M38S", $type, 0); should_pass("P1970Y02M12DT08H03M16S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1981Y03M20DT22H33M14S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1981Y03M20DT22H33M14S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1973Y06M18DT22H11M53S", $type, 0); should_pass("P1971Y11M27DT21H59M21S", $type, 0); should_pass("P1981Y01M03DT00H54M52S", $type, 0); should_pass("P1981Y03M20DT22H33M14S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1989Y04M21DT11H28M41S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1989Y04M21DT11H28M41S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1981Y05M04DT21H26M39S", $type, 0); should_pass("P1978Y02M28DT22H43M07S", $type, 0); should_pass("P1981Y10M20DT02H31M54S", $type, 0); should_pass("P1989Y04M21DT11H28M41S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P2030Y12M31DT23H59M59S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P2030Y12M31DT23H59M59S'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P1988Y02M02DT22H28M22S", $type, 0); should_pass("P2023Y12M03DT05H48M36S", $type, 0); should_pass("P1975Y09M04DT03H30M21S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P\\d\\d76Y\\d4M2\\dDT1\\dH\\d9M\\d9S." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P\d\d76Y\d4M2\dDT1\dH\d9M\d9S$)/}); should_pass("P1876Y04M23DT16H39M39S", $type, 0); should_pass("P1876Y04M22DT17H19M19S", $type, 0); should_pass("P1876Y04M24DT12H49M19S", $type, 0); should_pass("P1776Y04M25DT16H09M19S", $type, 0); should_pass("P1876Y04M23DT15H49M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P\\d\\d74Y0\\dM\\d6DT1\\dH\\d0M\\d7S." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P\d\d74Y0\dM\d6DT1\dH\d0M\d7S$)/}); should_pass("P1974Y05M26DT18H00M27S", $type, 0); should_pass("P2074Y09M06DT18H20M17S", $type, 0); should_pass("P1974Y03M26DT14H10M17S", $type, 0); should_pass("P1874Y04M26DT13H00M37S", $type, 0); should_pass("P1774Y04M26DT15H10M37S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P20\\d\\dY\\d3M\\d1DT\\d4H\\d7M\\d6S." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P20\d\dY\d3M\d1DT\d4H\d7M\d6S$)/}); should_pass("P2043Y03M11DT04H17M16S", $type, 0); should_pass("P2017Y03M21DT04H37M36S", $type, 0); should_pass("P2034Y03M01DT14H57M06S", $type, 0); should_pass("P2051Y03M11DT14H37M56S", $type, 0); should_pass("P2077Y03M01DT04H07M46S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P19\\d\\dY\\d8M\\d3DT\\d0H1\\dM\\d2S." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P19\d\dY\d8M\d3DT\d0H1\dM\d2S$)/}); should_pass("P1941Y08M13DT00H15M02S", $type, 0); should_pass("P1912Y08M23DT10H14M32S", $type, 0); should_pass("P1944Y08M13DT00H14M32S", $type, 0); should_pass("P1938Y08M23DT10H13M02S", $type, 0); should_pass("P1948Y08M23DT10H14M52S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P\\d\\d63Y\\d4M1\\dDT0\\dH\\d4M4\\dS." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P\d\d63Y\d4M1\dDT0\dH\d4M4\dS$)/}); should_pass("P1863Y04M14DT04H14M46S", $type, 0); should_pass("P1863Y04M15DT06H44M47S", $type, 0); should_pass("P2063Y04M17DT07H34M43S", $type, 0); should_pass("P1863Y04M18DT00H24M40S", $type, 0); should_pass("P1963Y04M13DT04H34M45S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2025Y01M14DT13H56M25S','P1983Y03M24DT09H12M25S','P1984Y01M10DT20H37M24S','P1997Y09M21DT02H26M51S','P1988Y07M27DT12H21M55S','P2000Y08M25DT00H50M37S','P1981Y11M06DT01H43M46S','P1982Y04M25DT04H30M00S','P2011Y03M13DT10H22M00S']}); should_pass("P2000Y08M25DT00H50M37S", $type, 0); should_pass("P1997Y09M21DT02H26M51S", $type, 0); should_pass("P1988Y07M27DT12H21M55S", $type, 0); should_pass("P2000Y08M25DT00H50M37S", $type, 0); should_pass("P1983Y03M24DT09H12M25S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2030Y06M26DT21H55M47S','P1979Y03M06DT16H39M48S','P1987Y06M06DT18H56M03S','P1977Y04M02DT05H48M43S','P1995Y02M01DT05H15M19S','P2019Y06M07DT15H23M38S','P1976Y12M13DT09H35M31S','P1989Y03M16DT04H44M26S','P1993Y12M14DT04H03M02S']}); should_pass("P1995Y02M01DT05H15M19S", $type, 0); should_pass("P1989Y03M16DT04H44M26S", $type, 0); should_pass("P2019Y06M07DT15H23M38S", $type, 0); should_pass("P1979Y03M06DT16H39M48S", $type, 0); should_pass("P1995Y02M01DT05H15M19S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2014Y02M13DT07H57M16S','P1971Y01M25DT00H00M13S','P1992Y03M13DT23H32M32S','P1999Y01M17DT20H04M34S','P1974Y07M30DT07H58M46S','P1979Y12M12DT13H36M50S','P2018Y05M02DT20H30M41S','P2005Y11M15DT09H43M12S','P1995Y06M08DT02H47M24S','P1973Y07M23DT17H25M15S']}); should_pass("P1974Y07M30DT07H58M46S", $type, 0); should_pass("P1979Y12M12DT13H36M50S", $type, 0); should_pass("P1971Y01M25DT00H00M13S", $type, 0); should_pass("P2005Y11M15DT09H43M12S", $type, 0); should_pass("P1974Y07M30DT07H58M46S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2025Y05M27DT08H26M21S','P1992Y12M03DT11H54M34S','P2006Y06M20DT01H05M49S','P2007Y02M04DT05H26M40S','P1978Y02M20DT15H18M23S','P2017Y06M28DT06H31M49S','P2025Y04M14DT05H33M34S']}); should_pass("P2006Y06M20DT01H05M49S", $type, 0); should_pass("P1978Y02M20DT15H18M23S", $type, 0); should_pass("P2006Y06M20DT01H05M49S", $type, 0); should_pass("P1992Y12M03DT11H54M34S", $type, 0); should_pass("P2025Y05M27DT08H26M21S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2004Y09M11DT17H07M38S','P2002Y03M13DT22H40M25S','P1995Y02M03DT12H24M43S','P2002Y11M07DT03H22M59S','P1970Y01M27DT04H00M33S','P1974Y01M22DT17H35M48S','P2012Y01M30DT22H51M53S','P2024Y05M28DT11H34M44S','P1987Y03M14DT08H37M46S']}); should_pass("P2012Y01M30DT22H51M53S", $type, 0); should_pass("P1970Y01M27DT04H00M33S", $type, 0); should_pass("P2002Y03M13DT22H40M25S", $type, 0); should_pass("P1974Y01M22DT17H35M48S", $type, 0); should_pass("P2002Y11M07DT03H22M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Duration', {'whiteSpace' => 'collapse'}); should_pass("P1970Y01M01DT00H00M00S", $type, 0); should_pass("P2015Y12M04DT03H50M05S", $type, 0); should_pass("P1989Y07M13DT09H21M19S", $type, 0); should_pass("P1980Y06M18DT05H57M31S", $type, 0); should_pass("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P1979Y05M22DT21H16M00S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P1979Y05M22DT21H16M00S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1970Y05M21DT18H22M32S", $type, 0); should_fail("P1970Y01M10DT04H04M51S", $type, 0); should_fail("P1973Y12M29DT05H47M26S", $type, 0); should_fail("P1979Y05M22DT21H15M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P2020Y07M24DT16H45M10S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P2020Y07M24DT16H45M10S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P2017Y05M05DT20H46M17S", $type, 0); should_fail("P1980Y09M22DT08H38M19S", $type, 0); should_fail("P2013Y09M05DT12H59M59S", $type, 0); should_fail("P2020Y07M24DT16H45M09S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P2020Y02M05DT23H43M19S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P2020Y02M05DT23H43M19S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1979Y12M11DT04H01M22S", $type, 0); should_fail("P1990Y09M27DT06H02M01S", $type, 0); should_fail("P1974Y09M01DT00H50M09S", $type, 0); should_fail("P2020Y02M05DT23H43M18S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P1985Y11M17DT03H28M39S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P1985Y11M17DT03H28M39S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1981Y08M20DT09H15M08S", $type, 0); should_fail("P1980Y11M22DT05H56M45S", $type, 0); should_fail("P1974Y10M08DT03H51M35S", $type, 0); should_fail("P1985Y11M17DT03H28M38S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minInclusive with value P2030Y12M31DT23H59M59S." => sub { my $type = mk_type('Duration', {'minInclusive' => 'P2030Y12M31DT23H59M59S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1992Y03M21DT22H31M44S", $type, 0); should_fail("P1982Y08M30DT10H29M11S", $type, 0); should_fail("P2005Y07M18DT17H02M03S", $type, 0); should_fail("P2030Y12M31DT23H59M58S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1970Y01M01DT00H00M00S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1970Y01M01DT00H00M00S'}); should_fail("P1970Y01M01DT00H00M01S", $type, 0); should_fail("P1978Y09M23DT07H58M54S", $type, 0); should_fail("P2003Y11M12DT12H24M27S", $type, 0); should_fail("P1972Y12M20DT09H48M15S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P2017Y11M05DT07H47M53S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P2017Y11M05DT07H47M53S'}); should_fail("P2017Y11M05DT07H47M54S", $type, 0); should_fail("P2030Y09M02DT19H53M28S", $type, 0); should_fail("P2025Y02M07DT17H07M02S", $type, 0); should_fail("P2026Y07M26DT14H18M19S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1983Y03M31DT13H03M25S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1983Y03M31DT13H03M25S'}); should_fail("P1983Y03M31DT13H03M26S", $type, 0); should_fail("P2005Y01M28DT09H21M40S", $type, 0); should_fail("P2020Y08M15DT04H17M25S", $type, 0); should_fail("P1987Y04M17DT07H51M04S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P2004Y12M06DT10H36M29S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P2004Y12M06DT10H36M29S'}); should_fail("P2004Y12M06DT10H36M30S", $type, 0); should_fail("P2015Y04M26DT18H05M14S", $type, 0); should_fail("P2026Y12M23DT19H22M29S", $type, 0); should_fail("P2028Y05M31DT09H15M47S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxInclusive with value P1989Y02M14DT22H12M09S." => sub { my $type = mk_type('Duration', {'maxInclusive' => 'P1989Y02M14DT22H12M09S'}); should_fail("P1989Y02M14DT22H12M10S", $type, 0); should_fail("P1992Y11M01DT16H40M21S", $type, 0); should_fail("P1995Y03M22DT22H27M03S", $type, 0); should_fail("P2010Y01M27DT10H05M12S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P1970Y01M01DT00H00M00S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P1970Y01M01DT00H00M00S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P1974Y08M01DT01H59M52S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P1974Y08M01DT01H59M52S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1974Y03M13DT17H19M07S", $type, 0); should_fail("P1972Y08M14DT16H42M47S", $type, 0); should_fail("P1973Y03M29DT16H56M06S", $type, 0); should_fail("P1974Y08M01DT01H59M52S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P2030Y07M10DT08H51M22S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P2030Y07M10DT08H51M22S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1978Y12M17DT22H17M47S", $type, 0); should_fail("P2029Y12M09DT07H42M51S", $type, 0); should_fail("P2011Y05M04DT23H43M21S", $type, 0); should_fail("P2030Y07M10DT08H51M22S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P1993Y07M06DT16H26M06S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P1993Y07M06DT16H26M06S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P1975Y06M13DT19H10M35S", $type, 0); should_fail("P1982Y08M03DT00H49M53S", $type, 0); should_fail("P1974Y07M21DT16H02M33S", $type, 0); should_fail("P1993Y07M06DT16H26M06S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet minExclusive with value P2030Y12M31DT23H59M58S." => sub { my $type = mk_type('Duration', {'minExclusive' => 'P2030Y12M31DT23H59M58S'}); should_fail("P1970Y01M01DT00H00M00S", $type, 0); should_fail("P2014Y02M19DT10H43M12S", $type, 0); should_fail("P1981Y11M21DT18H38M44S", $type, 0); should_fail("P2019Y07M05DT21H46M10S", $type, 0); should_fail("P2030Y12M31DT23H59M58S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P1970Y01M01DT00H00M01S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P1970Y01M01DT00H00M01S'}); should_fail("P1970Y01M01DT00H00M01S", $type, 0); should_fail("P1989Y04M23DT23H47M39S", $type, 0); should_fail("P1983Y06M26DT22H09M28S", $type, 0); should_fail("P2014Y05M30DT00H06M01S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P1983Y08M22DT12H17M52S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P1983Y08M22DT12H17M52S'}); should_fail("P1983Y08M22DT12H17M52S", $type, 0); should_fail("P2004Y11M19DT00H59M44S", $type, 0); should_fail("P2027Y12M23DT16H11M34S", $type, 0); should_fail("P2025Y09M06DT09H26M22S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P2024Y06M08DT17H23M35S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P2024Y06M08DT17H23M35S'}); should_fail("P2024Y06M08DT17H23M35S", $type, 0); should_fail("P2029Y11M22DT00H36M33S", $type, 0); should_fail("P2030Y12M03DT10H22M41S", $type, 0); should_fail("P2029Y08M06DT14H36M28S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P1974Y04M13DT23H56M57S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P1974Y04M13DT23H56M57S'}); should_fail("P1974Y04M13DT23H56M57S", $type, 0); should_fail("P2003Y03M21DT07H39M44S", $type, 0); should_fail("P1980Y04M18DT22H14M48S", $type, 0); should_fail("P2013Y08M14DT10H05M35S", $type, 0); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet maxExclusive with value P2030Y12M31DT23H59M59S." => sub { my $type = mk_type('Duration', {'maxExclusive' => 'P2030Y12M31DT23H59M59S'}); should_fail("P2030Y12M31DT23H59M59S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P\\d\\d69Y\\d2M1\\dDT\\d0H\\d9M5\\dS." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P\d\d69Y\d2M1\dDT\d0H\d9M5\dS$)/}); should_fail("P1986Y06M24DT05H04M09S", $type, 0); should_fail("P1808Y03M05DT19H21M14S", $type, 0); should_fail("P2038Y06M26DT05H46M26S", $type, 0); should_fail("P1995Y05M02DT02H32M32S", $type, 0); should_fail("P1871Y04M03DT14H27M43S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P19\\d\\dY0\\dM2\\dDT\\d1H\\d9M\\d9S." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P19\d\dY0\dM2\dDT\d1H\d9M\d9S$)/}); should_fail("P1813Y12M05DT03H21M34S", $type, 0); should_fail("P2007Y12M12DT06H56M25S", $type, 0); should_fail("P2092Y11M14DT19H47M40S", $type, 0); should_fail("P1763Y12M15DT18H26M48S", $type, 0); should_fail("P2021Y10M10DT07H26M26S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P\\d\\d24Y0\\dM1\\dDT1\\dH\\d0M5\\dS." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P\d\d24Y0\dM1\dDT1\dH\d0M5\dS$)/}); should_fail("P2080Y11M20DT28H23M07S", $type, 0); should_fail("P1963Y10M27DT05H33M27S", $type, 0); should_fail("P1860Y11M01DT29H07M09S", $type, 0); should_fail("P1734Y10M27DT26H39M38S", $type, 0); should_fail("P1895Y11M04DT03H43M10S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P\\d\\d80Y\\d8M1\\dDT1\\dH3\\dM2\\dS." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P\d\d80Y\d8M1\dDT1\dH3\dM2\dS$)/}); should_fail("P2035Y04M26DT42H16M44S", $type, 0); should_fail("P1953Y03M25DT56H22M31S", $type, 0); should_fail("P1882Y02M01DT43H46M14S", $type, 0); should_fail("P1816Y02M03DT41H50M58S", $type, 0); should_fail("P1847Y04M23DT38H01M44S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet pattern with value P17\\d\\dY\\d7M\\d3DT0\\dH0\\dM\\d5S." => sub { my $type = mk_type('Duration', {'pattern' => qr/(?ms:^P17\d\dY\d7M\d3DT0\dH0\dM\d5S$)/}); should_fail("P1865Y03M10DT42H54M38S", $type, 0); should_fail("P2018Y05M22DT17H44M47S", $type, 0); should_fail("P1905Y01M08DT26H15M16S", $type, 0); should_fail("P1843Y02M12DT29H32M46S", $type, 0); should_fail("P1903Y08M21DT22H44M37S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2015Y08M23DT18H23M40S','P2001Y05M07DT11H55M34S','P1997Y08M17DT04H10M57S','P2027Y11M25DT08H24M37S','P1979Y11M05DT13H51M22S','P1970Y11M23DT19H16M51S','P1996Y02M29DT12H05M18S','P1996Y12M28DT23H45M04S','P1972Y03M02DT12H10M55S']}); should_fail("P1977Y02M26DT14H18M13S", $type, 0); should_fail("P1975Y12M04DT23H29M12S", $type, 0); should_fail("P2030Y11M04DT11H41M43S", $type, 0); should_fail("P1988Y08M06DT06H19M22S", $type, 0); should_fail("P2005Y11M27DT00H33M07S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2022Y01M11DT20H19M23S','P1989Y05M09DT01H08M05S','P1982Y12M17DT22H56M58S','P2012Y02M22DT03H48M48S','P1984Y12M23DT12H06M46S','P1979Y02M11DT22H52M38S','P2007Y02M01DT19H26M41S','P1990Y07M09DT03H47M52S']}); should_fail("P1981Y11M23DT16H09M50S", $type, 0); should_fail("P2010Y06M28DT11H03M59S", $type, 0); should_fail("P1992Y10M18DT14H04M45S", $type, 0); should_fail("P2029Y02M05DT05H00M57S", $type, 0); should_fail("P1989Y02M26DT09H51M25S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2021Y09M08DT03H42M27S','P2010Y05M07DT14H05M41S','P1990Y12M17DT18H41M05S','P2018Y09M13DT19H46M10S','P1983Y04M09DT10H45M44S','P2023Y12M22DT12H00M51S']}); should_fail("P2010Y07M27DT09H27M16S", $type, 0); should_fail("P2026Y09M14DT21H08M32S", $type, 0); should_fail("P1975Y03M27DT00H38M25S", $type, 0); should_fail("P1981Y07M18DT07H20M45S", $type, 0); should_fail("P2020Y08M07DT17H01M03S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P2030Y09M20DT23H22M15S','P1995Y05M21DT23H38M45S','P1987Y02M08DT13H31M40S','P1971Y10M29DT14H33M12S','P1988Y10M13DT14H03M01S']}); should_fail("P1984Y04M17DT14H29M44S", $type, 0); should_fail("P2000Y11M09DT22H21M21S", $type, 0); should_fail("P1982Y08M31DT16H43M07S", $type, 0); should_fail("P2024Y11M27DT08H56M36S", $type, 0); should_fail("P1994Y10M27DT19H38M01S", $type, 0); done_testing; }; subtest "Type atomic/duration is restricted by facet enumeration." => sub { my $type = mk_type('Duration', {'enumeration' => ['P1987Y10M28DT18H24M51S','P1999Y09M16DT05H02M00S','P1979Y05M22DT05H21M45S','P2013Y09M20DT23H44M26S','P1985Y09M14DT12H30M28S','P2027Y08M14DT12H11M35S','P1972Y05M09DT19H36M52S','P1978Y04M20DT03H54M49S','P1972Y01M20DT23H15M38S','P2026Y08M11DT17H53M15S']}); should_fail("P2026Y09M10DT04H49M57S", $type, 0); should_fail("P1996Y07M07DT12H07M48S", $type, 0); should_fail("P2002Y01M29DT05H40M29S", $type, 0); should_fail("P2014Y08M29DT12H35M33S", $type, 0); should_fail("P2000Y08M01DT22H16M07S", $type, 0); done_testing; }; done_testing; 50float.t000664001750001750 2146412404317273 14011 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/float is restricted by facet pattern with value \\d{1}E\\-\\d{2}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}E\-\d{2}$)/}); should_pass("5E-16", $type, 0); should_pass("3E-18", $type, 0); should_pass("4E-26", $type, 0); should_pass("2E-18", $type, 0); should_pass("6E-13", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{2}E\\-\\d{1}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{2}E\-\d{1}$)/}); should_pass("42E-2", $type, 0); should_pass("48E-5", $type, 0); should_pass("64E-2", $type, 0); should_pass("62E-1", $type, 0); should_pass("39E-8", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}\\.\\d{2}E\\d{1}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}\.\d{2}E\d{1}$)/}); should_pass("6.77E7", $type, 0); should_pass("3.84E8", $type, 0); should_pass("9.84E6", $type, 0); should_pass("4.73E1", $type, 0); should_pass("4.74E2", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}\\.\\d{3}E\\d{2}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}\.\d{3}E\d{2}$)/}); should_pass("9.966E21", $type, 0); should_pass("1.537E23", $type, 0); should_pass("6.815E27", $type, 0); should_pass("4.555E23", $type, 0); should_pass("6.645E12", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}\\.\\d{7}E\\-\\d{2}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}\.\d{7}E\-\d{2}$)/}); should_pass("2.7821581E-24", $type, 0); should_pass("4.2646267E-21", $type, 0); should_pass("7.3748222E-24", $type, 0); should_pass("8.5676163E-27", $type, 0); should_pass("4.9665652E-22", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','1.9703874E-32','2.6927628E-19','2.7455975E-6','2.5357204E7','2.8222192E20','3.4028235E38']}); should_pass("1.4E-45", $type, 0); should_pass("2.8222192E20", $type, 0); should_pass("2.6927628E-19", $type, 0); should_pass("2.5357204E7", $type, 0); should_pass("2.5357204E7", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','3.1628908E-25','3.3473630E-5','1.5006857E15','3.4028235E38']}); should_pass("3.1628908E-25", $type, 0); should_pass("3.1628908E-25", $type, 0); should_pass("3.4028235E38", $type, 0); should_pass("3.3473630E-5", $type, 0); should_pass("3.3473630E-5", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','2.8312165E-25','1.5954879E-5','3.2481804E15','3.4028235E38']}); should_pass("2.8312165E-25", $type, 0); should_pass("1.5954879E-5", $type, 0); should_pass("1.5954879E-5", $type, 0); should_pass("1.5954879E-5", $type, 0); should_pass("2.8312165E-25", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','1.7053130E-34','3.2152819E-23','2.4912911E-12','1.4657043E-1','3.1031987E10','2.7832936E21','3.4028235E38']}); should_pass("2.7832936E21", $type, 0); should_pass("3.1031987E10", $type, 0); should_pass("2.7832936E21", $type, 0); should_pass("1.4657043E-1", $type, 0); should_pass("2.4912911E-12", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','1.8092974E-25','2.2696584E-5','2.0771560E15','3.4028235E38']}); should_pass("2.0771560E15", $type, 0); should_pass("1.8092974E-25", $type, 0); should_pass("1.8092974E-25", $type, 0); should_pass("2.2696584E-5", $type, 0); should_pass("2.2696584E-5", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Float', {'whiteSpace' => 'collapse'}); should_pass("-INF", $type, 0); should_pass("-3.4028235E38", $type, 0); should_pass("-2.7950497E18", $type, 0); should_pass("-2.0132317E-2", $type, 0); should_pass("-2.7053610E-22", $type, 0); should_pass("-1.4E-45", $type, 0); should_pass("-0", $type, 0); should_pass("0", $type, 0); should_pass("1.4E-45", $type, 0); should_pass("2.9102584E-25", $type, 0); should_pass("2.2788946E-5", $type, 0); should_pass("3.2699550E15", $type, 0); should_pass("3.4028235E38", $type, 0); should_pass("INF", $type, 0); should_pass("NaN", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}E\\-\\d{2}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}E\-\d{2}$)/}); should_fail("5E3", $type, 0); should_fail("1E-5", $type, 0); should_fail("7E-9", $type, 0); should_fail("5E3", $type, 0); should_fail("8E-2", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{2}E\\-\\d{1}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{2}E\-\d{1}$)/}); should_fail("9113754E-14", $type, 0); should_fail("624922E-25", $type, 0); should_fail("7576E19", $type, 0); should_fail("8E-27", $type, 0); should_fail("7578E22", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}\\.\\d{2}E\\d{1}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}\.\d{2}E\d{1}$)/}); should_fail("4.92245E25", $type, 0); should_fail("7.3539E27", $type, 0); should_fail("8.749E25", $type, 0); should_fail("3.722388E14", $type, 0); should_fail("7.5E28", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}\\.\\d{3}E\\d{2}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}\.\d{3}E\d{2}$)/}); should_fail("7.347924E4", $type, 0); should_fail("3.7562E7", $type, 0); should_fail("4.2438E5", $type, 0); should_fail("1.46E5", $type, 0); should_fail("8.3354E9", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet pattern with value \\d{1}\\.\\d{7}E\\-\\d{2}." => sub { my $type = mk_type('Float', {'pattern' => qr/(?ms:^\d{1}\.\d{7}E\-\d{2}$)/}); should_fail("8.77683E-8", $type, 0); should_fail("4.48E-3", $type, 0); should_fail("2.36895E-6", $type, 0); should_fail("2.54836E-7", $type, 0); should_fail("8.5E8", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','3.3237194E-29','1.5755169E-13','2.8335234E3','2.1272429E19','3.4028235E38']}); should_fail("-1.8868965E18", $type, 0); should_fail("-2.2511439E-14", $type, 0); should_fail("-INF", $type, 0); should_fail("1.4886925E-21", $type, 0); should_fail("-2.4423220E12", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','1.8901718E-32','2.9213084E-19','3.0553629E-6','2.9919429E7','1.6963260E20','3.4028235E38']}); should_fail("0", $type, 0); should_fail("2.9645228E-37", $type, 0); should_fail("2.6648029E9", $type, 0); should_fail("-1.7993774E32", $type, 0); should_fail("-3.1408676E16", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','2.4814014E-36','2.6484107E-27','1.7944781E-18','2.5641745E-9','3.1836073E0','1.8404680E9','3.1833687E18','1.8920957E27','3.4028235E38']}); should_fail("1.6820146E-7", $type, 0); should_fail("-2.8018486E2", $type, 0); should_fail("-1.8362160E22", $type, 0); should_fail("INF", $type, 0); should_fail("-2.0940774E6", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','2.1703468E-32','2.2458008E-19','1.8789427E-6','2.1360589E7','2.2878065E20','3.4028235E38']}); should_fail("2.1227235E-41", $type, 0); should_fail("INF", $type, 0); should_fail("1.8456685E-43", $type, 0); should_fail("-3.0546106E-18", $type, 0); should_fail("2.1049167E-5", $type, 0); done_testing; }; subtest "Type atomic/float is restricted by facet enumeration." => sub { my $type = mk_type('Float', {'enumeration' => ['1.4E-45','2.4589171E-32','2.2810632E-19','1.5252392E-6','1.5641128E7','2.8366848E20','3.4028235E38']}); should_fail("2.2542101E-25", $type, 0); should_fail("-2.5676257E-10", $type, 0); should_fail("2.2542101E-25", $type, 0); should_fail("2.4031905E-43", $type, 0); should_fail("1.4401430E-19", $type, 0); done_testing; }; done_testing; 50gDay.t000664001750001750 4601712404317273 13571 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/gDay is restricted by facet minExclusive with value ---01." => sub { my $type = mk_type('GDay', {'minExclusive' => '---01'}); should_pass("---02", $type, 0); should_pass("---17", $type, 0); should_pass("---26", $type, 0); should_pass("---06", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---20." => sub { my $type = mk_type('GDay', {'minExclusive' => '---20'}); should_pass("---21", $type, 0); should_pass("---28", $type, 0); should_pass("---21", $type, 0); should_pass("---27", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---04." => sub { my $type = mk_type('GDay', {'minExclusive' => '---04'}); should_pass("---05", $type, 0); should_pass("---14", $type, 0); should_pass("---25", $type, 0); should_pass("---14", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---04." => sub { my $type = mk_type('GDay', {'minExclusive' => '---04'}); should_pass("---05", $type, 0); should_pass("---14", $type, 0); should_pass("---20", $type, 0); should_pass("---24", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---30." => sub { my $type = mk_type('GDay', {'minExclusive' => '---30'}); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---01." => sub { my $type = mk_type('GDay', {'minInclusive' => '---01'}); should_pass("---01", $type, 0); should_pass("---09", $type, 0); should_pass("---17", $type, 0); should_pass("---14", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---16." => sub { my $type = mk_type('GDay', {'minInclusive' => '---16'}); should_pass("---16", $type, 0); should_pass("---18", $type, 0); should_pass("---16", $type, 0); should_pass("---29", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---24." => sub { my $type = mk_type('GDay', {'minInclusive' => '---24'}); should_pass("---24", $type, 0); should_pass("---29", $type, 0); should_pass("---24", $type, 0); should_pass("---30", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---08." => sub { my $type = mk_type('GDay', {'minInclusive' => '---08'}); should_pass("---08", $type, 0); should_pass("---30", $type, 0); should_pass("---27", $type, 0); should_pass("---15", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---31." => sub { my $type = mk_type('GDay', {'minInclusive' => '---31'}); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---02." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---02'}); should_pass("---01", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---25." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---25'}); should_pass("---01", $type, 0); should_pass("---15", $type, 0); should_pass("---21", $type, 0); should_pass("---07", $type, 0); should_pass("---24", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---30." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---30'}); should_pass("---01", $type, 0); should_pass("---20", $type, 0); should_pass("---24", $type, 0); should_pass("---22", $type, 0); should_pass("---29", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---15." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---15'}); should_pass("---01", $type, 0); should_pass("---13", $type, 0); should_pass("---06", $type, 0); should_pass("---11", $type, 0); should_pass("---14", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---31." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---31'}); should_pass("---01", $type, 0); should_pass("---06", $type, 0); should_pass("---22", $type, 0); should_pass("---09", $type, 0); should_pass("---30", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---01." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---01'}); should_pass("---01", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---07." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---07'}); should_pass("---01", $type, 0); should_pass("---01", $type, 0); should_pass("---01", $type, 0); should_pass("---02", $type, 0); should_pass("---07", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---01." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---01'}); should_pass("---01", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---10." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---10'}); should_pass("---01", $type, 0); should_pass("---02", $type, 0); should_pass("---05", $type, 0); should_pass("---08", $type, 0); should_pass("---10", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---31." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---31'}); should_pass("---01", $type, 0); should_pass("---15", $type, 0); should_pass("---25", $type, 0); should_pass("---01", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---\\d5." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---\d5$)/}); should_pass("---15", $type, 0); should_pass("---15", $type, 0); should_pass("---25", $type, 0); should_pass("---15", $type, 0); should_pass("---15", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---\\d5." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---\d5$)/}); should_pass("---15", $type, 0); should_pass("---25", $type, 0); should_pass("---15", $type, 0); should_pass("---15", $type, 0); should_pass("---15", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---0\\d." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---0\d$)/}); should_pass("---02", $type, 0); should_pass("---03", $type, 0); should_pass("---04", $type, 0); should_pass("---07", $type, 0); should_pass("---05", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---\\d2." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---\d2$)/}); should_pass("---02", $type, 0); should_pass("---22", $type, 0); should_pass("---22", $type, 0); should_pass("---22", $type, 0); should_pass("---12", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---1\\d." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---1\d$)/}); should_pass("---14", $type, 0); should_pass("---13", $type, 0); should_pass("---14", $type, 0); should_pass("---13", $type, 0); should_pass("---11", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---15','---29','---30','---26','---16','---08','---18','---07']}); should_pass("---15", $type, 0); should_pass("---26", $type, 0); should_pass("---30", $type, 0); should_pass("---18", $type, 0); should_pass("---30", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---04','---04','---22','---20','---18','---12','---10','---08']}); should_pass("---20", $type, 0); should_pass("---10", $type, 0); should_pass("---12", $type, 0); should_pass("---18", $type, 0); should_pass("---04", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---15','---27','---16','---22','---12','---30','---24','---14','---09']}); should_pass("---12", $type, 0); should_pass("---24", $type, 0); should_pass("---12", $type, 0); should_pass("---30", $type, 0); should_pass("---24", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---15','---05','---17','---12','---21','---18']}); should_pass("---12", $type, 0); should_pass("---05", $type, 0); should_pass("---18", $type, 0); should_pass("---12", $type, 0); should_pass("---17", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---21','---23','---13','---26','---23','---24','---18','---30','---14']}); should_pass("---21", $type, 0); should_pass("---14", $type, 0); should_pass("---13", $type, 0); should_pass("---30", $type, 0); should_pass("---26", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('GDay', {'whiteSpace' => 'collapse'}); should_pass("---01", $type, 0); should_pass("---25", $type, 0); should_pass("---22", $type, 0); should_pass("---26", $type, 0); should_pass("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---11." => sub { my $type = mk_type('GDay', {'minInclusive' => '---11'}); should_fail("---01", $type, 0); should_fail("---08", $type, 0); should_fail("---05", $type, 0); should_fail("---08", $type, 0); should_fail("---10", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---05." => sub { my $type = mk_type('GDay', {'minInclusive' => '---05'}); should_fail("---01", $type, 0); should_fail("---02", $type, 0); should_fail("---02", $type, 0); should_fail("---03", $type, 0); should_fail("---04", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---16." => sub { my $type = mk_type('GDay', {'minInclusive' => '---16'}); should_fail("---01", $type, 0); should_fail("---09", $type, 0); should_fail("---13", $type, 0); should_fail("---10", $type, 0); should_fail("---15", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minInclusive with value ---31." => sub { my $type = mk_type('GDay', {'minInclusive' => '---31'}); should_fail("---01", $type, 0); should_fail("---20", $type, 0); should_fail("---01", $type, 0); should_fail("---14", $type, 0); should_fail("---30", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---01." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---01'}); should_fail("---02", $type, 0); should_fail("---07", $type, 0); should_fail("---30", $type, 0); should_fail("---29", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---30." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---30'}); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---05." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---05'}); should_fail("---06", $type, 0); should_fail("---25", $type, 0); should_fail("---27", $type, 0); should_fail("---24", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---05." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---05'}); should_fail("---06", $type, 0); should_fail("---10", $type, 0); should_fail("---07", $type, 0); should_fail("---07", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxInclusive with value ---12." => sub { my $type = mk_type('GDay', {'maxInclusive' => '---12'}); should_fail("---13", $type, 0); should_fail("---26", $type, 0); should_fail("---20", $type, 0); should_fail("---22", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---01." => sub { my $type = mk_type('GDay', {'minExclusive' => '---01'}); should_fail("---01", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---18." => sub { my $type = mk_type('GDay', {'minExclusive' => '---18'}); should_fail("---01", $type, 0); should_fail("---05", $type, 0); should_fail("---16", $type, 0); should_fail("---17", $type, 0); should_fail("---18", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---02." => sub { my $type = mk_type('GDay', {'minExclusive' => '---02'}); should_fail("---01", $type, 0); should_fail("---01", $type, 0); should_fail("---01", $type, 0); should_fail("---01", $type, 0); should_fail("---02", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---10." => sub { my $type = mk_type('GDay', {'minExclusive' => '---10'}); should_fail("---01", $type, 0); should_fail("---01", $type, 0); should_fail("---01", $type, 0); should_fail("---03", $type, 0); should_fail("---10", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet minExclusive with value ---30." => sub { my $type = mk_type('GDay', {'minExclusive' => '---30'}); should_fail("---01", $type, 0); should_fail("---27", $type, 0); should_fail("---21", $type, 0); should_fail("---02", $type, 0); should_fail("---30", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---02." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---02'}); should_fail("---02", $type, 0); should_fail("---29", $type, 0); should_fail("---14", $type, 0); should_fail("---02", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---26." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---26'}); should_fail("---26", $type, 0); should_fail("---27", $type, 0); should_fail("---28", $type, 0); should_fail("---28", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---05." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---05'}); should_fail("---05", $type, 0); should_fail("---17", $type, 0); should_fail("---07", $type, 0); should_fail("---21", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---13." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---13'}); should_fail("---13", $type, 0); should_fail("---28", $type, 0); should_fail("---13", $type, 0); should_fail("---16", $type, 0); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet maxExclusive with value ---31." => sub { my $type = mk_type('GDay', {'maxExclusive' => '---31'}); should_fail("---31", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---2\\d." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---2\d$)/}); should_fail("---14", $type, 0); should_fail("---10", $type, 0); should_fail("---18", $type, 0); should_fail("---12", $type, 0); should_fail("---10", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---\\d3." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---\d3$)/}); should_fail("---06", $type, 0); should_fail("---05", $type, 0); should_fail("---14", $type, 0); should_fail("---04", $type, 0); should_fail("---27", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---\\d4." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---\d4$)/}); should_fail("---28", $type, 0); should_fail("---13", $type, 0); should_fail("---03", $type, 0); should_fail("---01", $type, 0); should_fail("---28", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---0\\d." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---0\d$)/}); should_fail("---22", $type, 0); should_fail("---10", $type, 0); should_fail("---16", $type, 0); should_fail("---11", $type, 0); should_fail("---22", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet pattern with value ---1\\d." => sub { my $type = mk_type('GDay', {'pattern' => qr/(?ms:^---1\d$)/}); should_fail("---22", $type, 0); should_fail("---02", $type, 0); should_fail("---24", $type, 0); should_fail("---06", $type, 0); should_fail("---06", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---26','---23','---25','---28','---05','---23','---18']}); should_fail("---22", $type, 0); should_fail("---30", $type, 0); should_fail("---13", $type, 0); should_fail("---19", $type, 0); should_fail("---02", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---22','---04','---12','---12','---08','---23','---22','---09','---04']}); should_fail("---18", $type, 0); should_fail("---26", $type, 0); should_fail("---26", $type, 0); should_fail("---16", $type, 0); should_fail("---17", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---30','---10','---18','---14','---03','---15','---25','---16','---23','---14']}); should_fail("---17", $type, 0); should_fail("---08", $type, 0); should_fail("---01", $type, 0); should_fail("---17", $type, 0); should_fail("---01", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---24','---03','---03','---30','---12','---20']}); should_fail("---27", $type, 0); should_fail("---26", $type, 0); should_fail("---28", $type, 0); should_fail("---23", $type, 0); should_fail("---25", $type, 0); done_testing; }; subtest "Type atomic/gDay is restricted by facet enumeration." => sub { my $type = mk_type('GDay', {'enumeration' => ['---29','---16','---22','---13','---29','---16','---27','---28','---15']}); should_fail("---02", $type, 0); should_fail("---24", $type, 0); should_fail("---25", $type, 0); should_fail("---18", $type, 0); should_fail("---24", $type, 0); done_testing; }; done_testing; 50gMonth.t000664001750001750 4612112404317273 14135 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/gMonth is restricted by facet minExclusive with value --01." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--01'}); should_pass("--02", $type, 0); should_pass("--07", $type, 0); should_pass("--10", $type, 0); should_pass("--06", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --09." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--09'}); should_pass("--10", $type, 0); should_pass("--12", $type, 0); should_pass("--10", $type, 0); should_pass("--11", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --03." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--03'}); should_pass("--04", $type, 0); should_pass("--12", $type, 0); should_pass("--07", $type, 0); should_pass("--08", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --04." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--04'}); should_pass("--05", $type, 0); should_pass("--11", $type, 0); should_pass("--09", $type, 0); should_pass("--07", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --11." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--11'}); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --01." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--01'}); should_pass("--01", $type, 0); should_pass("--01", $type, 0); should_pass("--11", $type, 0); should_pass("--05", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --05." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--05'}); should_pass("--05", $type, 0); should_pass("--10", $type, 0); should_pass("--05", $type, 0); should_pass("--11", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --07." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--07'}); should_pass("--07", $type, 0); should_pass("--08", $type, 0); should_pass("--07", $type, 0); should_pass("--11", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --11." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--11'}); should_pass("--11", $type, 0); should_pass("--11", $type, 0); should_pass("--11", $type, 0); should_pass("--12", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --12." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--12'}); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --02." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--02'}); should_pass("--01", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --02." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--02'}); should_pass("--01", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --11." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--11'}); should_pass("--01", $type, 0); should_pass("--07", $type, 0); should_pass("--05", $type, 0); should_pass("--07", $type, 0); should_pass("--10", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --09." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--09'}); should_pass("--01", $type, 0); should_pass("--05", $type, 0); should_pass("--07", $type, 0); should_pass("--07", $type, 0); should_pass("--08", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --12." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--12'}); should_pass("--01", $type, 0); should_pass("--02", $type, 0); should_pass("--08", $type, 0); should_pass("--08", $type, 0); should_pass("--11", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --01." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--01'}); should_pass("--01", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --09." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--09'}); should_pass("--01", $type, 0); should_pass("--02", $type, 0); should_pass("--05", $type, 0); should_pass("--07", $type, 0); should_pass("--09", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --04." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--04'}); should_pass("--01", $type, 0); should_pass("--04", $type, 0); should_pass("--03", $type, 0); should_pass("--03", $type, 0); should_pass("--04", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --03." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--03'}); should_pass("--01", $type, 0); should_pass("--02", $type, 0); should_pass("--02", $type, 0); should_pass("--02", $type, 0); should_pass("--03", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --12." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--12'}); should_pass("--01", $type, 0); should_pass("--11", $type, 0); should_pass("--07", $type, 0); should_pass("--08", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --1\\d." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--1\d$)/}); should_pass("--11", $type, 0); should_pass("--11", $type, 0); should_pass("--11", $type, 0); should_pass("--11", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --\\d2." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--\d2$)/}); should_pass("--02", $type, 0); should_pass("--02", $type, 0); should_pass("--02", $type, 0); should_pass("--02", $type, 0); should_pass("--02", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --\\d9." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--\d9$)/}); should_pass("--09", $type, 0); should_pass("--09", $type, 0); should_pass("--09", $type, 0); should_pass("--09", $type, 0); should_pass("--09", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --\\d6." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--\d6$)/}); should_pass("--06", $type, 0); should_pass("--06", $type, 0); should_pass("--06", $type, 0); should_pass("--06", $type, 0); should_pass("--06", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --0\\d." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--0\d$)/}); should_pass("--05", $type, 0); should_pass("--01", $type, 0); should_pass("--07", $type, 0); should_pass("--03", $type, 0); should_pass("--08", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--01','--01','--01','--08','--02','--05','--04','--02','--08']}); should_pass("--02", $type, 0); should_pass("--05", $type, 0); should_pass("--02", $type, 0); should_pass("--08", $type, 0); should_pass("--01", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--02','--12','--12','--06','--04','--11']}); should_pass("--06", $type, 0); should_pass("--06", $type, 0); should_pass("--12", $type, 0); should_pass("--12", $type, 0); should_pass("--02", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--02','--12','--03','--04','--11','--02','--11']}); should_pass("--12", $type, 0); should_pass("--12", $type, 0); should_pass("--02", $type, 0); should_pass("--12", $type, 0); should_pass("--04", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--07','--07','--03','--05','--05','--02','--07','--10','--04']}); should_pass("--05", $type, 0); should_pass("--10", $type, 0); should_pass("--07", $type, 0); should_pass("--05", $type, 0); should_pass("--02", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--06','--05','--02','--01','--06','--05']}); should_pass("--05", $type, 0); should_pass("--02", $type, 0); should_pass("--05", $type, 0); should_pass("--05", $type, 0); should_pass("--02", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('GMonth', {'whiteSpace' => 'collapse'}); should_pass("--01", $type, 0); should_pass("--03", $type, 0); should_pass("--11", $type, 0); should_pass("--09", $type, 0); should_pass("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --12." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--12'}); should_fail("--01", $type, 0); should_fail("--06", $type, 0); should_fail("--10", $type, 0); should_fail("--04", $type, 0); should_fail("--11", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --10." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--10'}); should_fail("--01", $type, 0); should_fail("--07", $type, 0); should_fail("--08", $type, 0); should_fail("--02", $type, 0); should_fail("--09", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --10." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--10'}); should_fail("--01", $type, 0); should_fail("--03", $type, 0); should_fail("--07", $type, 0); should_fail("--03", $type, 0); should_fail("--09", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --04." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--04'}); should_fail("--01", $type, 0); should_fail("--02", $type, 0); should_fail("--02", $type, 0); should_fail("--02", $type, 0); should_fail("--03", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minInclusive with value --12." => sub { my $type = mk_type('GMonth', {'minInclusive' => '--12'}); should_fail("--01", $type, 0); should_fail("--02", $type, 0); should_fail("--07", $type, 0); should_fail("--08", $type, 0); should_fail("--11", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --01." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--01'}); should_fail("--02", $type, 0); should_fail("--11", $type, 0); should_fail("--08", $type, 0); should_fail("--10", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --05." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--05'}); should_fail("--06", $type, 0); should_fail("--08", $type, 0); should_fail("--08", $type, 0); should_fail("--07", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --05." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--05'}); should_fail("--06", $type, 0); should_fail("--11", $type, 0); should_fail("--06", $type, 0); should_fail("--06", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --03." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--03'}); should_fail("--04", $type, 0); should_fail("--06", $type, 0); should_fail("--09", $type, 0); should_fail("--07", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxInclusive with value --03." => sub { my $type = mk_type('GMonth', {'maxInclusive' => '--03'}); should_fail("--04", $type, 0); should_fail("--10", $type, 0); should_fail("--05", $type, 0); should_fail("--05", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --01." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--01'}); should_fail("--01", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --02." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--02'}); should_fail("--01", $type, 0); should_fail("--01", $type, 0); should_fail("--02", $type, 0); should_fail("--02", $type, 0); should_fail("--02", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --01." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--01'}); should_fail("--01", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --04." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--04'}); should_fail("--01", $type, 0); should_fail("--04", $type, 0); should_fail("--02", $type, 0); should_fail("--03", $type, 0); should_fail("--04", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet minExclusive with value --11." => sub { my $type = mk_type('GMonth', {'minExclusive' => '--11'}); should_fail("--01", $type, 0); should_fail("--08", $type, 0); should_fail("--07", $type, 0); should_fail("--06", $type, 0); should_fail("--11", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --02." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--02'}); should_fail("--02", $type, 0); should_fail("--08", $type, 0); should_fail("--11", $type, 0); should_fail("--12", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --10." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--10'}); should_fail("--10", $type, 0); should_fail("--11", $type, 0); should_fail("--10", $type, 0); should_fail("--12", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --06." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--06'}); should_fail("--06", $type, 0); should_fail("--07", $type, 0); should_fail("--09", $type, 0); should_fail("--11", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --08." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--08'}); should_fail("--08", $type, 0); should_fail("--11", $type, 0); should_fail("--10", $type, 0); should_fail("--09", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet maxExclusive with value --12." => sub { my $type = mk_type('GMonth', {'maxExclusive' => '--12'}); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --0\\d." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--0\d$)/}); should_fail("--10", $type, 0); should_fail("--12", $type, 0); should_fail("--10", $type, 0); should_fail("--12", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --\\d1." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--\d1$)/}); should_fail("--06", $type, 0); should_fail("--08", $type, 0); should_fail("--05", $type, 0); should_fail("--04", $type, 0); should_fail("--04", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --0\\d." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--0\d$)/}); should_fail("--11", $type, 0); should_fail("--11", $type, 0); should_fail("--11", $type, 0); should_fail("--10", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --0\\d." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--0\d$)/}); should_fail("--10", $type, 0); should_fail("--10", $type, 0); should_fail("--10", $type, 0); should_fail("--11", $type, 0); should_fail("--11", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet pattern with value --1\\d." => sub { my $type = mk_type('GMonth', {'pattern' => qr/(?ms:^--1\d$)/}); should_fail("--03", $type, 0); should_fail("--08", $type, 0); should_fail("--08", $type, 0); should_fail("--02", $type, 0); should_fail("--08", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--06','--09','--02','--03','--03','--11','--07']}); should_fail("--08", $type, 0); should_fail("--05", $type, 0); should_fail("--08", $type, 0); should_fail("--04", $type, 0); should_fail("--05", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--05','--11','--03','--04','--06','--02','--06','--11']}); should_fail("--01", $type, 0); should_fail("--08", $type, 0); should_fail("--08", $type, 0); should_fail("--07", $type, 0); should_fail("--12", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--10','--12','--07','--04','--06','--07']}); should_fail("--08", $type, 0); should_fail("--02", $type, 0); should_fail("--03", $type, 0); should_fail("--05", $type, 0); should_fail("--03", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--04','--10','--04','--07','--11','--07','--07']}); should_fail("--01", $type, 0); should_fail("--12", $type, 0); should_fail("--06", $type, 0); should_fail("--05", $type, 0); should_fail("--03", $type, 0); done_testing; }; subtest "Type atomic/gMonth is restricted by facet enumeration." => sub { my $type = mk_type('GMonth', {'enumeration' => ['--08','--04','--05','--09','--05','--10','--12','--10']}); should_fail("--03", $type, 0); should_fail("--07", $type, 0); should_fail("--03", $type, 0); should_fail("--11", $type, 0); should_fail("--03", $type, 0); done_testing; }; done_testing; 50gMonthDay.t000664001750001750 5210312404317273 14570 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --01-01." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--01-01'}); should_pass("--01-02", $type, 0); should_pass("--01-14", $type, 0); should_pass("--07-21", $type, 0); should_pass("--07-11", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --10-23." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--10-23'}); should_pass("--10-24", $type, 0); should_pass("--11-28", $type, 0); should_pass("--12-30", $type, 0); should_pass("--12-13", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --06-21." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--06-21'}); should_pass("--06-22", $type, 0); should_pass("--11-30", $type, 0); should_pass("--12-22", $type, 0); should_pass("--09-27", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --01-01." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--01-01'}); should_pass("--01-02", $type, 0); should_pass("--12-08", $type, 0); should_pass("--01-17", $type, 0); should_pass("--02-16", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --12-30." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--12-30'}); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --01-01." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--01-01'}); should_pass("--01-01", $type, 0); should_pass("--11-14", $type, 0); should_pass("--01-29", $type, 0); should_pass("--09-11", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --06-11." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--06-11'}); should_pass("--06-11", $type, 0); should_pass("--11-30", $type, 0); should_pass("--12-19", $type, 0); should_pass("--10-20", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --07-02." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--07-02'}); should_pass("--07-02", $type, 0); should_pass("--07-19", $type, 0); should_pass("--11-16", $type, 0); should_pass("--07-22", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --03-04." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--03-04'}); should_pass("--03-04", $type, 0); should_pass("--03-09", $type, 0); should_pass("--04-19", $type, 0); should_pass("--05-18", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --12-31." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--12-31'}); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --01-02." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--01-02'}); should_pass("--01-01", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --10-09." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--10-09'}); should_pass("--01-01", $type, 0); should_pass("--03-19", $type, 0); should_pass("--07-24", $type, 0); should_pass("--02-01", $type, 0); should_pass("--10-08", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --07-23." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--07-23'}); should_pass("--01-01", $type, 0); should_pass("--05-03", $type, 0); should_pass("--01-17", $type, 0); should_pass("--01-20", $type, 0); should_pass("--07-22", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --11-27." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--11-27'}); should_pass("--01-01", $type, 0); should_pass("--07-12", $type, 0); should_pass("--03-03", $type, 0); should_pass("--08-25", $type, 0); should_pass("--11-26", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --12-31." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--12-31'}); should_pass("--01-01", $type, 0); should_pass("--07-29", $type, 0); should_pass("--10-26", $type, 0); should_pass("--02-01", $type, 0); should_pass("--12-30", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --01-01." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--01-01'}); should_pass("--01-01", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --02-24." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--02-24'}); should_pass("--01-01", $type, 0); should_pass("--02-11", $type, 0); should_pass("--01-22", $type, 0); should_pass("--02-01", $type, 0); should_pass("--02-24", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --06-11." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--06-11'}); should_pass("--01-01", $type, 0); should_pass("--01-05", $type, 0); should_pass("--05-21", $type, 0); should_pass("--02-23", $type, 0); should_pass("--06-11", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --07-01." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--07-01'}); should_pass("--01-01", $type, 0); should_pass("--06-24", $type, 0); should_pass("--01-03", $type, 0); should_pass("--03-15", $type, 0); should_pass("--07-01", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --12-31." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--12-31'}); should_pass("--01-01", $type, 0); should_pass("--11-28", $type, 0); should_pass("--07-29", $type, 0); should_pass("--05-03", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --\\d2-1\\d." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--\d2-1\d$)/}); should_pass("--02-13", $type, 0); should_pass("--02-13", $type, 0); should_pass("--02-17", $type, 0); should_pass("--02-17", $type, 0); should_pass("--02-12", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --\\d1-2\\d." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--\d1-2\d$)/}); should_pass("--01-25", $type, 0); should_pass("--01-22", $type, 0); should_pass("--01-24", $type, 0); should_pass("--01-23", $type, 0); should_pass("--01-25", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --0\\d-\\d8." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--0\d-\d8$)/}); should_pass("--07-08", $type, 0); should_pass("--08-18", $type, 0); should_pass("--09-28", $type, 0); should_pass("--02-18", $type, 0); should_pass("--05-18", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --\\d3-0\\d." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--\d3-0\d$)/}); should_pass("--03-01", $type, 0); should_pass("--03-04", $type, 0); should_pass("--03-03", $type, 0); should_pass("--03-01", $type, 0); should_pass("--03-06", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --0\\d-1\\d." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--0\d-1\d$)/}); should_pass("--05-11", $type, 0); should_pass("--05-15", $type, 0); should_pass("--07-17", $type, 0); should_pass("--03-16", $type, 0); should_pass("--05-17", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--08-18','--08-19','--05-19','--11-08','--09-16','--05-29','--11-18','--07-05']}); should_pass("--11-18", $type, 0); should_pass("--11-18", $type, 0); should_pass("--08-18", $type, 0); should_pass("--11-08", $type, 0); should_pass("--08-19", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--09-24','--01-28','--08-31','--08-20','--12-06']}); should_pass("--12-06", $type, 0); should_pass("--08-20", $type, 0); should_pass("--08-20", $type, 0); should_pass("--08-20", $type, 0); should_pass("--01-28", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--12-23','--07-11','--06-24','--10-27','--09-07','--03-29','--12-01','--01-29','--07-09','--10-05']}); should_pass("--07-09", $type, 0); should_pass("--12-01", $type, 0); should_pass("--01-29", $type, 0); should_pass("--10-27", $type, 0); should_pass("--07-09", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--06-07','--11-20','--01-29','--11-11','--11-17','--05-08','--07-06','--12-01','--05-07','--09-03']}); should_pass("--07-06", $type, 0); should_pass("--01-29", $type, 0); should_pass("--06-07", $type, 0); should_pass("--05-08", $type, 0); should_pass("--05-08", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--05-21','--09-18','--03-28','--04-03','--09-13','--08-07','--07-11','--09-03','--02-23']}); should_pass("--09-13", $type, 0); should_pass("--09-03", $type, 0); should_pass("--02-23", $type, 0); should_pass("--09-13", $type, 0); should_pass("--03-28", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('GMonthDay', {'whiteSpace' => 'collapse'}); should_pass("--01-01", $type, 0); should_pass("--04-14", $type, 0); should_pass("--02-09", $type, 0); should_pass("--08-09", $type, 0); should_pass("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --08-23." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--08-23'}); should_fail("--01-01", $type, 0); should_fail("--07-12", $type, 0); should_fail("--07-21", $type, 0); should_fail("--07-05", $type, 0); should_fail("--08-22", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --06-04." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--06-04'}); should_fail("--01-01", $type, 0); should_fail("--03-03", $type, 0); should_fail("--01-06", $type, 0); should_fail("--04-04", $type, 0); should_fail("--06-03", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --07-26." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--07-26'}); should_fail("--01-01", $type, 0); should_fail("--07-14", $type, 0); should_fail("--03-23", $type, 0); should_fail("--03-26", $type, 0); should_fail("--07-25", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --04-03." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--04-03'}); should_fail("--01-01", $type, 0); should_fail("--03-04", $type, 0); should_fail("--01-26", $type, 0); should_fail("--01-21", $type, 0); should_fail("--04-02", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minInclusive with value --12-31." => sub { my $type = mk_type('GMonthDay', {'minInclusive' => '--12-31'}); should_fail("--01-01", $type, 0); should_fail("--01-13", $type, 0); should_fail("--09-28", $type, 0); should_fail("--04-05", $type, 0); should_fail("--12-30", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --01-01." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--01-01'}); should_fail("--01-02", $type, 0); should_fail("--05-02", $type, 0); should_fail("--03-27", $type, 0); should_fail("--01-16", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --07-17." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--07-17'}); should_fail("--07-18", $type, 0); should_fail("--09-25", $type, 0); should_fail("--10-07", $type, 0); should_fail("--08-10", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --08-08." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--08-08'}); should_fail("--08-09", $type, 0); should_fail("--11-18", $type, 0); should_fail("--10-10", $type, 0); should_fail("--09-03", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --10-12." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--10-12'}); should_fail("--10-13", $type, 0); should_fail("--11-05", $type, 0); should_fail("--11-10", $type, 0); should_fail("--10-30", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxInclusive with value --10-20." => sub { my $type = mk_type('GMonthDay', {'maxInclusive' => '--10-20'}); should_fail("--10-21", $type, 0); should_fail("--12-05", $type, 0); should_fail("--11-30", $type, 0); should_fail("--12-18", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --01-01." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--01-01'}); should_fail("--01-01", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --11-02." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--11-02'}); should_fail("--01-01", $type, 0); should_fail("--08-11", $type, 0); should_fail("--04-10", $type, 0); should_fail("--03-28", $type, 0); should_fail("--11-02", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --07-10." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--07-10'}); should_fail("--01-01", $type, 0); should_fail("--04-19", $type, 0); should_fail("--05-01", $type, 0); should_fail("--01-27", $type, 0); should_fail("--07-10", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --12-26." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--12-26'}); should_fail("--01-01", $type, 0); should_fail("--10-22", $type, 0); should_fail("--03-26", $type, 0); should_fail("--08-29", $type, 0); should_fail("--12-26", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet minExclusive with value --12-30." => sub { my $type = mk_type('GMonthDay', {'minExclusive' => '--12-30'}); should_fail("--01-01", $type, 0); should_fail("--03-15", $type, 0); should_fail("--03-23", $type, 0); should_fail("--08-22", $type, 0); should_fail("--12-30", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --01-02." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--01-02'}); should_fail("--01-02", $type, 0); should_fail("--10-23", $type, 0); should_fail("--08-12", $type, 0); should_fail("--05-31", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --06-29." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--06-29'}); should_fail("--06-29", $type, 0); should_fail("--11-02", $type, 0); should_fail("--07-28", $type, 0); should_fail("--10-19", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --05-20." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--05-20'}); should_fail("--05-20", $type, 0); should_fail("--07-14", $type, 0); should_fail("--08-06", $type, 0); should_fail("--09-09", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --01-11." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--01-11'}); should_fail("--01-11", $type, 0); should_fail("--10-24", $type, 0); should_fail("--07-10", $type, 0); should_fail("--02-05", $type, 0); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet maxExclusive with value --12-31." => sub { my $type = mk_type('GMonthDay', {'maxExclusive' => '--12-31'}); should_fail("--12-31", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --\\d1-1\\d." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--\d1-1\d$)/}); should_fail("--04-04", $type, 0); should_fail("--06-07", $type, 0); should_fail("--08-03", $type, 0); should_fail("--05-04", $type, 0); should_fail("--08-23", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --\\d6-\\d8." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--\d6-\d8$)/}); should_fail("--08-21", $type, 0); should_fail("--03-06", $type, 0); should_fail("--07-12", $type, 0); should_fail("--05-15", $type, 0); should_fail("--05-24", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --0\\d-\\d0." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--0\d-\d0$)/}); should_fail("--10-17", $type, 0); should_fail("--12-24", $type, 0); should_fail("--11-14", $type, 0); should_fail("--11-04", $type, 0); should_fail("--12-15", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --0\\d-\\d6." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--0\d-\d6$)/}); should_fail("--10-14", $type, 0); should_fail("--10-18", $type, 0); should_fail("--11-11", $type, 0); should_fail("--11-03", $type, 0); should_fail("--11-14", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet pattern with value --\\d5-\\d9." => sub { my $type = mk_type('GMonthDay', {'pattern' => qr/(?ms:^--\d5-\d9$)/}); should_fail("--03-17", $type, 0); should_fail("--08-16", $type, 0); should_fail("--07-17", $type, 0); should_fail("--08-20", $type, 0); should_fail("--08-22", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--06-17','--09-05','--12-30','--08-16','--10-22','--03-31','--05-10','--08-07','--10-03']}); should_fail("--04-12", $type, 0); should_fail("--03-26", $type, 0); should_fail("--04-29", $type, 0); should_fail("--09-09", $type, 0); should_fail("--03-12", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--10-14','--12-08','--01-22','--09-23','--08-09']}); should_fail("--07-13", $type, 0); should_fail("--06-15", $type, 0); should_fail("--12-04", $type, 0); should_fail("--04-21", $type, 0); should_fail("--07-05", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--03-16','--01-30','--11-04','--06-25','--03-08','--09-19','--04-26','--03-27']}); should_fail("--02-15", $type, 0); should_fail("--11-29", $type, 0); should_fail("--03-04", $type, 0); should_fail("--05-09", $type, 0); should_fail("--10-29", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--07-17','--08-11','--06-27','--11-23','--12-01','--02-23']}); should_fail("--08-07", $type, 0); should_fail("--04-06", $type, 0); should_fail("--12-27", $type, 0); should_fail("--02-27", $type, 0); should_fail("--09-18", $type, 0); done_testing; }; subtest "Type atomic/gMonthDay is restricted by facet enumeration." => sub { my $type = mk_type('GMonthDay', {'enumeration' => ['--06-11','--04-09','--04-03','--06-02','--04-16']}); should_fail("--04-24", $type, 0); should_fail("--09-22", $type, 0); should_fail("--08-13", $type, 0); should_fail("--11-16", $type, 0); should_fail("--11-06", $type, 0); done_testing; }; done_testing; 50gYear.t000664001750001750 4640312404317273 13753 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/gYear is restricted by facet minExclusive with value 1970." => sub { my $type = mk_type('GYear', {'minExclusive' => '1970'}); should_pass("1971", $type, 0); should_pass("1975", $type, 0); should_pass("2019", $type, 0); should_pass("1979", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 2008." => sub { my $type = mk_type('GYear', {'minExclusive' => '2008'}); should_pass("2009", $type, 0); should_pass("2020", $type, 0); should_pass("2024", $type, 0); should_pass("2026", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 2025." => sub { my $type = mk_type('GYear', {'minExclusive' => '2025'}); should_pass("2026", $type, 0); should_pass("2029", $type, 0); should_pass("2029", $type, 0); should_pass("2029", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 2012." => sub { my $type = mk_type('GYear', {'minExclusive' => '2012'}); should_pass("2013", $type, 0); should_pass("2016", $type, 0); should_pass("2023", $type, 0); should_pass("2017", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 2029." => sub { my $type = mk_type('GYear', {'minExclusive' => '2029'}); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 1970." => sub { my $type = mk_type('GYear', {'minInclusive' => '1970'}); should_pass("1970", $type, 0); should_pass("2013", $type, 0); should_pass("1990", $type, 0); should_pass("1992", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 2010." => sub { my $type = mk_type('GYear', {'minInclusive' => '2010'}); should_pass("2010", $type, 0); should_pass("2028", $type, 0); should_pass("2026", $type, 0); should_pass("2011", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 1974." => sub { my $type = mk_type('GYear', {'minInclusive' => '1974'}); should_pass("1974", $type, 0); should_pass("2012", $type, 0); should_pass("1981", $type, 0); should_pass("1998", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 1997." => sub { my $type = mk_type('GYear', {'minInclusive' => '1997'}); should_pass("1997", $type, 0); should_pass("2015", $type, 0); should_pass("2021", $type, 0); should_pass("2028", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 2030." => sub { my $type = mk_type('GYear', {'minInclusive' => '2030'}); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 1971." => sub { my $type = mk_type('GYear', {'maxExclusive' => '1971'}); should_pass("1970", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2022." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2022'}); should_pass("1970", $type, 0); should_pass("1973", $type, 0); should_pass("1983", $type, 0); should_pass("1971", $type, 0); should_pass("2021", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2003." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2003'}); should_pass("1970", $type, 0); should_pass("1973", $type, 0); should_pass("1991", $type, 0); should_pass("1996", $type, 0); should_pass("2002", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2005." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2005'}); should_pass("1970", $type, 0); should_pass("1984", $type, 0); should_pass("1982", $type, 0); should_pass("1998", $type, 0); should_pass("2004", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2030." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2030'}); should_pass("1970", $type, 0); should_pass("2022", $type, 0); should_pass("1971", $type, 0); should_pass("2008", $type, 0); should_pass("2029", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1970." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1970'}); should_pass("1970", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1975." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1975'}); should_pass("1970", $type, 0); should_pass("1974", $type, 0); should_pass("1971", $type, 0); should_pass("1974", $type, 0); should_pass("1975", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 2019." => sub { my $type = mk_type('GYear', {'maxInclusive' => '2019'}); should_pass("1970", $type, 0); should_pass("1975", $type, 0); should_pass("1976", $type, 0); should_pass("2001", $type, 0); should_pass("2019", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1998." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1998'}); should_pass("1970", $type, 0); should_pass("1994", $type, 0); should_pass("1992", $type, 0); should_pass("1987", $type, 0); should_pass("1998", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 2030." => sub { my $type = mk_type('GYear', {'maxInclusive' => '2030'}); should_pass("1970", $type, 0); should_pass("2028", $type, 0); should_pass("2002", $type, 0); should_pass("2020", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d47." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d47$)/}); should_pass("2047", $type, 0); should_pass("1847", $type, 0); should_pass("2047", $type, 0); should_pass("1947", $type, 0); should_pass("1947", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d61." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d61$)/}); should_pass("1961", $type, 0); should_pass("1861", $type, 0); should_pass("1761", $type, 0); should_pass("2061", $type, 0); should_pass("1861", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d86." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d86$)/}); should_pass("2086", $type, 0); should_pass("2086", $type, 0); should_pass("1886", $type, 0); should_pass("1786", $type, 0); should_pass("1986", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d14." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d14$)/}); should_pass("1814", $type, 0); should_pass("1814", $type, 0); should_pass("1914", $type, 0); should_pass("1814", $type, 0); should_pass("1914", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d21." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d21$)/}); should_pass("1921", $type, 0); should_pass("1821", $type, 0); should_pass("1921", $type, 0); should_pass("1921", $type, 0); should_pass("1821", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2028','1999','1998','1995','2021','2006','2007','2015']}); should_pass("2006", $type, 0); should_pass("1999", $type, 0); should_pass("2028", $type, 0); should_pass("2006", $type, 0); should_pass("1999", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2007','2020','1999','2011','1976','1984','1972','1992','2018']}); should_pass("1976", $type, 0); should_pass("2018", $type, 0); should_pass("1976", $type, 0); should_pass("2011", $type, 0); should_pass("2020", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2004','2004','2014','1991','2001','2021']}); should_pass("2004", $type, 0); should_pass("2004", $type, 0); should_pass("1991", $type, 0); should_pass("2014", $type, 0); should_pass("2004", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['1978','2027','2007','1970','2021','2016','2014','2015','2023','2002']}); should_pass("2015", $type, 0); should_pass("2007", $type, 0); should_pass("2027", $type, 0); should_pass("2021", $type, 0); should_pass("2027", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2020','1988','1982','2000','1985','1994']}); should_pass("2000", $type, 0); should_pass("2020", $type, 0); should_pass("1982", $type, 0); should_pass("1982", $type, 0); should_pass("1982", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('GYear', {'whiteSpace' => 'collapse'}); should_pass("1970", $type, 0); should_pass("2006", $type, 0); should_pass("1981", $type, 0); should_pass("1979", $type, 0); should_pass("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 2019." => sub { my $type = mk_type('GYear', {'minInclusive' => '2019'}); should_fail("1970", $type, 0); should_fail("1991", $type, 0); should_fail("1978", $type, 0); should_fail("1984", $type, 0); should_fail("2018", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 2019." => sub { my $type = mk_type('GYear', {'minInclusive' => '2019'}); should_fail("1970", $type, 0); should_fail("1972", $type, 0); should_fail("2008", $type, 0); should_fail("2009", $type, 0); should_fail("2018", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 2017." => sub { my $type = mk_type('GYear', {'minInclusive' => '2017'}); should_fail("1970", $type, 0); should_fail("2004", $type, 0); should_fail("1999", $type, 0); should_fail("1974", $type, 0); should_fail("2016", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 1980." => sub { my $type = mk_type('GYear', {'minInclusive' => '1980'}); should_fail("1970", $type, 0); should_fail("1976", $type, 0); should_fail("1977", $type, 0); should_fail("1974", $type, 0); should_fail("1979", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minInclusive with value 2030." => sub { my $type = mk_type('GYear', {'minInclusive' => '2030'}); should_fail("1970", $type, 0); should_fail("1973", $type, 0); should_fail("1976", $type, 0); should_fail("2009", $type, 0); should_fail("2029", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1970." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1970'}); should_fail("1971", $type, 0); should_fail("1994", $type, 0); should_fail("2005", $type, 0); should_fail("2025", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1978." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1978'}); should_fail("1979", $type, 0); should_fail("1982", $type, 0); should_fail("2022", $type, 0); should_fail("2011", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1993." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1993'}); should_fail("1994", $type, 0); should_fail("2000", $type, 0); should_fail("2003", $type, 0); should_fail("2018", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1985." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1985'}); should_fail("1986", $type, 0); should_fail("1997", $type, 0); should_fail("2012", $type, 0); should_fail("2017", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxInclusive with value 1982." => sub { my $type = mk_type('GYear', {'maxInclusive' => '1982'}); should_fail("1983", $type, 0); should_fail("2021", $type, 0); should_fail("1990", $type, 0); should_fail("2027", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 1970." => sub { my $type = mk_type('GYear', {'minExclusive' => '1970'}); should_fail("1970", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 2019." => sub { my $type = mk_type('GYear', {'minExclusive' => '2019'}); should_fail("1970", $type, 0); should_fail("1999", $type, 0); should_fail("1997", $type, 0); should_fail("2017", $type, 0); should_fail("2019", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 1993." => sub { my $type = mk_type('GYear', {'minExclusive' => '1993'}); should_fail("1970", $type, 0); should_fail("1976", $type, 0); should_fail("1990", $type, 0); should_fail("1987", $type, 0); should_fail("1993", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 1988." => sub { my $type = mk_type('GYear', {'minExclusive' => '1988'}); should_fail("1970", $type, 0); should_fail("1983", $type, 0); should_fail("1987", $type, 0); should_fail("1973", $type, 0); should_fail("1988", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet minExclusive with value 2029." => sub { my $type = mk_type('GYear', {'minExclusive' => '2029'}); should_fail("1970", $type, 0); should_fail("1986", $type, 0); should_fail("1994", $type, 0); should_fail("2021", $type, 0); should_fail("2029", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 1971." => sub { my $type = mk_type('GYear', {'maxExclusive' => '1971'}); should_fail("1971", $type, 0); should_fail("1983", $type, 0); should_fail("2019", $type, 0); should_fail("2029", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 1993." => sub { my $type = mk_type('GYear', {'maxExclusive' => '1993'}); should_fail("1993", $type, 0); should_fail("2025", $type, 0); should_fail("2010", $type, 0); should_fail("2003", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2014." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2014'}); should_fail("2014", $type, 0); should_fail("2023", $type, 0); should_fail("2021", $type, 0); should_fail("2027", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2011." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2011'}); should_fail("2011", $type, 0); should_fail("2019", $type, 0); should_fail("2016", $type, 0); should_fail("2026", $type, 0); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet maxExclusive with value 2030." => sub { my $type = mk_type('GYear', {'maxExclusive' => '2030'}); should_fail("2030", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d06." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d06$)/}); should_fail("1835", $type, 0); should_fail("1871", $type, 0); should_fail("1999", $type, 0); should_fail("2095", $type, 0); should_fail("1829", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value 19\\d\\d." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^19\d\d$)/}); should_fail("1802", $type, 0); should_fail("2010", $type, 0); should_fail("1825", $type, 0); should_fail("1711", $type, 0); should_fail("2079", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value 17\\d\\d." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^17\d\d$)/}); should_fail("1959", $type, 0); should_fail("1934", $type, 0); should_fail("1983", $type, 0); should_fail("2022", $type, 0); should_fail("1839", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d66." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d66$)/}); should_fail("2026", $type, 0); should_fail("1928", $type, 0); should_fail("1873", $type, 0); should_fail("1908", $type, 0); should_fail("2008", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet pattern with value \\d\\d77." => sub { my $type = mk_type('GYear', {'pattern' => qr/(?ms:^\d\d77$)/}); should_fail("1802", $type, 0); should_fail("1864", $type, 0); should_fail("1851", $type, 0); should_fail("1707", $type, 0); should_fail("2015", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['1979','1992','2022','1976','2021','1995']}); should_fail("1987", $type, 0); should_fail("1983", $type, 0); should_fail("1975", $type, 0); should_fail("2023", $type, 0); should_fail("2010", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2014','2026','1976','1979','2001','1992','1974','2011','1977']}); should_fail("1990", $type, 0); should_fail("2027", $type, 0); should_fail("1990", $type, 0); should_fail("1970", $type, 0); should_fail("1970", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['1977','1984','1975','2024','1971','1984','2026']}); should_fail("1987", $type, 0); should_fail("1989", $type, 0); should_fail("1987", $type, 0); should_fail("1997", $type, 0); should_fail("2009", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2018','2015','2028','1975','1996','2019','1998','1995']}); should_fail("2006", $type, 0); should_fail("1987", $type, 0); should_fail("1997", $type, 0); should_fail("2027", $type, 0); should_fail("1994", $type, 0); done_testing; }; subtest "Type atomic/gYear is restricted by facet enumeration." => sub { my $type = mk_type('GYear', {'enumeration' => ['2007','2028','1986','1990','2003','2003']}); should_fail("1993", $type, 0); should_fail("1989", $type, 0); should_fail("2015", $type, 0); should_fail("2026", $type, 0); should_fail("1999", $type, 0); done_testing; }; done_testing; 50gYearMonth.t000664001750001750 5227512404317273 14765 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 1970-01." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '1970-01'}); should_pass("1970-02", $type, 0); should_pass("1995-03", $type, 0); should_pass("2012-10", $type, 0); should_pass("2001-06", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 2030-01." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '2030-01'}); should_pass("2030-02", $type, 0); should_pass("2030-10", $type, 0); should_pass("2030-08", $type, 0); should_pass("2030-06", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 2029-04." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '2029-04'}); should_pass("2029-05", $type, 0); should_pass("2030-03", $type, 0); should_pass("2030-02", $type, 0); should_pass("2030-01", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 1970-06." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '1970-06'}); should_pass("1970-07", $type, 0); should_pass("1982-10", $type, 0); should_pass("1989-07", $type, 0); should_pass("1993-10", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 2030-11." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '2030-11'}); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1970-01." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1970-01'}); should_pass("1970-01", $type, 0); should_pass("2010-04", $type, 0); should_pass("2016-04", $type, 0); should_pass("2001-05", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 2012-02." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '2012-02'}); should_pass("2012-02", $type, 0); should_pass("2013-02", $type, 0); should_pass("2012-04", $type, 0); should_pass("2030-11", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1974-11." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1974-11'}); should_pass("1974-11", $type, 0); should_pass("1998-12", $type, 0); should_pass("1979-10", $type, 0); should_pass("2030-08", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1988-05." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1988-05'}); should_pass("1988-05", $type, 0); should_pass("2017-08", $type, 0); should_pass("2018-09", $type, 0); should_pass("1993-01", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 2030-12." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '2030-12'}); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1970-02." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1970-02'}); should_pass("1970-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1983-06." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1983-06'}); should_pass("1970-01", $type, 0); should_pass("1976-09", $type, 0); should_pass("1981-04", $type, 0); should_pass("1977-01", $type, 0); should_pass("1983-05", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1971-05." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1971-05'}); should_pass("1970-01", $type, 0); should_pass("1970-08", $type, 0); should_pass("1971-02", $type, 0); should_pass("1971-04", $type, 0); should_pass("1971-04", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1981-02." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1981-02'}); should_pass("1970-01", $type, 0); should_pass("1978-11", $type, 0); should_pass("1970-10", $type, 0); should_pass("1978-11", $type, 0); should_pass("1981-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 2030-12." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '2030-12'}); should_pass("1970-01", $type, 0); should_pass("1995-06", $type, 0); should_pass("1981-08", $type, 0); should_pass("2001-12", $type, 0); should_pass("2030-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 1970-01." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '1970-01'}); should_pass("1970-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 2010-06." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '2010-06'}); should_pass("1970-01", $type, 0); should_pass("1994-07", $type, 0); should_pass("1971-10", $type, 0); should_pass("1985-10", $type, 0); should_pass("2010-06", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 1986-01." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '1986-01'}); should_pass("1970-01", $type, 0); should_pass("1972-02", $type, 0); should_pass("1976-12", $type, 0); should_pass("1975-11", $type, 0); should_pass("1986-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 2014-07." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '2014-07'}); should_pass("1970-01", $type, 0); should_pass("2007-06", $type, 0); should_pass("1984-02", $type, 0); should_pass("1981-10", $type, 0); should_pass("2014-07", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 2030-12." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '2030-12'}); should_pass("1970-01", $type, 0); should_pass("1981-09", $type, 0); should_pass("1999-10", $type, 0); should_pass("2012-01", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value 17\\d\\d-\\d1." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^17\d\d-\d1$)/}); should_pass("1747-01", $type, 0); should_pass("1726-01", $type, 0); should_pass("1790-01", $type, 0); should_pass("1781-01", $type, 0); should_pass("1701-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value \\d\\d31-\\d3." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^\d\d31-\d3$)/}); should_pass("1831-03", $type, 0); should_pass("1831-03", $type, 0); should_pass("2031-03", $type, 0); should_pass("2031-03", $type, 0); should_pass("1831-03", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value \\d\\d76-0\\d." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^\d\d76-0\d$)/}); should_pass("1876-08", $type, 0); should_pass("1876-09", $type, 0); should_pass("1876-05", $type, 0); should_pass("1976-08", $type, 0); should_pass("1876-03", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value 17\\d\\d-0\\d." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^17\d\d-0\d$)/}); should_pass("1718-04", $type, 0); should_pass("1709-06", $type, 0); should_pass("1710-08", $type, 0); should_pass("1704-07", $type, 0); should_pass("1797-03", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value 18\\d\\d-\\d2." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^18\d\d-\d2$)/}); should_pass("1866-02", $type, 0); should_pass("1864-02", $type, 0); should_pass("1877-02", $type, 0); should_pass("1887-02", $type, 0); should_pass("1833-02", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['2017-03','2028-04','1980-03','2014-08','2017-10']}); should_pass("2017-03", $type, 0); should_pass("2028-04", $type, 0); should_pass("2028-04", $type, 0); should_pass("1980-03", $type, 0); should_pass("2014-08", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['2017-08','1986-04','2000-01','2015-06','2010-09','2002-07','2020-10','2012-02']}); should_pass("2010-09", $type, 0); should_pass("1986-04", $type, 0); should_pass("2015-06", $type, 0); should_pass("2010-09", $type, 0); should_pass("2000-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['1978-12','2002-12','2001-09','1972-08','1973-09']}); should_pass("2001-09", $type, 0); should_pass("2001-09", $type, 0); should_pass("2001-09", $type, 0); should_pass("1978-12", $type, 0); should_pass("1972-08", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['1984-02','2007-01','2027-09','1974-01','2006-11','2007-11']}); should_pass("2027-09", $type, 0); should_pass("2027-09", $type, 0); should_pass("1974-01", $type, 0); should_pass("2007-11", $type, 0); should_pass("2027-09", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['2020-08','2027-03','1991-12','1978-06','1992-07','1998-08','2027-02','2013-02']}); should_pass("1991-12", $type, 0); should_pass("2027-03", $type, 0); should_pass("1991-12", $type, 0); should_pass("1991-12", $type, 0); should_pass("1998-08", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('GYearMonth', {'whiteSpace' => 'collapse'}); should_pass("1970-01", $type, 0); should_pass("1985-10", $type, 0); should_pass("1988-04", $type, 0); should_pass("2013-03", $type, 0); should_pass("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1975-10." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1975-10'}); should_fail("1970-01", $type, 0); should_fail("1975-02", $type, 0); should_fail("1972-09", $type, 0); should_fail("1970-07", $type, 0); should_fail("1975-09", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1998-12." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1998-12'}); should_fail("1970-01", $type, 0); should_fail("1990-10", $type, 0); should_fail("1998-06", $type, 0); should_fail("1985-06", $type, 0); should_fail("1998-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1997-07." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1997-07'}); should_fail("1970-01", $type, 0); should_fail("1993-03", $type, 0); should_fail("1971-11", $type, 0); should_fail("1992-03", $type, 0); should_fail("1997-06", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 1973-02." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '1973-02'}); should_fail("1970-01", $type, 0); should_fail("1970-12", $type, 0); should_fail("1971-10", $type, 0); should_fail("1970-03", $type, 0); should_fail("1973-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minInclusive with value 2030-12." => sub { my $type = mk_type('GYearMonth', {'minInclusive' => '2030-12'}); should_fail("1970-01", $type, 0); should_fail("2022-02", $type, 0); should_fail("2010-09", $type, 0); should_fail("2012-08", $type, 0); should_fail("2030-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 1970-01." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '1970-01'}); should_fail("1970-02", $type, 0); should_fail("1997-03", $type, 0); should_fail("2005-06", $type, 0); should_fail("2029-12", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 1977-09." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '1977-09'}); should_fail("1977-10", $type, 0); should_fail("1982-06", $type, 0); should_fail("2000-11", $type, 0); should_fail("2013-09", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 1983-01." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '1983-01'}); should_fail("1983-02", $type, 0); should_fail("2018-02", $type, 0); should_fail("2002-05", $type, 0); should_fail("1996-09", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 1971-08." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '1971-08'}); should_fail("1971-09", $type, 0); should_fail("1997-08", $type, 0); should_fail("1996-10", $type, 0); should_fail("2022-06", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxInclusive with value 2004-01." => sub { my $type = mk_type('GYearMonth', {'maxInclusive' => '2004-01'}); should_fail("2004-02", $type, 0); should_fail("2012-02", $type, 0); should_fail("2019-09", $type, 0); should_fail("2027-06", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 1970-01." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '1970-01'}); should_fail("1970-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 2009-09." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '2009-09'}); should_fail("1970-01", $type, 0); should_fail("1994-07", $type, 0); should_fail("1992-03", $type, 0); should_fail("1996-11", $type, 0); should_fail("2009-09", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 2018-11." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '2018-11'}); should_fail("1970-01", $type, 0); should_fail("1972-10", $type, 0); should_fail("1978-05", $type, 0); should_fail("2018-03", $type, 0); should_fail("2018-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 1982-07." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '1982-07'}); should_fail("1970-01", $type, 0); should_fail("1979-08", $type, 0); should_fail("1976-04", $type, 0); should_fail("1975-10", $type, 0); should_fail("1982-07", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet minExclusive with value 2030-11." => sub { my $type = mk_type('GYearMonth', {'minExclusive' => '2030-11'}); should_fail("1970-01", $type, 0); should_fail("1997-04", $type, 0); should_fail("2018-05", $type, 0); should_fail("2022-06", $type, 0); should_fail("2030-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1970-02." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1970-02'}); should_fail("1970-02", $type, 0); should_fail("2005-03", $type, 0); should_fail("2011-06", $type, 0); should_fail("2021-05", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 2014-09." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '2014-09'}); should_fail("2014-09", $type, 0); should_fail("2026-08", $type, 0); should_fail("2030-08", $type, 0); should_fail("2019-06", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1995-01." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1995-01'}); should_fail("1995-01", $type, 0); should_fail("2015-07", $type, 0); should_fail("2009-04", $type, 0); should_fail("2012-05", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 1979-10." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '1979-10'}); should_fail("1979-10", $type, 0); should_fail("2017-11", $type, 0); should_fail("2013-05", $type, 0); should_fail("2005-10", $type, 0); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet maxExclusive with value 2030-12." => sub { my $type = mk_type('GYearMonth', {'maxExclusive' => '2030-12'}); should_fail("2030-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value \\d\\d10-0\\d." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^\d\d10-0\d$)/}); should_fail("1959-12", $type, 0); should_fail("1856-11", $type, 0); should_fail("2028-11", $type, 0); should_fail("1829-10", $type, 0); should_fail("1796-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value 19\\d\\d-0\\d." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^19\d\d-0\d$)/}); should_fail("1854-11", $type, 0); should_fail("1853-10", $type, 0); should_fail("1829-10", $type, 0); should_fail("1728-10", $type, 0); should_fail("1883-12", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value 19\\d\\d-\\d6." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^19\d\d-\d6$)/}); should_fail("1806-04", $type, 0); should_fail("1831-05", $type, 0); should_fail("1888-04", $type, 0); should_fail("1850-02", $type, 0); should_fail("2025-03", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value \\d\\d54-0\\d." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^\d\d54-0\d$)/}); should_fail("1994-10", $type, 0); should_fail("1791-12", $type, 0); should_fail("2056-10", $type, 0); should_fail("1987-11", $type, 0); should_fail("1885-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet pattern with value \\d\\d41-\\d2." => sub { my $type = mk_type('GYearMonth', {'pattern' => qr/(?ms:^\d\d41-\d2$)/}); should_fail("1862-03", $type, 0); should_fail("1869-07", $type, 0); should_fail("1847-04", $type, 0); should_fail("1759-06", $type, 0); should_fail("1768-08", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['2021-10','2022-04','1972-07','1993-07','1998-03','2023-02','2015-04','1994-08']}); should_fail("1981-09", $type, 0); should_fail("2022-01", $type, 0); should_fail("2008-05", $type, 0); should_fail("2013-11", $type, 0); should_fail("2003-10", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['1992-01','1977-04','2002-11','2007-11','1987-06','1973-10','1981-03','2009-03','1998-01','2030-06']}); should_fail("2027-07", $type, 0); should_fail("1978-05", $type, 0); should_fail("2013-05", $type, 0); should_fail("2010-06", $type, 0); should_fail("1999-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['1970-11','1998-12','2002-10','1974-08','2009-10','1982-05','2005-02','1984-01','2019-10']}); should_fail("2008-10", $type, 0); should_fail("1983-05", $type, 0); should_fail("1974-09", $type, 0); should_fail("1982-09", $type, 0); should_fail("2026-01", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['1977-11','2013-06','2009-03','1990-01','2027-11']}); should_fail("2020-08", $type, 0); should_fail("2030-08", $type, 0); should_fail("2024-04", $type, 0); should_fail("2021-01", $type, 0); should_fail("1978-11", $type, 0); done_testing; }; subtest "Type atomic/gYearMonth is restricted by facet enumeration." => sub { my $type = mk_type('GYearMonth', {'enumeration' => ['2003-07','2020-06','2013-03','1976-03','1995-10','2019-04','1989-04','1991-05']}); should_fail("2016-02", $type, 0); should_fail("1972-04", $type, 0); should_fail("1977-07", $type, 0); should_fail("2017-06", $type, 0); should_fail("1973-09", $type, 0); done_testing; }; done_testing; 50hexBinary.t000664001750001750 5143012404317273 14631 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/hexBinary is restricted by facet maxLength with value 1." => sub { my $type = mk_type('HexBinary', {'maxLength' => '1'}); should_pass("71", $type, 0); should_pass("76", $type, 0); should_pass("77", $type, 0); should_pass("67", $type, 0); should_pass("79", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet maxLength with value 29." => sub { my $type = mk_type('HexBinary', {'maxLength' => '29'}); should_pass("6f", $type, 0); should_pass("636b647679747573", $type, 0); should_pass("6f7774697171766977747769697065", $type, 0); should_pass("686e75626463777362686a726472747078746d656f75", $type, 0); should_pass("767261756d6e6f726f707462687963777068676870786c6277756c686a", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet maxLength with value 7." => sub { my $type = mk_type('HexBinary', {'maxLength' => '7'}); should_pass("6f", $type, 0); should_pass("7774", $type, 0); should_pass("6a766f", $type, 0); should_pass("66646c68", $type, 0); should_pass("7676726d68", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet maxLength with value 6." => sub { my $type = mk_type('HexBinary', {'maxLength' => '6'}); should_pass("68", $type, 0); should_pass("7568", $type, 0); should_pass("626b71", $type, 0); should_pass("79757774", $type, 0); should_pass("6e6e6a666f", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet maxLength with value 74." => sub { my $type = mk_type('HexBinary', {'maxLength' => '74'}); should_pass("71", $type, 0); should_pass("6f6f6f697479676d63786c617769736e796b6b", $type, 0); should_pass("76796d7664777762686d6c766c726163737377626a686f767761637471636162796b706261", $type, 0); should_pass("6362696e6a666e6871726f657373756a71656e796470756866756765766a70706172696264687763716e77776276686876676e736a7762", $type, 0); should_pass("696e6d6f6f72706c7170666269637373746d736c6b746e75666e6b72626167766d70646371726f6a636173786c70627274636971786c6a78706e6a726574636b6c6f6b676871677073", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet minLength with value 1." => sub { my $type = mk_type('HexBinary', {'minLength' => '1'}); should_pass("73", $type, 0); should_pass("7176616c65796e636b6968706d78727068686f", $type, 0); should_pass("726d78636362786866667365666376686568766d78616165736e67756a746f746c79757262", $type, 0); should_pass("696267697273796f6275786162616b636e777272706e627262696a726372766975626a6f6d61706c6979656b747962677563726f6e756d", $type, 0); should_pass("70736e68776c76636a727873726f6b6e716e6f696979676e777365716473616f647461756b706b7666686f69786c6178777577626f71716568666f626f7968776c62786b7074677864", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet minLength with value 28." => sub { my $type = mk_type('HexBinary', {'minLength' => '28'}); should_pass("72707761716a6571706564686a6873726b7472656c6f616b6d6c6b77", $type, 0); should_pass("6e72676a6a6e61776b6f676c76616a7776676e7279616e70656b6d6b677466686374746b6c776e", $type, 0); should_pass("696e7270626562767870696464776773686963716b626c6762706d726573786579736c63697573646e63786778696c73776b", $type, 0); should_pass("77726365726371756f76706c66686e786a6761766f6879766d7069737376686171646d6466707562676f717879646a7971777765676c6c6478706c6867", $type, 0); should_pass("637366746e7564657066636f6e667161636472617368776b67646e6b6e7470627963696162696c6b7175746e626c6f706b787778716e766e646c6168726b726675716b6165746361", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet minLength with value 2." => sub { my $type = mk_type('HexBinary', {'minLength' => '2'}); should_pass("7965", $type, 0); should_pass("70786a7071636169626270636f786374666c6962", $type, 0); should_pass("75696a7571746d757878626a6e666f6f70776c6374616f6f65646f79797762726a6469676970", $type, 0); should_pass("77767578746e646d6b667861717375667965646f6f7679686863636a6e6a756277797979726c61626d6e666a64726b677767666866617765", $type, 0); should_pass("69766a63617879686a6b786f70716a7978687471636c6d79666b646767766d646471617970746d726c776971686c79617579666c6d626d75686d746d6562666878756162736363716f6c", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet minLength with value 48." => sub { my $type = mk_type('HexBinary', {'minLength' => '48'}); should_pass("6669726d66716874726b6a7669776f636c77687462677072796d67726373616f6d6a62676e71737662786d706e657361", $type, 0); should_pass("7076647968747279656174736a766a68726d7167796f67666c73656f7261756c6e716576796a68756e62646d67786f7776656a616572", $type, 0); should_pass("6a6562666d64656f7979716d737769706e63677064707474636f7471626e6b637973666d6e6a626879776f6b65716e62646d6a6470686f79636d7165", $type, 0); should_pass("6c6361646e766f616369686a6a6363786967746164646f6d6e616a6d69636d69636161636c79746a6b61666175736f676675696363786f756f6e667978706a797761", $type, 0); should_pass("78796276646a6f61646b6c6d6d70746c686e6c636971757273746e766e63696d6171677571696c666a6874626c74696365797975756875657377726674626d69706976766c6c7376", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet minLength with value 74." => sub { my $type = mk_type('HexBinary', {'minLength' => '74'}); should_pass("6c6e6f6f636375616170726576757375616b70776c6564737366636c66776e706c6669746d6c6d666d67766b6a6a776e6b79756e6367756e7864676778706e6874757078757179687179", $type, 0); should_pass("6e6a72616d72637170627874706c6e63716878746d6d636e776b646467716b7677676a6f71646762656b64617678776875656a63716f6d656e686e72656f7379667078756f61746e6c64", $type, 0); should_pass("736f6463647962746d797378787866646a6e65767472776961766270696176746c797172776679636f65646c7871666a637765736f64766e6275676c766c6e706178777570637168776c", $type, 0); should_pass("616b6f6a686d756a74756e7861746f757172766672766f66636c76657162637565687177767671796f6b7269686c6b6268726b6868726d6e736c74777166726c76626272786c76626264", $type, 0); should_pass("736b6d74726669796777796164756b706973786c747574746f6a786671766672736d736866697168776663626b7073686465716f64766c677275696676776479726263706a6a79616b6f", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet length with value 1." => sub { my $type = mk_type('HexBinary', {'length' => '1'}); should_pass("63", $type, 0); should_pass("77", $type, 0); should_pass("78", $type, 0); should_pass("77", $type, 0); should_pass("65", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet length with value 16." => sub { my $type = mk_type('HexBinary', {'length' => '16'}); should_pass("73756e6d646279637070646378667371", $type, 0); should_pass("696a7372617365727177786e76626274", $type, 0); should_pass("6e67676f66736a677468677077746668", $type, 0); should_pass("616c6b6b636377696e7265646e6e7678", $type, 0); should_pass("6c777676726b78736e61736a64766973", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet length with value 41." => sub { my $type = mk_type('HexBinary', {'length' => '41'}); should_pass("776c6a7870627864747264616e76637377706464696c736e6a637372756c736c696a66786c65796e6f", $type, 0); should_pass("6e7066747876756f6e71636d6a65656a746278707574706c6f7872746370676268686f6e7979767670", $type, 0); should_pass("7976726a686e70676d756a786c67756367667672747563767563797375706c6e7263796c6d796f746f", $type, 0); should_pass("74626c6575637874666f62716b6d7377636a7673626f70676a656e6f7862646569756d6b616d617972", $type, 0); should_pass("6f7470776c63616d6771636e756c6e716f64736f62677868726672736e77766d6d7272646562766365", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet length with value 68." => sub { my $type = mk_type('HexBinary', {'length' => '68'}); should_pass("61647361677962727668716261676e776777676764666a697478706f656f6d646d72696f7474796b74627672716470636d71617073617767626e697569746164776d6870", $type, 0); should_pass("6c71686d646d64687679646a686761737563666f696f73696f63787976696267706763616d786d647170767470706466726169636d7161716e78786974796a7767726565", $type, 0); should_pass("7675776d67747075716a677377686d6c6c617768616a77786574657972656973646e6c6a626c757172717374757576776b7968766d6d736875776d6273696e79636b7663", $type, 0); should_pass("68637564617068786a696a6762686c6c6d74776b7273647564656e726372666c6e6c63636c6e77787870616a6966656971746f74746f6572787870726d6874776f786268", $type, 0); should_pass("7262656f6e6c6467666a6f7568676f746668756f6f6f716766666a63736a7265687273676b636663756472696567686678736f7074636b67666f71736272756170706467", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet length with value 74." => sub { my $type = mk_type('HexBinary', {'length' => '74'}); should_pass("71617165766675796f7077626377736e796f62757475776a6363686e6570727665706379666c6d637074756e647075637775616871676161746b786a65687867616e747874786b617170", $type, 0); should_pass("6f6d636d71766b6679676b6e7169727276636a747961716464797066626d6474707671616a61707163796e75706f6561646b64676a6e7778746c6b7874767063706a6976777065767577", $type, 0); should_pass("787372716871736f6f616178707273707874687562696177616f6c637677686e72636d676f6a6b786c776e64666d7378796679656a64706d676d72616d7973746668736b65626964716e", $type, 0); should_pass("7367786779776e6476666369717977766e76796f6e79636d706a686d6b616a676a6272687979646775776e6863776b62746a706f77726672706e78716a666f626476776674756b786f6e", $type, 0); should_pass("6174786a656d70627377707072676773717375746676787272646975616b71766a73646f6a696f736f67616f746a6e7272626b616b636d6b706469767574757772736a64726e716f6765", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet pattern with value [0-9A-F]{56}." => sub { my $type = mk_type('HexBinary', {'pattern' => qr/(?ms:^[0-9A-F]{56}$)/}); should_pass("756765786D706E686D61746C736A66696F6870727272707864666579", $type, 0); should_pass("6164696771616D657769787078716767647573626D65686570687579", $type, 0); should_pass("6C6C716F636879677467686871776571686161616E6D78636B686563", $type, 0); should_pass("6B6C6365756F73647967646E766366776F6F6B68706C6D71656F7072", $type, 0); should_pass("687565777368706D646B6B6D6C6F65716A6D6A62776D747267666B69", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet pattern with value [0-9A-F]{66}." => sub { my $type = mk_type('HexBinary', {'pattern' => qr/(?ms:^[0-9A-F]{66}$)/}); should_pass("6564757662646E6B76686F77747473656B7876726F7062616A6B70677272736867", $type, 0); should_pass("6E6776726D7468796B766A766B6872796C6A7063666C68616F616B6272766D6B6A", $type, 0); should_pass("686463686A7665776B746F756A616673626E6C69796278747176677861756A6378", $type, 0); should_pass("656B6B6C7379727171746970697473726B626F6C71677373637976786E736B6776", $type, 0); should_pass("707574686276776574756F63756977616A797869707968676C7276757174756468", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet pattern with value [0-9A-F]{18}." => sub { my $type = mk_type('HexBinary', {'pattern' => qr/(?ms:^[0-9A-F]{18}$)/}); should_pass("686163626B6E726F61", $type, 0); should_pass("66666F7062616A7269", $type, 0); should_pass("6C706B737361767170", $type, 0); should_pass("7561746E7175666A61", $type, 0); should_pass("6661656273726E6C63", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet pattern with value [0-9A-F]{46}." => sub { my $type = mk_type('HexBinary', {'pattern' => qr/(?ms:^[0-9A-F]{46}$)/}); should_pass("616B6374737472717274636768616E66746C77726F6771", $type, 0); should_pass("71686674766B73656B6E6772617378686D77746E696D66", $type, 0); should_pass("626467696F686C71616B6D7872766B666E796D6D6D6779", $type, 0); should_pass("6B78696E627863716F696D676371786D797264736D686C", $type, 0); should_pass("756A756779636D61626B626676726E666566757362656A", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet pattern with value [0-9A-F]{60}." => sub { my $type = mk_type('HexBinary', {'pattern' => qr/(?ms:^[0-9A-F]{60}$)/}); should_pass("746A71716F6E6F796E7463657773706177746A746173616274706671616A", $type, 0); should_pass("6A6F6F67676273756B726A696D6F6E61726E796969767061756262726279", $type, 0); should_pass("69706467776169706D7871727879636E6D69626271797962776B67686D61", $type, 0); should_pass("6672626F676B666A6977666876747279757376786F686D616D76676C7171", $type, 0); should_pass("626679666F666A78626B77656275626C6E6970667662776D737462646276", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet enumeration." => sub { my $type = mk_type('HexBinary', {'enumeration' => ['727172736a736b646368616575787074747667686c72746869626667767662746a76636d64786b62646a646e797068617567697063706a776674796b','696a66756d766e','786c6c716971787963','7772796b687870626e75736e68796966656372706b6373657064726e65706170766177716e61746263727777747361706577','7871646d6161686f6a747877697365686c67616d616171','6762736c6268707277727578686b75736d6b6873656e736970687664776d786576786d62637465716d79','747879637369666c796970646e6b6e616c65777064646d687967716d6e726c6e7064676b6e6871686f65616f6c676b7379696c6e7578766b646c7678756e62','636b6b686471656b6d656166616975717369656464636571786969636f6a747765617364706f7667666164727071766e67717771796b647274796f7771716f7373666e','6e74696b776161']}); should_pass("747879637369666c796970646e6b6e616c65777064646d687967716d6e726c6e7064676b6e6871686f65616f6c676b7379696c6e7578766b646c7678756e62", $type, 0); should_pass("636b6b686471656b6d656166616975717369656464636571786969636f6a747765617364706f7667666164727071766e67717771796b647274796f7771716f7373666e", $type, 0); should_pass("747879637369666c796970646e6b6e616c65777064646d687967716d6e726c6e7064676b6e6871686f65616f6c676b7379696c6e7578766b646c7678756e62", $type, 0); should_pass("696a66756d766e", $type, 0); should_pass("786c6c716971787963", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet enumeration." => sub { my $type = mk_type('HexBinary', {'enumeration' => ['696b70746c7777656b6b686b786961737561746a6a666262646161666e617376626b6d70796c6f72786d66786d70657267706971746966636f','70796171746777756779647270757175746f6177636a77647766786e6e626a6c6474796c656f666874','6e','687873626a6373726f7171677270677771676c6566746b687268797867736d62716763736d6b746474686b696a7772686167676671766a6a676e6869667670796a667078726368','71746474','78787167726d70666773646363637167666a76716c746d65746265786f68666e706b6972696f7071776e626975656c767661636e756a6a6962617261','6b68796c66626a647371616e797170636e636d6973736677706272676a746b','776a6b6e6c796261626e627468767771716577787967636c706c6166']}); should_pass("78787167726d70666773646363637167666a76716c746d65746265786f68666e706b6972696f7071776e626975656c767661636e756a6a6962617261", $type, 0); should_pass("696b70746c7777656b6b686b786961737561746a6a666262646161666e617376626b6d70796c6f72786d66786d70657267706971746966636f", $type, 0); should_pass("71746474", $type, 0); should_pass("70796171746777756779647270757175746f6177636a77647766786e6e626a6c6474796c656f666874", $type, 0); should_pass("78787167726d70666773646363637167666a76716c746d65746265786f68666e706b6972696f7071776e626975656c767661636e756a6a6962617261", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet enumeration." => sub { my $type = mk_type('HexBinary', {'enumeration' => ['66656a78736c737670696577636f6f7374736e666f716b6b6d70706372636670756376717174637271636f766174716877676c7677616b6b616b66686b796e6e','716f6a676d716c6a7962627064746c6d6f6b','7869716779776174636276726362707274646f6672636874796c77716f796d67776463706664686d79727972696a6768686c746a706d776d67757266756373777278616d616d6a74','687976636d666667656c66736a716c766d736a65786174746472716a6c6d6f6d7062746e756c6f70676f72696475716f716e676c6f6b6e646a72756e677662636a6c616a6e756c76','6f6d6861766564716d69696172637775646c7068616c767770636963697972766d696e746c69796a70796e6479706e786d71736569616f65727377776e736c65676e6f70727567','6b6a64797669616f6e68637177706f666a696a6464696c6864716d726b646461706d686b70747279666f70676d796d70736f6b62746d72746f75','697869686d6d726979716e736d6d6c716e61756f626c72656a6a6176696772737564787364757971736a7470617074766b797074736b6b6c7869656e656968616f6b63736778656975','676365686b6f746a','736967716f73666c706f79716e68676764696378']}); should_pass("66656a78736c737670696577636f6f7374736e666f716b6b6d70706372636670756376717174637271636f766174716877676c7677616b6b616b66686b796e6e", $type, 0); should_pass("7869716779776174636276726362707274646f6672636874796c77716f796d67776463706664686d79727972696a6768686c746a706d776d67757266756373777278616d616d6a74", $type, 0); should_pass("716f6a676d716c6a7962627064746c6d6f6b", $type, 0); should_pass("66656a78736c737670696577636f6f7374736e666f716b6b6d70706372636670756376717174637271636f766174716877676c7677616b6b616b66686b796e6e", $type, 0); should_pass("697869686d6d726979716e736d6d6c716e61756f626c72656a6a6176696772737564787364757971736a7470617074766b797074736b6b6c7869656e656968616f6b63736778656975", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet enumeration." => sub { my $type = mk_type('HexBinary', {'enumeration' => ['6a75666c716d666b72696c706e6173787067617568747268616a6166637973716a716e72766a62616864706a73616f6e686873666465716d726f64','64756572756677727068687376727365796679757174776b6c67686b656f67657570797976','656b6472646f6a6163776e71','6b64636963626276647477686f706770756a7068776870696c62746a63786f6b6e6a746672626c63637376776c6b73786e6b7372616266616875646175646f6167656f636e63697274','64616c6a716d72626b76796479706871726c7461716f67767362667264776f67','6873616774666a696269777162716f78766863727777797765656f74','63696877766e6a636270666f696c72686a','7561656b6979666475666e726d737662746c626d776a77766978676563646c6a6c6b6a7977716b686c7062616a6b716367','6b70686a6c6f676e626a61626565697378796d6d70756c7274627270776e6f7272776f646c']}); should_pass("656b6472646f6a6163776e71", $type, 0); should_pass("64756572756677727068687376727365796679757174776b6c67686b656f67657570797976", $type, 0); should_pass("6b64636963626276647477686f706770756a7068776870696c62746a63786f6b6e6a746672626c63637376776c6b73786e6b7372616266616875646175646f6167656f636e63697274", $type, 0); should_pass("6b64636963626276647477686f706770756a7068776870696c62746a63786f6b6e6a746672626c63637376776c6b73786e6b7372616266616875646175646f6167656f636e63697274", $type, 0); should_pass("63696877766e6a636270666f696c72686a", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet enumeration." => sub { my $type = mk_type('HexBinary', {'enumeration' => ['6d6f63686e7463706a67747172716b75656966746273697579687666706c6c72726e69706f6b67716d766f626b6c757171777363796b646e666468736f6f6b696464','666a6272766176786b6c69636d76686e6d68697968746a6264796c74656c6f78796c616973','6761737571766c716873746d72','657575657662737270776a626a70716d6878796e77627878647167786c6862657867796576686d6c63696567787261666d','6f6b66687469687477677775706a61','646f76676367746c6e6d636663696670796a6f616e6862676b656c786275666975616472687463706d77','6b696767676c64707177726b77777865796d63656b6b6369626a66646d6d72676877707162786765757471706c75796c6b75676b6561756b6579706c647269696c766e','776f64796e716c686d78776666626c6f','726565637367796b6d77696d66716c6e6a63757375716d6568676179667674757561766a686e6c7161756664676271676c626f63656c626c7261767168796c747265786b']}); should_pass("6761737571766c716873746d72", $type, 0); should_pass("6d6f63686e7463706a67747172716b75656966746273697579687666706c6c72726e69706f6b67716d766f626b6c757171777363796b646e666468736f6f6b696464", $type, 0); should_pass("6b696767676c64707177726b77777865796d63656b6b6369626a66646d6d72676877707162786765757471706c75796c6b75676b6561756b6579706c647269696c766e", $type, 0); should_pass("6f6b66687469687477677775706a61", $type, 0); should_pass("657575657662737270776a626a70716d6878796e77627878647167786c6862657867796576686d6c63696567787261666d", $type, 0); done_testing; }; subtest "Type atomic/hexBinary is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('HexBinary', {'whiteSpace' => 'collapse'}); should_pass("657570736465656376746b73687578756e70706769717479776a61787476686877707472626269726e727970706b6b616e736e6d6e736b6777756d786f626a78696276736d6777", $type, 0); should_pass("75656e7472726f756176676767676763746a6f726a726d6967776e716b6e776e676e7375706a686569697978726c6d706e737871626b786f716a63786f6b78746d68796d706676", $type, 0); should_pass("6a686275666f766e746e786e6d657765716365776f7164636e6d696865757873656f6c72776c627673676a686b686a77646761636177767468667276726171676f71686579636f", $type, 0); should_pass("6471726971796f71756a6f6876796576776d756b706e6b73646e6d7962796b6c67736a7363746a63796272676c646d72647771786b77626b77717563646c6561706a7578756964", $type, 0); should_pass("6d6e6b6664616f6f6b676e646d6c67776a6d6e6a6a6d736a73726e62747079656b6765706f67776e6778746479736273736b626b6f76797170766d7264656c6573646b696a6864", $type, 0); done_testing; }; done_testing; 50int.t000664001750001750 6112412404317273 13473 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/int is restricted by facet minExclusive with value -2147483648." => sub { my $type = mk_type('Int', {'minExclusive' => '-2147483648'}); should_pass("-2147483647", $type, 0); should_pass("-1529308213", $type, 0); should_pass("736511976", $type, 0); should_pass("2100599421", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value -1627498592." => sub { my $type = mk_type('Int', {'minExclusive' => '-1627498592'}); should_pass("-1627498591", $type, 0); should_pass("2027187427", $type, 0); should_pass("-1502841975", $type, 0); should_pass("-1133731086", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value 410341384." => sub { my $type = mk_type('Int', {'minExclusive' => '410341384'}); should_pass("410341385", $type, 0); should_pass("893609864", $type, 0); should_pass("499930050", $type, 0); should_pass("874321586", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value 272279129." => sub { my $type = mk_type('Int', {'minExclusive' => '272279129'}); should_pass("272279130", $type, 0); should_pass("1884283998", $type, 0); should_pass("731235525", $type, 0); should_pass("309357714", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value 2147483646." => sub { my $type = mk_type('Int', {'minExclusive' => '2147483646'}); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value -2147483648." => sub { my $type = mk_type('Int', {'minInclusive' => '-2147483648'}); should_pass("-2147483648", $type, 0); should_pass("190151643", $type, 0); should_pass("-112621736", $type, 0); should_pass("98792388", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value -1728117668." => sub { my $type = mk_type('Int', {'minInclusive' => '-1728117668'}); should_pass("-1728117668", $type, 0); should_pass("-814587757", $type, 0); should_pass("2069610640", $type, 0); should_pass("86987481", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value -484721378." => sub { my $type = mk_type('Int', {'minInclusive' => '-484721378'}); should_pass("-484721378", $type, 0); should_pass("455017347", $type, 0); should_pass("913084689", $type, 0); should_pass("919609429", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value 1012081748." => sub { my $type = mk_type('Int', {'minInclusive' => '1012081748'}); should_pass("1012081748", $type, 0); should_pass("1962924477", $type, 0); should_pass("2061791888", $type, 0); should_pass("1117627776", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value 2147483647." => sub { my $type = mk_type('Int', {'minInclusive' => '2147483647'}); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value -2147483647." => sub { my $type = mk_type('Int', {'maxExclusive' => '-2147483647'}); should_pass("-2147483648", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value -1810120723." => sub { my $type = mk_type('Int', {'maxExclusive' => '-1810120723'}); should_pass("-2147483648", $type, 0); should_pass("-1850462532", $type, 0); should_pass("-1848695294", $type, 0); should_pass("-2068950192", $type, 0); should_pass("-1810120724", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value 1403226675." => sub { my $type = mk_type('Int', {'maxExclusive' => '1403226675'}); should_pass("-2147483648", $type, 0); should_pass("-314821885", $type, 0); should_pass("-1323723968", $type, 0); should_pass("-1185155929", $type, 0); should_pass("1403226674", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value -1338447688." => sub { my $type = mk_type('Int', {'maxExclusive' => '-1338447688'}); should_pass("-2147483648", $type, 0); should_pass("-2122631874", $type, 0); should_pass("-2134321545", $type, 0); should_pass("-1824892031", $type, 0); should_pass("-1338447689", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value 2147483647." => sub { my $type = mk_type('Int', {'maxExclusive' => '2147483647'}); should_pass("-2147483648", $type, 0); should_pass("-1925888897", $type, 0); should_pass("367544275", $type, 0); should_pass("1877337193", $type, 0); should_pass("2147483646", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value -2147483648." => sub { my $type = mk_type('Int', {'maxInclusive' => '-2147483648'}); should_pass("-2147483648", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value -1910754291." => sub { my $type = mk_type('Int', {'maxInclusive' => '-1910754291'}); should_pass("-2147483648", $type, 0); should_pass("-1950916646", $type, 0); should_pass("-1953865974", $type, 0); should_pass("-2001500912", $type, 0); should_pass("-1910754291", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value 1033309964." => sub { my $type = mk_type('Int', {'maxInclusive' => '1033309964'}); should_pass("-2147483648", $type, 0); should_pass("-1135211238", $type, 0); should_pass("-1086646887", $type, 0); should_pass("-871959884", $type, 0); should_pass("1033309964", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value 348085051." => sub { my $type = mk_type('Int', {'maxInclusive' => '348085051'}); should_pass("-2147483648", $type, 0); should_pass("-1756416665", $type, 0); should_pass("260108624", $type, 0); should_pass("-1559552005", $type, 0); should_pass("348085051", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value 2147483647." => sub { my $type = mk_type('Int', {'maxInclusive' => '2147483647'}); should_pass("-2147483648", $type, 0); should_pass("171860631", $type, 0); should_pass("1437643801", $type, 0); should_pass("716321140", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Int', {'fractionDigits' => '0'}); should_pass("-2147483648", $type, 0); should_pass("1958247551", $type, 0); should_pass("-1159431106", $type, 0); should_pass("1969512786", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Int', {'totalDigits' => '1'}); should_pass("2", $type, 0); should_pass("6", $type, 0); should_pass("1", $type, 0); should_pass("1", $type, 0); should_pass("7", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('Int', {'totalDigits' => '3'}); should_pass("2", $type, 0); should_pass("32", $type, 0); should_pass("902", $type, 0); should_pass("1", $type, 0); should_pass("88", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('Int', {'totalDigits' => '5'}); should_pass("6", $type, 0); should_pass("56", $type, 0); should_pass("482", $type, 0); should_pass("5382", $type, 0); should_pass("31986", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('Int', {'totalDigits' => '7'}); should_pass("3", $type, 0); should_pass("83", $type, 0); should_pass("524", $type, 0); should_pass("7574", $type, 0); should_pass("6269784", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('Int', {'totalDigits' => '10'}); should_pass("4", $type, 0); should_pass("721", $type, 0); should_pass("12077", $type, 0); should_pass("4536775", $type, 0); should_pass("1377882784", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\-\\d{10}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\-\d{10}$)/}); should_pass("-2021151233", $type, 0); should_pass("-2123141222", $type, 0); should_pass("-2122362122", $type, 0); should_pass("-2126241225", $type, 0); should_pass("-2026142512", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_pass("-63629", $type, 0); should_pass("-25648", $type, 0); should_pass("-62278", $type, 0); should_pass("-86928", $type, 0); should_pass("-32647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-5", $type, 0); should_pass("-6", $type, 0); should_pass("-9", $type, 0); should_pass("-3", $type, 0); should_pass("-4", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\d{3}$)/}); should_pass("526", $type, 0); should_pass("637", $type, 0); should_pass("864", $type, 0); should_pass("356", $type, 0); should_pass("146", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\d{10}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\d{10}$)/}); should_pass("2124321125", $type, 0); should_pass("2011272332", $type, 0); should_pass("2026262112", $type, 0); should_pass("2124131112", $type, 0); should_pass("2023271111", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['-8','-48251','-726612373','7142','-2212763','-532985353']}); should_pass("-48251", $type, 0); should_pass("-2212763", $type, 0); should_pass("-48251", $type, 0); should_pass("-48251", $type, 0); should_pass("-726612373", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['-2147483648','516405021','997702013','-4389','-279694555','2147483647','-8333939','68011','376934']}); should_pass("997702013", $type, 0); should_pass("-8333939", $type, 0); should_pass("-2147483648", $type, 0); should_pass("2147483647", $type, 0); should_pass("997702013", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['2147483647','70977758','323669986','-314','-53685045','9391921','43292492','-2142090']}); should_pass("9391921", $type, 0); should_pass("-314", $type, 0); should_pass("323669986", $type, 0); should_pass("43292492", $type, 0); should_pass("323669986", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['762','-7786609','13025','444723','628279555','-929293','2147483647','994943306']}); should_pass("2147483647", $type, 0); should_pass("-7786609", $type, 0); should_pass("-7786609", $type, 0); should_pass("444723", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['-765383','-878521','-642','231','-2']}); should_pass("-642", $type, 0); should_pass("-765383", $type, 0); should_pass("-642", $type, 0); should_pass("-2", $type, 0); should_pass("-878521", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Int', {'whiteSpace' => 'collapse'}); should_pass("-2147483648", $type, 0); should_pass("-1857713729", $type, 0); should_pass("-1858797953", $type, 0); should_pass("1894997310", $type, 0); should_pass("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value -1105723757." => sub { my $type = mk_type('Int', {'minInclusive' => '-1105723757'}); should_fail("-2147483648", $type, 0); should_fail("-1554203522", $type, 0); should_fail("-1867927754", $type, 0); should_fail("-1246783233", $type, 0); should_fail("-1105723758", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value 314385179." => sub { my $type = mk_type('Int', {'minInclusive' => '314385179'}); should_fail("-2147483648", $type, 0); should_fail("-202084546", $type, 0); should_fail("-1030582070", $type, 0); should_fail("-558804931", $type, 0); should_fail("314385178", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value -978972026." => sub { my $type = mk_type('Int', {'minInclusive' => '-978972026'}); should_fail("-2147483648", $type, 0); should_fail("-1886474009", $type, 0); should_fail("-2048558050", $type, 0); should_fail("-1270407674", $type, 0); should_fail("-978972027", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value 990570194." => sub { my $type = mk_type('Int', {'minInclusive' => '990570194'}); should_fail("-2147483648", $type, 0); should_fail("238590822", $type, 0); should_fail("695318947", $type, 0); should_fail("895695993", $type, 0); should_fail("990570193", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minInclusive with value 2147483647." => sub { my $type = mk_type('Int', {'minInclusive' => '2147483647'}); should_fail("-2147483648", $type, 0); should_fail("1357856806", $type, 0); should_fail("-319808428", $type, 0); should_fail("-121654525", $type, 0); should_fail("2147483646", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value -2147483648." => sub { my $type = mk_type('Int', {'maxInclusive' => '-2147483648'}); should_fail("-2147483647", $type, 0); should_fail("157650509", $type, 0); should_fail("145963417", $type, 0); should_fail("-1718129641", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value 107981828." => sub { my $type = mk_type('Int', {'maxInclusive' => '107981828'}); should_fail("107981829", $type, 0); should_fail("690669358", $type, 0); should_fail("797235603", $type, 0); should_fail("554730780", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value -1631590701." => sub { my $type = mk_type('Int', {'maxInclusive' => '-1631590701'}); should_fail("-1631590700", $type, 0); should_fail("746911236", $type, 0); should_fail("1443179759", $type, 0); should_fail("-1281519134", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value -396617149." => sub { my $type = mk_type('Int', {'maxInclusive' => '-396617149'}); should_fail("-396617148", $type, 0); should_fail("1984167525", $type, 0); should_fail("1869474272", $type, 0); should_fail("1326598106", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxInclusive with value 1617521685." => sub { my $type = mk_type('Int', {'maxInclusive' => '1617521685'}); should_fail("1617521686", $type, 0); should_fail("2058985880", $type, 0); should_fail("2093269693", $type, 0); should_fail("1714939022", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Int', {'totalDigits' => '1'}); should_fail("14", $type, 0); should_fail("1938", $type, 0); should_fail("377163", $type, 0); should_fail("61711285", $type, 0); should_fail("1516122451", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('Int', {'totalDigits' => '2'}); should_fail("258", $type, 0); should_fail("2282", $type, 0); should_fail("72675", $type, 0); should_fail("418404", $type, 0); should_fail("1260205586", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('Int', {'totalDigits' => '3'}); should_fail("2457", $type, 0); should_fail("51587", $type, 0); should_fail("750043", $type, 0); should_fail("4422785", $type, 0); should_fail("1653135776", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('Int', {'totalDigits' => '4'}); should_fail("86408", $type, 0); should_fail("568165", $type, 0); should_fail("2113676", $type, 0); should_fail("65357261", $type, 0); should_fail("1623517461", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('Int', {'totalDigits' => '5'}); should_fail("107802", $type, 0); should_fail("2591104", $type, 0); should_fail("21390625", $type, 0); should_fail("784566563", $type, 0); should_fail("1257555418", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value -2147483648." => sub { my $type = mk_type('Int', {'minExclusive' => '-2147483648'}); should_fail("-2147483648", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value -1347613196." => sub { my $type = mk_type('Int', {'minExclusive' => '-1347613196'}); should_fail("-2147483648", $type, 0); should_fail("-1941168364", $type, 0); should_fail("-1711127617", $type, 0); should_fail("-1368513905", $type, 0); should_fail("-1347613196", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value -52553616." => sub { my $type = mk_type('Int', {'minExclusive' => '-52553616'}); should_fail("-2147483648", $type, 0); should_fail("-724022492", $type, 0); should_fail("-1508674745", $type, 0); should_fail("-52996607", $type, 0); should_fail("-52553616", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value 545642569." => sub { my $type = mk_type('Int', {'minExclusive' => '545642569'}); should_fail("-2147483648", $type, 0); should_fail("-536743899", $type, 0); should_fail("363486011", $type, 0); should_fail("-1454064932", $type, 0); should_fail("545642569", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet minExclusive with value 2147483646." => sub { my $type = mk_type('Int', {'minExclusive' => '2147483646'}); should_fail("-2147483648", $type, 0); should_fail("-481987679", $type, 0); should_fail("919865681", $type, 0); should_fail("-590002976", $type, 0); should_fail("2147483646", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value -2147483647." => sub { my $type = mk_type('Int', {'maxExclusive' => '-2147483647'}); should_fail("-2147483647", $type, 0); should_fail("1320063562", $type, 0); should_fail("883318207", $type, 0); should_fail("1579179461", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value -1862034354." => sub { my $type = mk_type('Int', {'maxExclusive' => '-1862034354'}); should_fail("-1862034354", $type, 0); should_fail("1603056474", $type, 0); should_fail("-1538388085", $type, 0); should_fail("1638251926", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value -1564577088." => sub { my $type = mk_type('Int', {'maxExclusive' => '-1564577088'}); should_fail("-1564577088", $type, 0); should_fail("801713771", $type, 0); should_fail("1786441673", $type, 0); should_fail("1669059396", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value 1028669252." => sub { my $type = mk_type('Int', {'maxExclusive' => '1028669252'}); should_fail("1028669252", $type, 0); should_fail("1727749747", $type, 0); should_fail("2034721430", $type, 0); should_fail("2146626319", $type, 0); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet maxExclusive with value 2147483647." => sub { my $type = mk_type('Int', {'maxExclusive' => '2147483647'}); should_fail("2147483647", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\-\\d{10}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\-\d{10}$)/}); should_fail("37", $type, 0); should_fail("-96215428", $type, 0); should_fail("-252765767", $type, 0); should_fail("-6372239", $type, 0); should_fail("-4567324", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_fail("2928288", $type, 0); should_fail("-55", $type, 0); should_fail("-656423387", $type, 0); should_fail("-7863", $type, 0); should_fail("884355", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("4713", $type, 0); should_fail("-6741", $type, 0); should_fail("41", $type, 0); should_fail("6421527", $type, 0); should_fail("-645751222", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\d{3}$)/}); should_fail("-38", $type, 0); should_fail("7543", $type, 0); should_fail("-2025222435", $type, 0); should_fail("2126271224", $type, 0); should_fail("-61", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet pattern with value \\d{10}." => sub { my $type = mk_type('Int', {'pattern' => qr/(?ms:^\d{10}$)/}); should_fail("-5566282", $type, 0); should_fail("-158417927", $type, 0); should_fail("34672729", $type, 0); should_fail("4296", $type, 0); should_fail("662153738", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['759','-97403404','-29705135','-147897','353','-71','-52084']}); should_fail("-1538024579", $type, 0); should_fail("5365287", $type, 0); should_fail("114571599", $type, 0); should_fail("5365287", $type, 0); should_fail("-1816238048", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['-46','818','588859393','53463862','2147483647','-132','584','-547137375','4973060']}); should_fail("116970484", $type, 0); should_fail("1583653002", $type, 0); should_fail("989798885", $type, 0); should_fail("-476887895", $type, 0); should_fail("1837761890", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['-13330','86645069','67442821','1582227530','-47830239']}); should_fail("-1338835307", $type, 0); should_fail("-695473537", $type, 0); should_fail("-386708731", $type, 0); should_fail("-386708731", $type, 0); should_fail("1837505618", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['6','3884586','36355213','-6796311','-34','-908904','880440401','-79776522']}); should_fail("2147483647", $type, 0); should_fail("384508812", $type, 0); should_fail("-2068540027", $type, 0); should_fail("-1583879972", $type, 0); should_fail("729371608", $type, 0); done_testing; }; subtest "Type atomic/int is restricted by facet enumeration." => sub { my $type = mk_type('Int', {'enumeration' => ['59132','-657815','-2147483648','3161','1331418175','-29278736']}); should_fail("-219237349", $type, 0); should_fail("-899341555", $type, 0); should_fail("-219237349", $type, 0); should_fail("898550454", $type, 0); should_fail("1622854063", $type, 0); done_testing; }; done_testing; 50integer.t000664001750001750 7006312404317273 14340 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/integer is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('Integer', {'minExclusive' => '-999999999999999999'}); should_pass("-999999999999999998", $type, 0); should_pass("443137129197984424", $type, 0); should_pass("974548584383189585", $type, 0); should_pass("-933323119839668311", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value 511594901568435787." => sub { my $type = mk_type('Integer', {'minExclusive' => '511594901568435787'}); should_pass("511594901568435788", $type, 0); should_pass("610220741092562958", $type, 0); should_pass("836708064607050875", $type, 0); should_pass("658348392840525865", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value 389578809107570477." => sub { my $type = mk_type('Integer', {'minExclusive' => '389578809107570477'}); should_pass("389578809107570478", $type, 0); should_pass("682131065909218436", $type, 0); should_pass("482804737273022810", $type, 0); should_pass("914441667137662715", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value 470740450062970382." => sub { my $type = mk_type('Integer', {'minExclusive' => '470740450062970382'}); should_pass("470740450062970383", $type, 0); should_pass("662902075507417933", $type, 0); should_pass("590924368168927172", $type, 0); should_pass("620830740395671088", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('Integer', {'minExclusive' => '999999999999999998'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value -999999999999999999." => sub { my $type = mk_type('Integer', {'minInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-531635689142616829", $type, 0); should_pass("-585408758799392136", $type, 0); should_pass("745573427013310751", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 156487900906511434." => sub { my $type = mk_type('Integer', {'minInclusive' => '156487900906511434'}); should_pass("156487900906511434", $type, 0); should_pass("600191706710963948", $type, 0); should_pass("408597210565453406", $type, 0); should_pass("322374839388900638", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value -362471093580558400." => sub { my $type = mk_type('Integer', {'minInclusive' => '-362471093580558400'}); should_pass("-362471093580558400", $type, 0); should_pass("506504656626137485", $type, 0); should_pass("403237895164793885", $type, 0); should_pass("381039479548217691", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value -183640263935870295." => sub { my $type = mk_type('Integer', {'minInclusive' => '-183640263935870295'}); should_pass("-183640263935870295", $type, 0); should_pass("429867068360666903", $type, 0); should_pass("340717798352538690", $type, 0); should_pass("214286893239231791", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('Integer', {'minInclusive' => '999999999999999999'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-999999999999999998'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -863230876206589446." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-863230876206589446'}); should_pass("-999999999999999999", $type, 0); should_pass("-984910341015155393", $type, 0); should_pass("-870742508782352781", $type, 0); should_pass("-903545016129904603", $type, 0); should_pass("-863230876206589447", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value 549869808681548999." => sub { my $type = mk_type('Integer', {'maxExclusive' => '549869808681548999'}); should_pass("-999999999999999999", $type, 0); should_pass("-787539741001840193", $type, 0); should_pass("-255803148941878739", $type, 0); should_pass("-639833227964826918", $type, 0); should_pass("549869808681548998", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -839533034801862807." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-839533034801862807'}); should_pass("-999999999999999999", $type, 0); should_pass("-904217810162270606", $type, 0); should_pass("-975833234751130778", $type, 0); should_pass("-948658638815220892", $type, 0); should_pass("-839533034801862808", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('Integer', {'maxExclusive' => '999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("968427442786447432", $type, 0); should_pass("-927768633139940622", $type, 0); should_pass("-392022443438005962", $type, 0); should_pass("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('Integer', {'maxInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 828008406281169228." => sub { my $type = mk_type('Integer', {'maxInclusive' => '828008406281169228'}); should_pass("-999999999999999999", $type, 0); should_pass("-480145976733018877", $type, 0); should_pass("-198155044675043050", $type, 0); should_pass("-449651710856988442", $type, 0); should_pass("828008406281169228", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 705179181121327491." => sub { my $type = mk_type('Integer', {'maxInclusive' => '705179181121327491'}); should_pass("-999999999999999999", $type, 0); should_pass("-116826494207499098", $type, 0); should_pass("230481006202911111", $type, 0); should_pass("95074826745361540", $type, 0); should_pass("705179181121327491", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value -2761698266856349." => sub { my $type = mk_type('Integer', {'maxInclusive' => '-2761698266856349'}); should_pass("-999999999999999999", $type, 0); should_pass("-161047999884288548", $type, 0); should_pass("-446821181429400256", $type, 0); should_pass("-166593548519859024", $type, 0); should_pass("-2761698266856349", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 999999999999999999." => sub { my $type = mk_type('Integer', {'maxInclusive' => '999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("823690339516311319", $type, 0); should_pass("978685767674965178", $type, 0); should_pass("-530672654045668989", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Integer', {'fractionDigits' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("70613191813607922", $type, 0); should_pass("825606520242485152", $type, 0); should_pass("662351389368224684", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Integer', {'totalDigits' => '1'}); should_pass("3", $type, 0); should_pass("2", $type, 0); should_pass("6", $type, 0); should_pass("2", $type, 0); should_pass("6", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('Integer', {'totalDigits' => '5'}); should_pass("1", $type, 0); should_pass("13", $type, 0); should_pass("392", $type, 0); should_pass("3263", $type, 0); should_pass("44340", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('Integer', {'totalDigits' => '9'}); should_pass("5", $type, 0); should_pass("328", $type, 0); should_pass("91395", $type, 0); should_pass("2427870", $type, 0); should_pass("463625194", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('Integer', {'totalDigits' => '13'}); should_pass("1", $type, 0); should_pass("7382", $type, 0); should_pass("6779457", $type, 0); should_pass("6180912352", $type, 0); should_pass("3307865857649", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('Integer', {'totalDigits' => '18'}); should_pass("1", $type, 0); should_pass("14506", $type, 0); should_pass("121457346", $type, 0); should_pass("3683445412166", $type, 0); should_pass("495140751164400574", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_pass("-916336264155436366", $type, 0); should_pass("-952682614477467412", $type, 0); should_pass("-947637432751355373", $type, 0); should_pass("-961133431445663578", $type, 0); should_pass("-924254345137746455", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_pass("-823666421", $type, 0); should_pass("-442642367", $type, 0); should_pass("-321934657", $type, 0); should_pass("-924385566", $type, 0); should_pass("-618594232", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-2", $type, 0); should_pass("-7", $type, 0); should_pass("-9", $type, 0); should_pass("-5", $type, 0); should_pass("-8", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("82365", $type, 0); should_pass("79898", $type, 0); should_pass("33364", $type, 0); should_pass("76112", $type, 0); should_pass("26887", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\d{18}$)/}); should_pass("953387635577466672", $type, 0); should_pass("956462344852823454", $type, 0); should_pass("947511736164636562", $type, 0); should_pass("955527688752774616", $type, 0); should_pass("925612635728263464", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['-79656589620485973','61','5609571936','-4739709191124','629890508912219','-820','-635117251034','371694697980']}); should_pass("5609571936", $type, 0); should_pass("-4739709191124", $type, 0); should_pass("371694697980", $type, 0); should_pass("61", $type, 0); should_pass("61", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['-648311529','45817917','-54','94122922748785','-246897894064838530','-7816621','-76931211351','1654495802745']}); should_pass("94122922748785", $type, 0); should_pass("-54", $type, 0); should_pass("-54", $type, 0); should_pass("45817917", $type, 0); should_pass("45817917", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['3','522','-34','-685416','-567825257','-451904674315973253']}); should_pass("522", $type, 0); should_pass("-34", $type, 0); should_pass("-34", $type, 0); should_pass("522", $type, 0); should_pass("-567825257", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['-1480745378756','-479','9967661580861324','-21','44','35682594228541431','759297981117']}); should_pass("-21", $type, 0); should_pass("759297981117", $type, 0); should_pass("-479", $type, 0); should_pass("44", $type, 0); should_pass("9967661580861324", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['-165130515156176','-4149','848','86','3411676615506539','42603','499220832']}); should_pass("-4149", $type, 0); should_pass("848", $type, 0); should_pass("86", $type, 0); should_pass("3411676615506539", $type, 0); should_pass("499220832", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Integer', {'whiteSpace' => 'collapse'}); should_pass("-999999999999999999", $type, 0); should_pass("765487259224892246", $type, 0); should_pass("784529489867233475", $type, 0); should_pass("67939852834455693", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 555633833307218160." => sub { my $type = mk_type('Integer', {'minInclusive' => '555633833307218160'}); should_fail("-999999999999999999", $type, 0); should_fail("-715375137462915939", $type, 0); should_fail("-330293086481657660", $type, 0); should_fail("-20439147890683564", $type, 0); should_fail("555633833307218159", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 885701465961149291." => sub { my $type = mk_type('Integer', {'minInclusive' => '885701465961149291'}); should_fail("-999999999999999999", $type, 0); should_fail("-733333145792854732", $type, 0); should_fail("503646561312402961", $type, 0); should_fail("37750437322319377", $type, 0); should_fail("885701465961149290", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 903027701396896364." => sub { my $type = mk_type('Integer', {'minInclusive' => '903027701396896364'}); should_fail("-999999999999999999", $type, 0); should_fail("803542756340227002", $type, 0); should_fail("-884575287008817597", $type, 0); should_fail("-968554962892916587", $type, 0); should_fail("903027701396896363", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 283850128955389857." => sub { my $type = mk_type('Integer', {'minInclusive' => '283850128955389857'}); should_fail("-999999999999999999", $type, 0); should_fail("-981348040158314034", $type, 0); should_fail("-108551497634576688", $type, 0); should_fail("-52284006405687333", $type, 0); should_fail("283850128955389856", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('Integer', {'minInclusive' => '999999999999999999'}); should_fail("-999999999999999999", $type, 0); should_fail("915231012652328866", $type, 0); should_fail("-1842156205751122", $type, 0); should_fail("-774880558353902237", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('Integer', {'maxInclusive' => '-999999999999999999'}); should_fail("-999999999999999998", $type, 0); should_fail("732627831192335320", $type, 0); should_fail("102989881653762438", $type, 0); should_fail("343045546112201282", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 579644983036442961." => sub { my $type = mk_type('Integer', {'maxInclusive' => '579644983036442961'}); should_fail("579644983036442962", $type, 0); should_fail("657783372604533621", $type, 0); should_fail("892814218656800078", $type, 0); should_fail("976683336572491260", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 879158057178991646." => sub { my $type = mk_type('Integer', {'maxInclusive' => '879158057178991646'}); should_fail("879158057178991647", $type, 0); should_fail("957210626799168633", $type, 0); should_fail("948775841289909504", $type, 0); should_fail("924521657636632656", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 514914181641328960." => sub { my $type = mk_type('Integer', {'maxInclusive' => '514914181641328960'}); should_fail("514914181641328961", $type, 0); should_fail("546412662884414317", $type, 0); should_fail("984544185618551293", $type, 0); should_fail("891200472113873434", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxInclusive with value 987717400733315819." => sub { my $type = mk_type('Integer', {'maxInclusive' => '987717400733315819'}); should_fail("987717400733315820", $type, 0); should_fail("998982291238848384", $type, 0); should_fail("988147725447667619", $type, 0); should_fail("995440855248586341", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Integer', {'totalDigits' => '1'}); should_fail("73", $type, 0); should_fail("769239", $type, 0); should_fail("3283247286", $type, 0); should_fail("28350621311206", $type, 0); should_fail("235172957253454087", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('Integer', {'totalDigits' => '4'}); should_fail("62917", $type, 0); should_fail("37332132", $type, 0); should_fail("33541623096", $type, 0); should_fail("26653195820701", $type, 0); should_fail("436943262590675951", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('Integer', {'totalDigits' => '7'}); should_fail("83731185", $type, 0); should_fail("7824493436", $type, 0); should_fail("423631318782", $type, 0); should_fail("37155925877143", $type, 0); should_fail("622613398826468318", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('Integer', {'totalDigits' => '10'}); should_fail("73816310381", $type, 0); should_fail("872704113788", $type, 0); should_fail("6843138681342", $type, 0); should_fail("87437784153102", $type, 0); should_fail("111482155734837965", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('Integer', {'totalDigits' => '13'}); should_fail("76486620136657", $type, 0); should_fail("881113724560259", $type, 0); should_fail("7847781334630603", $type, 0); should_fail("79384111427118245", $type, 0); should_fail("235339218946921455", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('Integer', {'minExclusive' => '-999999999999999999'}); should_fail("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value -438857029232744943." => sub { my $type = mk_type('Integer', {'minExclusive' => '-438857029232744943'}); should_fail("-999999999999999999", $type, 0); should_fail("-706516304210049812", $type, 0); should_fail("-587275362264587543", $type, 0); should_fail("-811308817075634922", $type, 0); should_fail("-438857029232744943", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value 520623083761981407." => sub { my $type = mk_type('Integer', {'minExclusive' => '520623083761981407'}); should_fail("-999999999999999999", $type, 0); should_fail("-369704743268721243", $type, 0); should_fail("431295840769552640", $type, 0); should_fail("-899920080041305242", $type, 0); should_fail("520623083761981407", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value -803324837597181761." => sub { my $type = mk_type('Integer', {'minExclusive' => '-803324837597181761'}); should_fail("-999999999999999999", $type, 0); should_fail("-979574777898465747", $type, 0); should_fail("-847977457228131287", $type, 0); should_fail("-869245724557926333", $type, 0); should_fail("-803324837597181761", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('Integer', {'minExclusive' => '999999999999999998'}); should_fail("-999999999999999999", $type, 0); should_fail("-609931933249433066", $type, 0); should_fail("-366111682540258165", $type, 0); should_fail("-974096115222225610", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-999999999999999998'}); should_fail("-999999999999999998", $type, 0); should_fail("-457591284603875657", $type, 0); should_fail("277743723766642247", $type, 0); should_fail("-945199490913345428", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -740625800233241758." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-740625800233241758'}); should_fail("-740625800233241758", $type, 0); should_fail("398541088728751173", $type, 0); should_fail("-547997326204181850", $type, 0); should_fail("-288328762100017528", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -587018553452636869." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-587018553452636869'}); should_fail("-587018553452636869", $type, 0); should_fail("82097550327076279", $type, 0); should_fail("361640725837125523", $type, 0); should_fail("-490115177088915028", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value -343370478631694008." => sub { my $type = mk_type('Integer', {'maxExclusive' => '-343370478631694008'}); should_fail("-343370478631694008", $type, 0); should_fail("161483662816734775", $type, 0); should_fail("460404257832331682", $type, 0); should_fail("101612848955484236", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('Integer', {'maxExclusive' => '999999999999999999'}); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_fail("-2875718525374455", $type, 0); should_fail("4428734471785813", $type, 0); should_fail("55632973", $type, 0); should_fail("-4", $type, 0); should_fail("-3452617252542", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_fail("-39682798272352427", $type, 0); should_fail("522688578965", $type, 0); should_fail("278352863422374", $type, 0); should_fail("-922973", $type, 0); should_fail("-5523297772154555", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("-615", $type, 0); should_fail("252", $type, 0); should_fail("-845526", $type, 0); should_fail("52887", $type, 0); should_fail("54515685354", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("3", $type, 0); should_fail("4", $type, 0); should_fail("-564172", $type, 0); should_fail("6468988464", $type, 0); should_fail("19938571382266", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('Integer', {'pattern' => qr/(?ms:^\d{18}$)/}); should_fail("3765", $type, 0); should_fail("-3163464278", $type, 0); should_fail("-36284471451", $type, 0); should_fail("146557", $type, 0); should_fail("-41468", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['-152','95','25385971775262072','-2413740','-7','440146783175242806','-90869253371','2457839','-12','-866988040697697415']}); should_fail("429432980408758879", $type, 0); should_fail("625583585677498054", $type, 0); should_fail("429432980408758879", $type, 0); should_fail("419065458728186345", $type, 0); should_fail("-820591559414092452", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['8785763494850','950846866884093','-32589','-5354358','-374','2032211972695']}); should_fail("182392902047340266", $type, 0); should_fail("350482891421959097", $type, 0); should_fail("-819606813622294482", $type, 0); should_fail("77593997135002590", $type, 0); should_fail("-988246105259493966", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['5031495120521736','646034','351003417603263','-9184826400789700','-781553476','836','38315088843','-873']}); should_fail("-450845844618843249", $type, 0); should_fail("645472034881447109", $type, 0); should_fail("210135983395829173", $type, 0); should_fail("-553527799610078252", $type, 0); should_fail("-762857802722344046", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['7280808904855','90383064','-88','13185418','97487211','-8801','67176183','-70586615385']}); should_fail("74575575756274270", $type, 0); should_fail("366787906513476480", $type, 0); should_fail("490640727365811545", $type, 0); should_fail("402439179028029947", $type, 0); should_fail("490640727365811545", $type, 0); done_testing; }; subtest "Type atomic/integer is restricted by facet enumeration." => sub { my $type = mk_type('Integer', {'enumeration' => ['7980740138073','426','-189337021','-33','504','-417572823','-19146712219589']}); should_fail("187412487362427881", $type, 0); should_fail("515203305113594911", $type, 0); should_fail("433049324809725133", $type, 0); should_fail("546973724262155513", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; done_testing; 50language.t000664001750001750 3340412404317273 14464 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/language is restricted by facet maxLength with value 2." => sub { my $type = mk_type('Language', {'maxLength' => '2'}); should_pass("TH", $type, 0); should_pass("HU", $type, 0); should_pass("TA", $type, 0); should_pass("UR", $type, 0); should_pass("FA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 2." => sub { my $type = mk_type('Language', {'maxLength' => '2'}); should_pass("SS", $type, 0); should_pass("BE", $type, 0); should_pass("QU", $type, 0); should_pass("LA", $type, 0); should_pass("RW", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 2." => sub { my $type = mk_type('Language', {'maxLength' => '2'}); should_pass("RM", $type, 0); should_pass("KM", $type, 0); should_pass("EO", $type, 0); should_pass("BH", $type, 0); should_pass("LV", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 9." => sub { my $type = mk_type('Language', {'maxLength' => '9'}); should_pass("IN", $type, 0); should_pass("CS", $type, 0); should_pass("SS-a", $type, 0); should_pass("BN-UK", $type, 0); should_pass("UK-Indian", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 11." => sub { my $type = mk_type('Language', {'maxLength' => '11'}); should_pass("NO", $type, 0); should_pass("TL-a", $type, 0); should_pass("AA-USA", $type, 0); should_pass("DE-CHINA", $type, 0); should_pass("GD-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 2." => sub { my $type = mk_type('Language', {'minLength' => '2'}); should_pass("TS", $type, 0); should_pass("TA-a", $type, 0); should_pass("CO-USA", $type, 0); should_pass("PT-CHINA", $type, 0); should_pass("YO-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 5." => sub { my $type = mk_type('Language', {'minLength' => '5'}); should_pass("JW-UK", $type, 0); should_pass("EU-USA", $type, 0); should_pass("BA-LANG", $type, 0); should_pass("BN-CHINA", $type, 0); should_pass("LT-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 9." => sub { my $type = mk_type('Language', {'minLength' => '9'}); should_pass("BR-Indian", $type, 0); should_pass("AF-Ebonics", $type, 0); should_pass("PA-Thailand", $type, 0); should_pass("OM-Indian", $type, 0); should_pass("FI-Ebonics", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 4." => sub { my $type = mk_type('Language', {'minLength' => '4'}); should_pass("BO-a", $type, 0); should_pass("JW-UK", $type, 0); should_pass("KL-USA", $type, 0); should_pass("GU-LANG", $type, 0); should_pass("SG-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 11." => sub { my $type = mk_type('Language', {'minLength' => '11'}); should_pass("HU-Thailand", $type, 0); should_pass("TG-Thailand", $type, 0); should_pass("ML-Thailand", $type, 0); should_pass("SO-Thailand", $type, 0); should_pass("IK-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 2." => sub { my $type = mk_type('Language', {'length' => '2'}); should_pass("EU", $type, 0); should_pass("IS", $type, 0); should_pass("SM", $type, 0); should_pass("PT", $type, 0); should_pass("VI", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 7." => sub { my $type = mk_type('Language', {'length' => '7'}); should_pass("BO-LANG", $type, 0); should_pass("SD-LANG", $type, 0); should_pass("TI-LANG", $type, 0); should_pass("BI-LANG", $type, 0); should_pass("PL-LANG", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 10." => sub { my $type = mk_type('Language', {'length' => '10'}); should_pass("HU-Ebonics", $type, 0); should_pass("MR-Ebonics", $type, 0); should_pass("TT-Ebonics", $type, 0); should_pass("TR-Ebonics", $type, 0); should_pass("GN-Ebonics", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 5." => sub { my $type = mk_type('Language', {'length' => '5'}); should_pass("FI-UK", $type, 0); should_pass("LT-UK", $type, 0); should_pass("TN-UK", $type, 0); should_pass("HU-UK", $type, 0); should_pass("TN-UK", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 11." => sub { my $type = mk_type('Language', {'length' => '11'}); should_pass("ZH-Thailand", $type, 0); should_pass("TN-Thailand", $type, 0); should_pass("ML-Thailand", $type, 0); should_pass("FY-Thailand", $type, 0); should_pass("IS-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet pattern with value ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*." => sub { my $type = mk_type('Language', {'pattern' => qr/(?ms:^([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*$)/}); should_pass("TE-USA", $type, 0); should_pass("TG-USA", $type, 0); should_pass("TH-USA", $type, 0); should_pass("TI-USA", $type, 0); should_pass("TK-USA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet pattern with value ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*." => sub { my $type = mk_type('Language', {'pattern' => qr/(?ms:^([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*$)/}); should_pass("TL-USA", $type, 0); should_pass("TN-USA", $type, 0); should_pass("TO-USA", $type, 0); should_pass("TR-USA", $type, 0); should_pass("TS-USA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet pattern with value ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*." => sub { my $type = mk_type('Language', {'pattern' => qr/(?ms:^([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*$)/}); should_pass("AS-USA", $type, 0); should_pass("AY-USA", $type, 0); should_pass("AZ-USA", $type, 0); should_pass("BA-USA", $type, 0); should_pass("BE-USA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet pattern with value ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*." => sub { my $type = mk_type('Language', {'pattern' => qr/(?ms:^([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*$)/}); should_pass("SL-USA", $type, 0); should_pass("SM-USA", $type, 0); should_pass("SN-USA", $type, 0); should_pass("SO-USA", $type, 0); should_pass("SQ-USA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet pattern with value ([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*." => sub { my $type = mk_type('Language', {'pattern' => qr/(?ms:^([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{3})*$)/}); should_pass("WO-USA", $type, 0); should_pass("XH-USA", $type, 0); should_pass("YO-USA", $type, 0); should_pass("ZH-USA", $type, 0); should_pass("ZU-USA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet enumeration." => sub { my $type = mk_type('Language', {'enumeration' => ['AF','AM','AR','AS','AY','AZ','BA','BE']}); should_pass("AS", $type, 0); should_pass("AR", $type, 0); should_pass("AZ", $type, 0); should_pass("AS", $type, 0); should_pass("AS", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet enumeration." => sub { my $type = mk_type('Language', {'enumeration' => ['SL','SM','SN','SO','SQ','SR','SS']}); should_pass("SL", $type, 0); should_pass("SQ", $type, 0); should_pass("SS", $type, 0); should_pass("SN", $type, 0); should_pass("SN", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet enumeration." => sub { my $type = mk_type('Language', {'enumeration' => ['AY','AZ','BA','BE','BG','BH','BI','BN','BO']}); should_pass("BO", $type, 0); should_pass("BO", $type, 0); should_pass("BE", $type, 0); should_pass("BG", $type, 0); should_pass("BH", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet enumeration." => sub { my $type = mk_type('Language', {'enumeration' => ['BR','CA','CO','CS','CY']}); should_pass("CA", $type, 0); should_pass("CO", $type, 0); should_pass("CY", $type, 0); should_pass("CS", $type, 0); should_pass("CY", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet enumeration." => sub { my $type = mk_type('Language', {'enumeration' => ['BH','BI','BN','BO','BR','CA','CO','CS','CY']}); should_pass("CA", $type, 0); should_pass("CA", $type, 0); should_pass("CY", $type, 0); should_pass("CS", $type, 0); should_pass("CY", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Language', {'whiteSpace' => 'collapse'}); should_pass("FO", $type, 0); should_pass("ZH", $type, 0); should_pass("EO", $type, 0); should_pass("BE", $type, 0); should_pass("PL", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 6." => sub { my $type = mk_type('Language', {'minLength' => '6'}); should_fail("SK", $type, 0); should_fail("CY-a", $type, 0); should_fail("BA-a", $type, 0); should_fail("TW-UK", $type, 0); should_fail("MY", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 6." => sub { my $type = mk_type('Language', {'minLength' => '6'}); should_fail("FJ", $type, 0); should_fail("HR-a", $type, 0); should_fail("XH-a", $type, 0); should_fail("LT-UK", $type, 0); should_fail("MK", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 9." => sub { my $type = mk_type('Language', {'minLength' => '9'}); should_fail("MR", $type, 0); should_fail("YO-a", $type, 0); should_fail("TE-a", $type, 0); should_fail("SG-UK", $type, 0); should_fail("TO-CHINA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet minLength with value 11." => sub { my $type = mk_type('Language', {'minLength' => '11'}); should_fail("ZH", $type, 0); should_fail("PL-a", $type, 0); should_fail("EN-USA", $type, 0); should_fail("BE-CHINA", $type, 0); should_fail("SD-Ebonics", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 2." => sub { my $type = mk_type('Language', {'maxLength' => '2'}); should_fail("OM-a", $type, 0); should_fail("PL-UK", $type, 0); should_fail("MO-USA", $type, 0); should_fail("NL-LANG", $type, 0); should_fail("BE-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 5." => sub { my $type = mk_type('Language', {'maxLength' => '5'}); should_fail("ZH-USA", $type, 0); should_fail("KN-LANG", $type, 0); should_fail("KL-CHINA", $type, 0); should_fail("YO-Indian", $type, 0); should_fail("VO-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 9." => sub { my $type = mk_type('Language', {'maxLength' => '9'}); should_fail("SQ-Ebonics", $type, 0); should_fail("CA-Thailand", $type, 0); should_fail("CS-Ebonics", $type, 0); should_fail("TO-Thailand", $type, 0); should_fail("ZH-Ebonics", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 7." => sub { my $type = mk_type('Language', {'maxLength' => '7'}); should_fail("ES-CHINA", $type, 0); should_fail("FJ-Indian", $type, 0); should_fail("ML-Ebonics", $type, 0); should_fail("SH-Thailand", $type, 0); should_fail("IA-CHINA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet maxLength with value 8." => sub { my $type = mk_type('Language', {'maxLength' => '8'}); should_fail("AF-Indian", $type, 0); should_fail("KM-Ebonics", $type, 0); should_fail("AA-Thailand", $type, 0); should_fail("HR-Indian", $type, 0); should_fail("OM-Ebonics", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 2." => sub { my $type = mk_type('Language', {'length' => '2'}); should_fail("SG-a", $type, 0); should_fail("HI-UK", $type, 0); should_fail("SI-USA", $type, 0); should_fail("JA-LANG", $type, 0); should_fail("MN-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 6." => sub { my $type = mk_type('Language', {'length' => '6'}); should_fail("AF", $type, 0); should_fail("LN-a", $type, 0); should_fail("TS-UK", $type, 0); should_fail("SR-CHINA", $type, 0); should_fail("GA-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 7." => sub { my $type = mk_type('Language', {'length' => '7'}); should_fail("MG", $type, 0); should_fail("IT", $type, 0); should_fail("BA-a", $type, 0); should_fail("SV-UK", $type, 0); should_fail("GU-USA", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 5." => sub { my $type = mk_type('Language', {'length' => '5'}); should_fail("KL", $type, 0); should_fail("AR-a", $type, 0); should_fail("SV-USA", $type, 0); should_fail("IE-CHINA", $type, 0); should_fail("KY-Thailand", $type, 0); done_testing; }; subtest "Type atomic/language is restricted by facet length with value 11." => sub { my $type = mk_type('Language', {'length' => '11'}); should_fail("ML", $type, 0); should_fail("FJ-a", $type, 0); should_fail("SL-USA", $type, 0); should_fail("AF-CHINA", $type, 0); should_fail("AZ-Ebonics", $type, 0); done_testing; }; done_testing; 50long.t000664001750001750 6750012404317273 13644 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/long is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('Long', {'minExclusive' => '-999999999999999999'}); should_pass("-999999999999999998", $type, 0); should_pass("-438183056062100283", $type, 0); should_pass("-730415030775278138", $type, 0); should_pass("-75024681958743010", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value 968402995542501752." => sub { my $type = mk_type('Long', {'minExclusive' => '968402995542501752'}); should_pass("968402995542501753", $type, 0); should_pass("992032847900994818", $type, 0); should_pass("974537720720994502", $type, 0); should_pass("986012772750288166", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value 420715981815711347." => sub { my $type = mk_type('Long', {'minExclusive' => '420715981815711347'}); should_pass("420715981815711348", $type, 0); should_pass("917335403421977926", $type, 0); should_pass("950507687486504889", $type, 0); should_pass("782630077344273642", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value -244808889653066019." => sub { my $type = mk_type('Long', {'minExclusive' => '-244808889653066019'}); should_pass("-244808889653066018", $type, 0); should_pass("646654461216909232", $type, 0); should_pass("992170879059480184", $type, 0); should_pass("783790005141873453", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('Long', {'minExclusive' => '999999999999999998'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value -999999999999999999." => sub { my $type = mk_type('Long', {'minInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-397938882569509377", $type, 0); should_pass("-344267677883061784", $type, 0); should_pass("415083628365485290", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value 654371390798063278." => sub { my $type = mk_type('Long', {'minInclusive' => '654371390798063278'}); should_pass("654371390798063278", $type, 0); should_pass("876174309598772003", $type, 0); should_pass("661591040355611765", $type, 0); should_pass("895577718881608925", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value 679423031619886596." => sub { my $type = mk_type('Long', {'minInclusive' => '679423031619886596'}); should_pass("679423031619886596", $type, 0); should_pass("913111223216426828", $type, 0); should_pass("912510378381782725", $type, 0); should_pass("929305182239794686", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value 579451386929251021." => sub { my $type = mk_type('Long', {'minInclusive' => '579451386929251021'}); should_pass("579451386929251021", $type, 0); should_pass("902992188127024208", $type, 0); should_pass("824874704639240016", $type, 0); should_pass("708948875639938824", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('Long', {'minInclusive' => '999999999999999999'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('Long', {'maxExclusive' => '-999999999999999998'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value -562908107193849537." => sub { my $type = mk_type('Long', {'maxExclusive' => '-562908107193849537'}); should_pass("-999999999999999999", $type, 0); should_pass("-808380194595141275", $type, 0); should_pass("-822649479248610771", $type, 0); should_pass("-590945378547525183", $type, 0); should_pass("-562908107193849538", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value -62970516107334394." => sub { my $type = mk_type('Long', {'maxExclusive' => '-62970516107334394'}); should_pass("-999999999999999999", $type, 0); should_pass("-270926369799275666", $type, 0); should_pass("-365308762022580493", $type, 0); should_pass("-882518584237943728", $type, 0); should_pass("-62970516107334395", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value -40900034799576711." => sub { my $type = mk_type('Long', {'maxExclusive' => '-40900034799576711'}); should_pass("-999999999999999999", $type, 0); should_pass("-274843839731028429", $type, 0); should_pass("-682373695437848980", $type, 0); should_pass("-266120163505469408", $type, 0); should_pass("-40900034799576712", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('Long', {'maxExclusive' => '999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("361579683220858870", $type, 0); should_pass("863135773750244748", $type, 0); should_pass("-230400793531868153", $type, 0); should_pass("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('Long', {'maxInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value 472512421492236489." => sub { my $type = mk_type('Long', {'maxInclusive' => '472512421492236489'}); should_pass("-999999999999999999", $type, 0); should_pass("-543180519732171516", $type, 0); should_pass("-106047285186662175", $type, 0); should_pass("-561394859984429942", $type, 0); should_pass("472512421492236489", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value -319274017545440269." => sub { my $type = mk_type('Long', {'maxInclusive' => '-319274017545440269'}); should_pass("-999999999999999999", $type, 0); should_pass("-727194004132777993", $type, 0); should_pass("-493310300001086924", $type, 0); should_pass("-587606438485648919", $type, 0); should_pass("-319274017545440269", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value 395309234845914847." => sub { my $type = mk_type('Long', {'maxInclusive' => '395309234845914847'}); should_pass("-999999999999999999", $type, 0); should_pass("-771424898560677999", $type, 0); should_pass("-388165179280097323", $type, 0); should_pass("315473587110365078", $type, 0); should_pass("395309234845914847", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value 999999999999999999." => sub { my $type = mk_type('Long', {'maxInclusive' => '999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("779716996244725456", $type, 0); should_pass("112284133831870302", $type, 0); should_pass("391081913308217287", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Long', {'fractionDigits' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("-439678890605573080", $type, 0); should_pass("673029236492377779", $type, 0); should_pass("-367446140835359757", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Long', {'totalDigits' => '1'}); should_pass("9", $type, 0); should_pass("8", $type, 0); should_pass("3", $type, 0); should_pass("2", $type, 0); should_pass("8", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('Long', {'totalDigits' => '5'}); should_pass("2", $type, 0); should_pass("59", $type, 0); should_pass("256", $type, 0); should_pass("1881", $type, 0); should_pass("87876", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('Long', {'totalDigits' => '9'}); should_pass("2", $type, 0); should_pass("324", $type, 0); should_pass("53160", $type, 0); should_pass("2241858", $type, 0); should_pass("350271868", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('Long', {'totalDigits' => '13'}); should_pass("7", $type, 0); should_pass("1299", $type, 0); should_pass("4347514", $type, 0); should_pass("7559612718", $type, 0); should_pass("1416366976154", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('Long', {'totalDigits' => '18'}); should_pass("3", $type, 0); should_pass("95740", $type, 0); should_pass("735611727", $type, 0); should_pass("3784148207702", $type, 0); should_pass("157826879511434666", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_pass("-986558763664653645", $type, 0); should_pass("-913428556433725453", $type, 0); should_pass("-973221252533651368", $type, 0); should_pass("-943246656652245344", $type, 0); should_pass("-956548175456225582", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_pass("-787574922", $type, 0); should_pass("-726788351", $type, 0); should_pass("-256584684", $type, 0); should_pass("-289122472", $type, 0); should_pass("-386638897", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-8", $type, 0); should_pass("-8", $type, 0); should_pass("-7", $type, 0); should_pass("-4", $type, 0); should_pass("-8", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("43733", $type, 0); should_pass("29358", $type, 0); should_pass("75414", $type, 0); should_pass("66282", $type, 0); should_pass("88634", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\d{18}$)/}); should_pass("934646773752244366", $type, 0); should_pass("946663632864638888", $type, 0); should_pass("953654543736653615", $type, 0); should_pass("946365341267825427", $type, 0); should_pass("955717642814452228", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['67417897408','445463702','11686316','-223498733','-5496081750511','-4233583602889']}); should_pass("11686316", $type, 0); should_pass("-5496081750511", $type, 0); should_pass("-5496081750511", $type, 0); should_pass("445463702", $type, 0); should_pass("-5496081750511", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['-60196439767','29044724','528615','-36983185','649699813723','-53330603926218023','-4958442914','-530271545']}); should_pass("29044724", $type, 0); should_pass("-530271545", $type, 0); should_pass("-53330603926218023", $type, 0); should_pass("-530271545", $type, 0); should_pass("-36983185", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['43','-2032980968765','34853718286','-368','80579055795489529','282076','-4722','-12200','4812']}); should_pass("4812", $type, 0); should_pass("-4722", $type, 0); should_pass("-2032980968765", $type, 0); should_pass("34853718286", $type, 0); should_pass("-4722", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['-19024765988335756','-902030968896','698832321694','-245446','62317068276','-52501609699','947653025590775','9289163707500556','-2295090265679','-97146741275']}); should_pass("-52501609699", $type, 0); should_pass("62317068276", $type, 0); should_pass("-2295090265679", $type, 0); should_pass("947653025590775", $type, 0); should_pass("-902030968896", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['-998','1827924515','88745595866','-14260976357358','59419563214914','4468','4631900674078']}); should_pass("59419563214914", $type, 0); should_pass("88745595866", $type, 0); should_pass("59419563214914", $type, 0); should_pass("88745595866", $type, 0); should_pass("-14260976357358", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Long', {'whiteSpace' => 'collapse'}); should_pass("-999999999999999999", $type, 0); should_pass("-141811240377451630", $type, 0); should_pass("107634268556318302", $type, 0); should_pass("-741262037408872975", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value 583792148562175316." => sub { my $type = mk_type('Long', {'minInclusive' => '583792148562175316'}); should_fail("-999999999999999999", $type, 0); should_fail("406638238320622626", $type, 0); should_fail("-638693120471822479", $type, 0); should_fail("-323016043871903592", $type, 0); should_fail("583792148562175315", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value -689877964040234158." => sub { my $type = mk_type('Long', {'minInclusive' => '-689877964040234158'}); should_fail("-999999999999999999", $type, 0); should_fail("-820792054363353774", $type, 0); should_fail("-725379333585144926", $type, 0); should_fail("-928387095497131129", $type, 0); should_fail("-689877964040234159", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value -635039562549570168." => sub { my $type = mk_type('Long', {'minInclusive' => '-635039562549570168'}); should_fail("-999999999999999999", $type, 0); should_fail("-844669926868859999", $type, 0); should_fail("-651482607533091162", $type, 0); should_fail("-950390854239020283", $type, 0); should_fail("-635039562549570169", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value -217274055791231379." => sub { my $type = mk_type('Long', {'minInclusive' => '-217274055791231379'}); should_fail("-999999999999999999", $type, 0); should_fail("-967264967922566177", $type, 0); should_fail("-527241730293832538", $type, 0); should_fail("-902272444411393578", $type, 0); should_fail("-217274055791231380", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('Long', {'minInclusive' => '999999999999999999'}); should_fail("-999999999999999999", $type, 0); should_fail("-4604910092599779", $type, 0); should_fail("695824151654512500", $type, 0); should_fail("476038958967349045", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('Long', {'maxInclusive' => '-999999999999999999'}); should_fail("-999999999999999998", $type, 0); should_fail("-136550217446477439", $type, 0); should_fail("301508639387523258", $type, 0); should_fail("165029836242362782", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value 648840685860569087." => sub { my $type = mk_type('Long', {'maxInclusive' => '648840685860569087'}); should_fail("648840685860569088", $type, 0); should_fail("870346801180572437", $type, 0); should_fail("947290282026430821", $type, 0); should_fail("819053053548357647", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value 837276573179478677." => sub { my $type = mk_type('Long', {'maxInclusive' => '837276573179478677'}); should_fail("837276573179478678", $type, 0); should_fail("982131744201154708", $type, 0); should_fail("878401732190292315", $type, 0); should_fail("855806805973112446", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value -231112914202378227." => sub { my $type = mk_type('Long', {'maxInclusive' => '-231112914202378227'}); should_fail("-231112914202378226", $type, 0); should_fail("642456873159420352", $type, 0); should_fail("209104855015940588", $type, 0); should_fail("912184317590979202", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxInclusive with value -716385737637535546." => sub { my $type = mk_type('Long', {'maxInclusive' => '-716385737637535546'}); should_fail("-716385737637535545", $type, 0); should_fail("732781777769492545", $type, 0); should_fail("531162283326065394", $type, 0); should_fail("240919302458363108", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Long', {'totalDigits' => '1'}); should_fail("61", $type, 0); should_fail("352314", $type, 0); should_fail("5672867257", $type, 0); should_fail("61221375404615", $type, 0); should_fail("146672972327691410", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('Long', {'totalDigits' => '4'}); should_fail("59600", $type, 0); should_fail("68323727", $type, 0); should_fail("37839894647", $type, 0); should_fail("58464689733810", $type, 0); should_fail("514834822567682304", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('Long', {'totalDigits' => '7'}); should_fail("41891153", $type, 0); should_fail("3180876051", $type, 0); should_fail("356217484246", $type, 0); should_fail("15184683016354", $type, 0); should_fail("568323046628399965", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('Long', {'totalDigits' => '10'}); should_fail("62183883927", $type, 0); should_fail("454688281764", $type, 0); should_fail("4250944564358", $type, 0); should_fail("60434747874517", $type, 0); should_fail("882271787829559286", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('Long', {'totalDigits' => '13'}); should_fail("73160554226563", $type, 0); should_fail("152523424361917", $type, 0); should_fail("7816567088582023", $type, 0); should_fail("65585590862232778", $type, 0); should_fail("175655245093397441", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('Long', {'minExclusive' => '-999999999999999999'}); should_fail("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value 797627372074136696." => sub { my $type = mk_type('Long', {'minExclusive' => '797627372074136696'}); should_fail("-999999999999999999", $type, 0); should_fail("571517462213777986", $type, 0); should_fail("-828347264457694281", $type, 0); should_fail("-932731884480699309", $type, 0); should_fail("797627372074136696", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value -425021319963341470." => sub { my $type = mk_type('Long', {'minExclusive' => '-425021319963341470'}); should_fail("-999999999999999999", $type, 0); should_fail("-821040419442518247", $type, 0); should_fail("-693233371923550840", $type, 0); should_fail("-460176317465711225", $type, 0); should_fail("-425021319963341470", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value -371832791753599733." => sub { my $type = mk_type('Long', {'minExclusive' => '-371832791753599733'}); should_fail("-999999999999999999", $type, 0); should_fail("-781426192888480178", $type, 0); should_fail("-475269055523014805", $type, 0); should_fail("-972055299241825914", $type, 0); should_fail("-371832791753599733", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('Long', {'minExclusive' => '999999999999999998'}); should_fail("-999999999999999999", $type, 0); should_fail("-828451730987506351", $type, 0); should_fail("-161134781826219875", $type, 0); should_fail("-325521743394460605", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('Long', {'maxExclusive' => '-999999999999999998'}); should_fail("-999999999999999998", $type, 0); should_fail("422087990407563173", $type, 0); should_fail("-339322319330811249", $type, 0); should_fail("342669886312905402", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value -75742468208222612." => sub { my $type = mk_type('Long', {'maxExclusive' => '-75742468208222612'}); should_fail("-75742468208222612", $type, 0); should_fail("-31400323710645496", $type, 0); should_fail("11220641590985134", $type, 0); should_fail("913147533063598804", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value 426043137105943214." => sub { my $type = mk_type('Long', {'maxExclusive' => '426043137105943214'}); should_fail("426043137105943214", $type, 0); should_fail("499210806298271291", $type, 0); should_fail("845897864523529612", $type, 0); should_fail("744814266325269324", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value 911347761427307999." => sub { my $type = mk_type('Long', {'maxExclusive' => '911347761427307999'}); should_fail("911347761427307999", $type, 0); should_fail("989033144562084456", $type, 0); should_fail("944503962585307676", $type, 0); should_fail("953828544159003174", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('Long', {'maxExclusive' => '999999999999999999'}); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_fail("523528", $type, 0); should_fail("-83453757559438134", $type, 0); should_fail("-82864921", $type, 0); should_fail("24834653926555265", $type, 0); should_fail("5368", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_fail("6643732616", $type, 0); should_fail("-872475", $type, 0); should_fail("6622853", $type, 0); should_fail("-428237977745", $type, 0); should_fail("88546941", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("7481741375817", $type, 0); should_fail("-24856383", $type, 0); should_fail("72534", $type, 0); should_fail("-112193385578992", $type, 0); should_fail("69519774439863", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("-28847764362258", $type, 0); should_fail("-7848246815716", $type, 0); should_fail("66448574776", $type, 0); should_fail("586544", $type, 0); should_fail("-8", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('Long', {'pattern' => qr/(?ms:^\d{18}$)/}); should_fail("-1448838426", $type, 0); should_fail("-13887678695934982", $type, 0); should_fail("-4461457", $type, 0); should_fail("-61", $type, 0); should_fail("2492224547", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['435335836639','-73160366235125895','-1302746405841812','-54864','-32751','81382','650333774190190','34326204']}); should_fail("-345398431745117306", $type, 0); should_fail("127657392041073069", $type, 0); should_fail("732130377772227224", $type, 0); should_fail("123031806783405084", $type, 0); should_fail("-630366862888847245", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['15262','-608069987034146','-4254','460983752307','-47']}); should_fail("305873581919190229", $type, 0); should_fail("201555919457502952", $type, 0); should_fail("-777124409677342197", $type, 0); should_fail("976496010192487994", $type, 0); should_fail("486599881741643702", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['-134062998509662','-18422694','-8','-802079','-3835']}); should_fail("-279754425781666426", $type, 0); should_fail("786134019132565419", $type, 0); should_fail("-944473943643886481", $type, 0); should_fail("937655730037457501", $type, 0); should_fail("-727874622972624506", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['-40336143872','425850','21','-481972798730214','-690116','-217564772649','-15971601822133','-87317753710']}); should_fail("590935681411644430", $type, 0); should_fail("-239453803593872249", $type, 0); should_fail("-592225327498727915", $type, 0); should_fail("217482413221273817", $type, 0); should_fail("443393241210575883", $type, 0); done_testing; }; subtest "Type atomic/long is restricted by facet enumeration." => sub { my $type = mk_type('Long', {'enumeration' => ['-8966243961509180','-4333144975','-73798832875597','390','875777023288750','-71']}); should_fail("229811982042096740", $type, 0); should_fail("-814928962517383447", $type, 0); should_fail("-822190539041481426", $type, 0); should_fail("602607134494231199", $type, 0); should_fail("229811982042096740", $type, 0); done_testing; }; done_testing; 50negativeInteger.t000664001750001750 7162312404317273 16026 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-999999999999999999'}); should_pass("-999999999999999998", $type, 0); should_pass("-818329512491933862", $type, 0); should_pass("-664485275263920426", $type, 0); should_pass("-740995979813640402", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -435976618086570511." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-435976618086570511'}); should_pass("-435976618086570510", $type, 0); should_pass("-53919386640509476", $type, 0); should_pass("-225930627153700998", $type, 0); should_pass("-410736536149267286", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -900435039333670416." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-900435039333670416'}); should_pass("-900435039333670415", $type, 0); should_pass("-211525512703915963", $type, 0); should_pass("-460069685368384428", $type, 0); should_pass("-339377387206743076", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -495295756372066909." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-495295756372066909'}); should_pass("-495295756372066908", $type, 0); should_pass("-295243202700852519", $type, 0); should_pass("-325162158016492101", $type, 0); should_pass("-211876872550324198", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -2." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-2'}); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -999999999999999999." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-485746829700231197", $type, 0); should_pass("-805738000490561322", $type, 0); should_pass("-649849799367292035", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -440277848538184635." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-440277848538184635'}); should_pass("-440277848538184635", $type, 0); should_pass("-9697736005135568", $type, 0); should_pass("-7632350895753607", $type, 0); should_pass("-7379248125433725", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -539945622984702833." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-539945622984702833'}); should_pass("-539945622984702833", $type, 0); should_pass("-459526312298212931", $type, 0); should_pass("-218061040862121", $type, 0); should_pass("-259667994395542348", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -947674826094804355." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-947674826094804355'}); should_pass("-947674826094804355", $type, 0); should_pass("-312579074702648793", $type, 0); should_pass("-68451092930283082", $type, 0); should_pass("-552221550562783780", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -1." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-1'}); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-999999999999999998'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -866521354558973720." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-866521354558973720'}); should_pass("-999999999999999999", $type, 0); should_pass("-954880220749267418", $type, 0); should_pass("-962884675120571730", $type, 0); should_pass("-971148733548590286", $type, 0); should_pass("-866521354558973721", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -184935339155753553." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-184935339155753553'}); should_pass("-999999999999999999", $type, 0); should_pass("-866443582381708492", $type, 0); should_pass("-414615380928389037", $type, 0); should_pass("-515743231902319800", $type, 0); should_pass("-184935339155753554", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -572450131914860271." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-572450131914860271'}); should_pass("-999999999999999999", $type, 0); should_pass("-934954204455349911", $type, 0); should_pass("-685813274737660968", $type, 0); should_pass("-626892420609938489", $type, 0); should_pass("-572450131914860272", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -1." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-1'}); should_pass("-999999999999999999", $type, 0); should_pass("-6016271999369606", $type, 0); should_pass("-386788852511558923", $type, 0); should_pass("-275298847842965989", $type, 0); should_pass("-2", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -922333322214573646." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-922333322214573646'}); should_pass("-999999999999999999", $type, 0); should_pass("-932149789525735583", $type, 0); should_pass("-951946305725515999", $type, 0); should_pass("-963767697290822707", $type, 0); should_pass("-922333322214573646", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -34749374507754505." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-34749374507754505'}); should_pass("-999999999999999999", $type, 0); should_pass("-523820368232342381", $type, 0); should_pass("-884126792645226095", $type, 0); should_pass("-745050149979268620", $type, 0); should_pass("-34749374507754505", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -666057423564200834." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-666057423564200834'}); should_pass("-999999999999999999", $type, 0); should_pass("-859536992360054974", $type, 0); should_pass("-864728476120857385", $type, 0); should_pass("-762359260826851497", $type, 0); should_pass("-666057423564200834", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -1." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-1'}); should_pass("-999999999999999999", $type, 0); should_pass("-318673160689050494", $type, 0); should_pass("-393749913908599924", $type, 0); should_pass("-614358525691746648", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('NegativeInteger', {'fractionDigits' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("-171881324764382448", $type, 0); should_pass("-244720973181966839", $type, 0); should_pass("-301756094648375273", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '1'}); should_pass("-2", $type, 0); should_pass("-3", $type, 0); should_pass("-6", $type, 0); should_pass("-6", $type, 0); should_pass("-4", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '5'}); should_pass("-2", $type, 0); should_pass("-16", $type, 0); should_pass("-294", $type, 0); should_pass("-1193", $type, 0); should_pass("-73267", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '9'}); should_pass("-4", $type, 0); should_pass("-177", $type, 0); should_pass("-83160", $type, 0); should_pass("-3465945", $type, 0); should_pass("-987457807", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '13'}); should_pass("-4", $type, 0); should_pass("-5271", $type, 0); should_pass("-3126639", $type, 0); should_pass("-4597578363", $type, 0); should_pass("-7247487111835", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '18'}); should_pass("-5", $type, 0); should_pass("-75742", $type, 0); should_pass("-455976320", $type, 0); should_pass("-4445354332577", $type, 0); should_pass("-912762633976188962", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-7", $type, 0); should_pass("-8", $type, 0); should_pass("-8", $type, 0); should_pass("-3", $type, 0); should_pass("-2", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_pass("-76576", $type, 0); should_pass("-92592", $type, 0); should_pass("-28664", $type, 0); should_pass("-73317", $type, 0); should_pass("-47257", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_pass("-165429727", $type, 0); should_pass("-583133911", $type, 0); should_pass("-887829423", $type, 0); should_pass("-774282848", $type, 0); should_pass("-718524348", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{13}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{13}$)/}); should_pass("-6652874376778", $type, 0); should_pass("-5362777997727", $type, 0); should_pass("-2844768288884", $type, 0); should_pass("-5742996298233", $type, 0); should_pass("-5897261686643", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_pass("-914387262474557335", $type, 0); should_pass("-923276382451256268", $type, 0); should_pass("-917314136385244564", $type, 0); should_pass("-931566117363638157", $type, 0); should_pass("-964253325762237153", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-799584049274','-43086541125','-437','-141901608775','-4108769','-965719538530','-9896','-12671901386817929']}); should_pass("-9896", $type, 0); should_pass("-141901608775", $type, 0); should_pass("-437", $type, 0); should_pass("-141901608775", $type, 0); should_pass("-437", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-51678619095983','-2567','-58812994566','-7328890','-759','-567986','-462214','-997161630']}); should_pass("-759", $type, 0); should_pass("-51678619095983", $type, 0); should_pass("-462214", $type, 0); should_pass("-567986", $type, 0); should_pass("-58812994566", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-29566','-51381660407640261','-6839697930198','-627946996321885664','-78815123','-923074469','-74','-13149','-99']}); should_pass("-923074469", $type, 0); should_pass("-51381660407640261", $type, 0); should_pass("-99", $type, 0); should_pass("-13149", $type, 0); should_pass("-74", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-87037330956252501','-36619944811','-57023','-918536646','-399072682','-39747055905837447','-941633341616753']}); should_pass("-36619944811", $type, 0); should_pass("-918536646", $type, 0); should_pass("-57023", $type, 0); should_pass("-87037330956252501", $type, 0); should_pass("-918536646", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-4336721877308','-852169232158110','-6208','-972552137318','-632','-8638729626','-1243882220834','-312437399392143']}); should_pass("-632", $type, 0); should_pass("-6208", $type, 0); should_pass("-972552137318", $type, 0); should_pass("-6208", $type, 0); should_pass("-632", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('NegativeInteger', {'whiteSpace' => 'collapse'}); should_pass("-999999999999999999", $type, 0); should_pass("-165356406576173898", $type, 0); should_pass("-547179558838093771", $type, 0); should_pass("-758569088580481442", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -383278836725871707." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-383278836725871707'}); should_fail("-999999999999999999", $type, 0); should_fail("-702169798022027542", $type, 0); should_fail("-666529727638624998", $type, 0); should_fail("-985972121431104560", $type, 0); should_fail("-383278836725871708", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -349070581849158068." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-349070581849158068'}); should_fail("-999999999999999999", $type, 0); should_fail("-865540392815267322", $type, 0); should_fail("-409845412626426777", $type, 0); should_fail("-402775332169313208", $type, 0); should_fail("-349070581849158069", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -13084299575343628." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-13084299575343628'}); should_fail("-999999999999999999", $type, 0); should_fail("-462923617980921371", $type, 0); should_fail("-318397992456832307", $type, 0); should_fail("-137137183091879389", $type, 0); should_fail("-13084299575343629", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -176155984517072817." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-176155984517072817'}); should_fail("-999999999999999999", $type, 0); should_fail("-987458292566733449", $type, 0); should_fail("-811020132063424031", $type, 0); should_fail("-829439578944992037", $type, 0); should_fail("-176155984517072818", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minInclusive with value -1." => sub { my $type = mk_type('NegativeInteger', {'minInclusive' => '-1'}); should_fail("-999999999999999999", $type, 0); should_fail("-518586297113227457", $type, 0); should_fail("-690472356337122672", $type, 0); should_fail("-195234996010505647", $type, 0); should_fail("-2", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-999999999999999999'}); should_fail("-999999999999999998", $type, 0); should_fail("-283623569470353054", $type, 0); should_fail("-513743212038921703", $type, 0); should_fail("-738432751342086522", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -369278887790841392." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-369278887790841392'}); should_fail("-369278887790841391", $type, 0); should_fail("-78342130091136135", $type, 0); should_fail("-254223661061725469", $type, 0); should_fail("-97858745140121915", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -177604717942529411." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-177604717942529411'}); should_fail("-177604717942529410", $type, 0); should_fail("-131211550622692333", $type, 0); should_fail("-160312980577746200", $type, 0); should_fail("-111775195041801727", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -411412970005971434." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-411412970005971434'}); should_fail("-411412970005971433", $type, 0); should_fail("-234044042183509633", $type, 0); should_fail("-300625725959076879", $type, 0); should_fail("-352625591500965827", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxInclusive with value -135951110411760890." => sub { my $type = mk_type('NegativeInteger', {'maxInclusive' => '-135951110411760890'}); should_fail("-135951110411760889", $type, 0); should_fail("-85974327696241055", $type, 0); should_fail("-112021063643733463", $type, 0); should_fail("-132991626123000178", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '1'}); should_fail("-58", $type, 0); should_fail("-818952", $type, 0); should_fail("-2832450785", $type, 0); should_fail("-77188754766704", $type, 0); should_fail("-355233502652433737", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '4'}); should_fail("-18086", $type, 0); should_fail("-30236688", $type, 0); should_fail("-81144291194", $type, 0); should_fail("-56839769692583", $type, 0); should_fail("-478688135624794333", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '7'}); should_fail("-27860248", $type, 0); should_fail("-6605411553", $type, 0); should_fail("-573349747565", $type, 0); should_fail("-55823956446873", $type, 0); should_fail("-395582881715216836", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '10'}); should_fail("-80764013622", $type, 0); should_fail("-244686357565", $type, 0); should_fail("-6867961201779", $type, 0); should_fail("-76114111985696", $type, 0); should_fail("-408181343177446654", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('NegativeInteger', {'totalDigits' => '13'}); should_fail("-91158467351677", $type, 0); should_fail("-122763668788141", $type, 0); should_fail("-1320423848331330", $type, 0); should_fail("-48844377017825023", $type, 0); should_fail("-788271878309517085", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-999999999999999999'}); should_fail("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -921633907817531072." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-921633907817531072'}); should_fail("-999999999999999999", $type, 0); should_fail("-951595666509219807", $type, 0); should_fail("-949054733442859939", $type, 0); should_fail("-985381760840341098", $type, 0); should_fail("-921633907817531072", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -976782140546110121." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-976782140546110121'}); should_fail("-999999999999999999", $type, 0); should_fail("-988149319138515245", $type, 0); should_fail("-983263510399785395", $type, 0); should_fail("-995748341020440494", $type, 0); should_fail("-976782140546110121", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -788555704125782685." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-788555704125782685'}); should_fail("-999999999999999999", $type, 0); should_fail("-854450049048861665", $type, 0); should_fail("-901885140223494858", $type, 0); should_fail("-816608602126030677", $type, 0); should_fail("-788555704125782685", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet minExclusive with value -2." => sub { my $type = mk_type('NegativeInteger', {'minExclusive' => '-2'}); should_fail("-999999999999999999", $type, 0); should_fail("-996734916696543681", $type, 0); should_fail("-532288887764013729", $type, 0); should_fail("-542195774224826232", $type, 0); should_fail("-2", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-999999999999999998'}); should_fail("-999999999999999998", $type, 0); should_fail("-145345601162744975", $type, 0); should_fail("-359114579536026434", $type, 0); should_fail("-997175199307837376", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -466339041882621318." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-466339041882621318'}); should_fail("-466339041882621318", $type, 0); should_fail("-465181401943681643", $type, 0); should_fail("-455208473908838232", $type, 0); should_fail("-63145281984264547", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -954414372192710523." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-954414372192710523'}); should_fail("-954414372192710523", $type, 0); should_fail("-880236823638807375", $type, 0); should_fail("-41556158763589335", $type, 0); should_fail("-619003189153397151", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -367996043905826186." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-367996043905826186'}); should_fail("-367996043905826186", $type, 0); should_fail("-367572248213243802", $type, 0); should_fail("-222998764331746192", $type, 0); should_fail("-104807281411357482", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet maxExclusive with value -1." => sub { my $type = mk_type('NegativeInteger', {'maxExclusive' => '-1'}); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("-6224178888684242", $type, 0); should_fail("-27738747", $type, 0); should_fail("-917486331664737187", $type, 0); should_fail("-862629", $type, 0); should_fail("-335183", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_fail("-3232", $type, 0); should_fail("-17351737336733", $type, 0); should_fail("-7417355772454323", $type, 0); should_fail("-7918676", $type, 0); should_fail("-893465834", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_fail("-765838262428", $type, 0); should_fail("-58", $type, 0); should_fail("-524428766258666", $type, 0); should_fail("-6843577645466", $type, 0); should_fail("-27787", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{13}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{13}$)/}); should_fail("-64876363769717", $type, 0); should_fail("-8", $type, 0); should_fail("-948175624636772733", $type, 0); should_fail("-35573145", $type, 0); should_fail("-8986529274638524", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('NegativeInteger', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_fail("-282", $type, 0); should_fail("-678426537437946", $type, 0); should_fail("-25276325622825", $type, 0); should_fail("-3197335867", $type, 0); should_fail("-7695854688243555", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-56','-78162','-66','-64290','-53033235677117','-850050','-21344','-1941630','-6523','-650383']}); should_fail("-405001977958150183", $type, 0); should_fail("-926265724849529958", $type, 0); should_fail("-947215466890104384", $type, 0); should_fail("-926265724849529958", $type, 0); should_fail("-320673971316476791", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-607079475462230','-59','-45532879838235473','-75385789227','-1834362131','-85662787813','-10964645614']}); should_fail("-301611282400402802", $type, 0); should_fail("-320264127677682420", $type, 0); should_fail("-909215274749755496", $type, 0); should_fail("-32439581066225576", $type, 0); should_fail("-820566993291908852", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-94847585603997','-20278','-37','-9500135912','-8765337594408015','-52188','-38']}); should_fail("-596049869114037344", $type, 0); should_fail("-681650746687945341", $type, 0); should_fail("-363186156759663370", $type, 0); should_fail("-667584630727504734", $type, 0); should_fail("-414737603349142558", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-7891','-210468','-954966599','-88','-81722239388','-1369568','-203452','-945450049185','-469413']}); should_fail("-870664238957266189", $type, 0); should_fail("-719813955911788760", $type, 0); should_fail("-924064477915192638", $type, 0); should_fail("-870664238957266189", $type, 0); should_fail("-924064477915192638", $type, 0); done_testing; }; subtest "Type atomic/negativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NegativeInteger', {'enumeration' => ['-38626','-758','-14631310','-6832806488697145','-28493065','-913277']}); should_fail("-528129194915475608", $type, 0); should_fail("-986692020455715134", $type, 0); should_fail("-452559197884029096", $type, 0); should_fail("-514570933867417701", $type, 0); should_fail("-479202583663554504", $type, 0); done_testing; }; done_testing; 50nonNegativeInteger.t000664001750001750 7153612404317273 16504 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '0'}); should_pass("1", $type, 0); should_pass("420622914392487334", $type, 0); should_pass("711166205738569922", $type, 0); should_pass("601854033523182785", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 279497457259986536." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '279497457259986536'}); should_pass("279497457259986537", $type, 0); should_pass("565148117926952049", $type, 0); should_pass("849859674658384755", $type, 0); should_pass("512953235511037469", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 12032691129748584." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '12032691129748584'}); should_pass("12032691129748585", $type, 0); should_pass("645354870800451493", $type, 0); should_pass("629087069541260967", $type, 0); should_pass("243398316233110706", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 656186311861347125." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '656186311861347125'}); should_pass("656186311861347126", $type, 0); should_pass("660176223359068458", $type, 0); should_pass("992779479398573116", $type, 0); should_pass("956143781468634329", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '999999999999999998'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '0'}); should_pass("0", $type, 0); should_pass("20650283505041944", $type, 0); should_pass("933739927874715712", $type, 0); should_pass("871902332295281689", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 414410475494371377." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '414410475494371377'}); should_pass("414410475494371377", $type, 0); should_pass("619241322601469913", $type, 0); should_pass("527980315601927548", $type, 0); should_pass("910571910425706802", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 543609894158592842." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '543609894158592842'}); should_pass("543609894158592842", $type, 0); should_pass("949012401326380590", $type, 0); should_pass("979129731672420390", $type, 0); should_pass("604337704629058328", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 430399820504899332." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '430399820504899332'}); should_pass("430399820504899332", $type, 0); should_pass("727896179801196930", $type, 0); should_pass("801292633795849003", $type, 0); should_pass("627092159362274280", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '999999999999999999'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '1'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 671945496538646879." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '671945496538646879'}); should_pass("0", $type, 0); should_pass("261183403354472441", $type, 0); should_pass("194959179560998769", $type, 0); should_pass("361886253563862450", $type, 0); should_pass("671945496538646878", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 278524439385076983." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '278524439385076983'}); should_pass("0", $type, 0); should_pass("253165356347898417", $type, 0); should_pass("62948318663286785", $type, 0); should_pass("197034238665818822", $type, 0); should_pass("278524439385076982", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 486042717509224675." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '486042717509224675'}); should_pass("0", $type, 0); should_pass("198433291959685677", $type, 0); should_pass("10407362817208197", $type, 0); should_pass("102821201977141980", $type, 0); should_pass("486042717509224674", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '999999999999999999'}); should_pass("0", $type, 0); should_pass("140855137347027592", $type, 0); should_pass("706366201258347702", $type, 0); should_pass("882995200557444069", $type, 0); should_pass("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '0'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 495229311196364818." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '495229311196364818'}); should_pass("0", $type, 0); should_pass("187865784376034884", $type, 0); should_pass("151083687173417018", $type, 0); should_pass("492801888814156427", $type, 0); should_pass("495229311196364818", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 154173639038036491." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '154173639038036491'}); should_pass("0", $type, 0); should_pass("131171777416741679", $type, 0); should_pass("42088439900719018", $type, 0); should_pass("34265300879566862", $type, 0); should_pass("154173639038036491", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 467117575036009479." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '467117575036009479'}); should_pass("0", $type, 0); should_pass("438321703526830219", $type, 0); should_pass("100248434061178699", $type, 0); should_pass("209819376569373583", $type, 0); should_pass("467117575036009479", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 999999999999999999." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '999999999999999999'}); should_pass("0", $type, 0); should_pass("386929430516098515", $type, 0); should_pass("430423238640956439", $type, 0); should_pass("819734920144501665", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('NonNegativeInteger', {'fractionDigits' => '0'}); should_pass("0", $type, 0); should_pass("850684867747796501", $type, 0); should_pass("625236343753581613", $type, 0); should_pass("766660829133858467", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '1'}); should_pass("3", $type, 0); should_pass("2", $type, 0); should_pass("9", $type, 0); should_pass("6", $type, 0); should_pass("4", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '5'}); should_pass("6", $type, 0); should_pass("60", $type, 0); should_pass("461", $type, 0); should_pass("1480", $type, 0); should_pass("18618", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '9'}); should_pass("7", $type, 0); should_pass("488", $type, 0); should_pass("88235", $type, 0); should_pass("1425777", $type, 0); should_pass("814118403", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '13'}); should_pass("1", $type, 0); should_pass("2734", $type, 0); should_pass("3973573", $type, 0); should_pass("7346856784", $type, 0); should_pass("8564591727456", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '18'}); should_pass("6", $type, 0); should_pass("44930", $type, 0); should_pass("699879955", $type, 0); should_pass("8521474425424", $type, 0); should_pass("573041487868816274", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("5", $type, 0); should_pass("7", $type, 0); should_pass("8", $type, 0); should_pass("7", $type, 0); should_pass("8", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("61563", $type, 0); should_pass("71174", $type, 0); should_pass("88533", $type, 0); should_pass("84894", $type, 0); should_pass("33775", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{9}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{9}$)/}); should_pass("744672379", $type, 0); should_pass("352843363", $type, 0); should_pass("546285228", $type, 0); should_pass("165766975", $type, 0); should_pass("492246237", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{13}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{13}$)/}); should_pass("3515776629323", $type, 0); should_pass("7439739327795", $type, 0); should_pass("5383645611171", $type, 0); should_pass("7245857231884", $type, 0); should_pass("8362248584526", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{18}$)/}); should_pass("915476347284546727", $type, 0); should_pass("981361845647637366", $type, 0); should_pass("921446647764661256", $type, 0); should_pass("946444323178626635", $type, 0); should_pass("936153437421347234", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['95273492','65117369587117','63','566057831','75769970879','61084065764','49778069509229']}); should_pass("95273492", $type, 0); should_pass("95273492", $type, 0); should_pass("61084065764", $type, 0); should_pass("75769970879", $type, 0); should_pass("75769970879", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['58297003663756774','55','87918438408','92809813592','12914741768813','50094']}); should_pass("87918438408", $type, 0); should_pass("87918438408", $type, 0); should_pass("92809813592", $type, 0); should_pass("87918438408", $type, 0); should_pass("50094", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['23892815','90576835920','424484','79896','9556157928','9176','802100066184431','668936','849475711356152407','71162303480519']}); should_pass("849475711356152407", $type, 0); should_pass("9176", $type, 0); should_pass("802100066184431", $type, 0); should_pass("668936", $type, 0); should_pass("849475711356152407", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['165524680951923075','25316000768963','641253638624229571','90692','6809792634202668','5435077718428','75086583090071','17593746']}); should_pass("641253638624229571", $type, 0); should_pass("75086583090071", $type, 0); should_pass("75086583090071", $type, 0); should_pass("6809792634202668", $type, 0); should_pass("25316000768963", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['153','30','1530','125','68919387654218','261','8001281','29523017399162965','873']}); should_pass("30", $type, 0); should_pass("261", $type, 0); should_pass("30", $type, 0); should_pass("8001281", $type, 0); should_pass("1530", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('NonNegativeInteger', {'whiteSpace' => 'collapse'}); should_pass("0", $type, 0); should_pass("663569508556448694", $type, 0); should_pass("749876594474212065", $type, 0); should_pass("163817072726506918", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 68621188090916995." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '68621188090916995'}); should_fail("0", $type, 0); should_fail("49164518756074332", $type, 0); should_fail("47784213665996517", $type, 0); should_fail("46938487223960270", $type, 0); should_fail("68621188090916994", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 414683870939169918." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '414683870939169918'}); should_fail("0", $type, 0); should_fail("299190482066150346", $type, 0); should_fail("7672435498459624", $type, 0); should_fail("40802468802545157", $type, 0); should_fail("414683870939169917", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 705386240938976837." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '705386240938976837'}); should_fail("0", $type, 0); should_fail("511692812622593162", $type, 0); should_fail("229783343553290588", $type, 0); should_fail("508118155474036901", $type, 0); should_fail("705386240938976836", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 586989978554113389." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '586989978554113389'}); should_fail("0", $type, 0); should_fail("434690454850062370", $type, 0); should_fail("208777471342449354", $type, 0); should_fail("72011835839441353", $type, 0); should_fail("586989978554113388", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('NonNegativeInteger', {'minInclusive' => '999999999999999999'}); should_fail("0", $type, 0); should_fail("70983889130972976", $type, 0); should_fail("266303028029555188", $type, 0); should_fail("886245613321752110", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '0'}); should_fail("1", $type, 0); should_fail("140801489300441785", $type, 0); should_fail("169221912742806402", $type, 0); should_fail("198618706990894567", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 297689380360350197." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '297689380360350197'}); should_fail("297689380360350198", $type, 0); should_fail("896414932894558138", $type, 0); should_fail("965591322660256205", $type, 0); should_fail("682141799706741747", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 303742718992286664." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '303742718992286664'}); should_fail("303742718992286665", $type, 0); should_fail("595140762320601980", $type, 0); should_fail("903052347790957108", $type, 0); should_fail("705072694493848030", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 378879032113847990." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '378879032113847990'}); should_fail("378879032113847991", $type, 0); should_fail("606255497292639091", $type, 0); should_fail("847671278101021575", $type, 0); should_fail("895766837444982417", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxInclusive with value 5840324392176410." => sub { my $type = mk_type('NonNegativeInteger', {'maxInclusive' => '5840324392176410'}); should_fail("5840324392176411", $type, 0); should_fail("564773605595527686", $type, 0); should_fail("412546318997669526", $type, 0); should_fail("121085269362897124", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '1'}); should_fail("43", $type, 0); should_fail("122613", $type, 0); should_fail("8413456671", $type, 0); should_fail("88317353381013", $type, 0); should_fail("115913271327648484", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '4'}); should_fail("11545", $type, 0); should_fail("16373457", $type, 0); should_fail("16639132605", $type, 0); should_fail("56611153511628", $type, 0); should_fail("633268051751428648", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '7'}); should_fail("60326505", $type, 0); should_fail("1984865648", $type, 0); should_fail("274752962975", $type, 0); should_fail("18663945150129", $type, 0); should_fail("289379373673313139", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '10'}); should_fail("81692927074", $type, 0); should_fail("923207941036", $type, 0); should_fail("6377142241925", $type, 0); should_fail("36365253771732", $type, 0); should_fail("936784857313111338", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('NonNegativeInteger', {'totalDigits' => '13'}); should_fail("10432728981242", $type, 0); should_fail("170800797529838", $type, 0); should_fail("4475447211351286", $type, 0); should_fail("73361303663331944", $type, 0); should_fail("954488713077402163", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '0'}); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 832032588787707803." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '832032588787707803'}); should_fail("0", $type, 0); should_fail("488893885808247156", $type, 0); should_fail("463796524911268092", $type, 0); should_fail("726909715477858746", $type, 0); should_fail("832032588787707803", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 105669227618697569." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '105669227618697569'}); should_fail("0", $type, 0); should_fail("13443293542706066", $type, 0); should_fail("4590498223110692", $type, 0); should_fail("86624382942676538", $type, 0); should_fail("105669227618697569", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 679939135819036087." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '679939135819036087'}); should_fail("0", $type, 0); should_fail("646114791168737948", $type, 0); should_fail("416670691466157256", $type, 0); should_fail("619405580197060783", $type, 0); should_fail("679939135819036087", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('NonNegativeInteger', {'minExclusive' => '999999999999999998'}); should_fail("0", $type, 0); should_fail("44510725441964549", $type, 0); should_fail("632224246631051588", $type, 0); should_fail("479572940356873255", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '1'}); should_fail("1", $type, 0); should_fail("813414117892087839", $type, 0); should_fail("386816443373796947", $type, 0); should_fail("525521044684190807", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 342271279747271451." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '342271279747271451'}); should_fail("342271279747271451", $type, 0); should_fail("362882772320813288", $type, 0); should_fail("723962147859572241", $type, 0); should_fail("505440518618352839", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 588497386592158222." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '588497386592158222'}); should_fail("588497386592158222", $type, 0); should_fail("979539619900485450", $type, 0); should_fail("671301357771440926", $type, 0); should_fail("657245208214284995", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 939225066502577531." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '939225066502577531'}); should_fail("939225066502577531", $type, 0); should_fail("951042209140048583", $type, 0); should_fail("999769866304810403", $type, 0); should_fail("960823280578121666", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('NonNegativeInteger', {'maxExclusive' => '999999999999999999'}); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("4335235", $type, 0); should_fail("77", $type, 0); should_fail("227847", $type, 0); should_fail("6685661154", $type, 0); should_fail("668578721731", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("39855645", $type, 0); should_fail("73", $type, 0); should_fail("34889484", $type, 0); should_fail("6617681", $type, 0); should_fail("8485562656353", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{9}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{9}$)/}); should_fail("35184452224", $type, 0); should_fail("17", $type, 0); should_fail("85977", $type, 0); should_fail("74285", $type, 0); should_fail("923854877522245335", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{13}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{13}$)/}); should_fail("3365452747", $type, 0); should_fail("7", $type, 0); should_fail("845326", $type, 0); should_fail("72383255", $type, 0); should_fail("625872", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('NonNegativeInteger', {'pattern' => qr/(?ms:^\d{18}$)/}); should_fail("6462125255", $type, 0); should_fail("364364648671", $type, 0); should_fail("5268764", $type, 0); should_fail("53", $type, 0); should_fail("8175", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['776323406067','206297852961434','95331661707','109','48643141634619724','18422725621481','624114','6673263269','45652654523739','96580177']}); should_fail("415649926964222648", $type, 0); should_fail("363425438012047629", $type, 0); should_fail("662399176410003897", $type, 0); should_fail("569046552683175054", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['4666174071','39397','8953001','3442650103366697','9520089393']}); should_fail("244875952415783193", $type, 0); should_fail("367027716907425860", $type, 0); should_fail("367027716907425860", $type, 0); should_fail("294856988641413297", $type, 0); should_fail("327115986022324056", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['8994372964782390','2809248792','522963765406','31','89802913','21477296244931554','79197097026683','484172467095720','35798849826','153430671']}); should_fail("686625997375219120", $type, 0); should_fail("827409826444820971", $type, 0); should_fail("686625997375219120", $type, 0); should_fail("765625700375572869", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['5098','8617','1695','858844803','85079597812283','653962539349469','11533256458']}); should_fail("999707256508818308", $type, 0); should_fail("74639484924701293", $type, 0); should_fail("526433650826933718", $type, 0); should_fail("348804558062742797", $type, 0); should_fail("585614304285726471", $type, 0); done_testing; }; subtest "Type atomic/nonNegativeInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonNegativeInteger', {'enumeration' => ['792019','1391782096775','59258070060798884','128','90280268073','43172','41030']}); should_fail("219550401864674893", $type, 0); should_fail("610262149218043114", $type, 0); should_fail("101141510136071199", $type, 0); should_fail("425078491289867077", $type, 0); should_fail("610262149218043114", $type, 0); done_testing; }; done_testing; 50nonPositiveInteger.t000664001750001750 7235112404317273 16540 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-999999999999999999'}); should_pass("-999999999999999998", $type, 0); should_pass("-905988655891905690", $type, 0); should_pass("-290106735591304731", $type, 0); should_pass("-810915085663024613", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -482054947069493477." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-482054947069493477'}); should_pass("-482054947069493476", $type, 0); should_pass("-201826549746962768", $type, 0); should_pass("-112150045490162742", $type, 0); should_pass("-408029346335664256", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -406392790344449528." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-406392790344449528'}); should_pass("-406392790344449527", $type, 0); should_pass("-281004217978489778", $type, 0); should_pass("-208581781143212700", $type, 0); should_pass("-33364160796484990", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -594976296252018754." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-594976296252018754'}); should_pass("-594976296252018753", $type, 0); should_pass("-255265502493433159", $type, 0); should_pass("-381628976206782991", $type, 0); should_pass("-474274082065671734", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -1." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-1'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -999999999999999999." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); should_pass("-514604280507368505", $type, 0); should_pass("-83583574885654487", $type, 0); should_pass("-505473555297749954", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -927820889571802863." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-927820889571802863'}); should_pass("-927820889571802863", $type, 0); should_pass("-156360166869488276", $type, 0); should_pass("-325086174575775878", $type, 0); should_pass("-88105372236679898", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -214379312213180406." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-214379312213180406'}); should_pass("-214379312213180406", $type, 0); should_pass("-153719698257793504", $type, 0); should_pass("-27445027048368935", $type, 0); should_pass("-32102847658518338", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -911248228325171715." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-911248228325171715'}); should_pass("-911248228325171715", $type, 0); should_pass("-71699205998103321", $type, 0); should_pass("-287523941873722043", $type, 0); should_pass("-600807522347121358", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '0'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-999999999999999998'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -267691436022826633." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-267691436022826633'}); should_pass("-999999999999999999", $type, 0); should_pass("-741114493510696257", $type, 0); should_pass("-344055993533620673", $type, 0); should_pass("-985355471466500825", $type, 0); should_pass("-267691436022826634", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -64116953963150757." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-64116953963150757'}); should_pass("-999999999999999999", $type, 0); should_pass("-935506704938491307", $type, 0); should_pass("-190406070523111214", $type, 0); should_pass("-309195465747117080", $type, 0); should_pass("-64116953963150758", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -398718969796236887." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-398718969796236887'}); should_pass("-999999999999999999", $type, 0); should_pass("-766850543644733626", $type, 0); should_pass("-895067844361676168", $type, 0); should_pass("-492234184111664960", $type, 0); should_pass("-398718969796236888", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value 0." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("-981113330609807431", $type, 0); should_pass("-634906667179249039", $type, 0); should_pass("-80582241587873749", $type, 0); should_pass("-1", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-999999999999999999'}); should_pass("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -63404852978511949." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-63404852978511949'}); should_pass("-999999999999999999", $type, 0); should_pass("-106172108207356609", $type, 0); should_pass("-318208363019321686", $type, 0); should_pass("-546425195624242438", $type, 0); should_pass("-63404852978511949", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -78303033269241706." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-78303033269241706'}); should_pass("-999999999999999999", $type, 0); should_pass("-473418910026643198", $type, 0); should_pass("-622517735700789671", $type, 0); should_pass("-905913138266054961", $type, 0); should_pass("-78303033269241706", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -686635117591375964." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-686635117591375964'}); should_pass("-999999999999999999", $type, 0); should_pass("-996746452401836103", $type, 0); should_pass("-867835744993880221", $type, 0); should_pass("-845649434684695218", $type, 0); should_pass("-686635117591375964", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("-60998369586791056", $type, 0); should_pass("-517125678919806097", $type, 0); should_pass("-62209535110962277", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('NonPositiveInteger', {'fractionDigits' => '0'}); should_pass("-999999999999999999", $type, 0); should_pass("-867815918966345355", $type, 0); should_pass("-409756946594936443", $type, 0); should_pass("-943790338064085076", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '1'}); should_pass("-3", $type, 0); should_pass("-6", $type, 0); should_pass("-1", $type, 0); should_pass("-4", $type, 0); should_pass("-9", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '5'}); should_pass("-8", $type, 0); should_pass("-42", $type, 0); should_pass("-225", $type, 0); should_pass("-6099", $type, 0); should_pass("-38541", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '9'}); should_pass("-8", $type, 0); should_pass("-531", $type, 0); should_pass("-21345", $type, 0); should_pass("-9113291", $type, 0); should_pass("-313528833", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '13'}); should_pass("-8", $type, 0); should_pass("-9602", $type, 0); should_pass("-1697397", $type, 0); should_pass("-7685547334", $type, 0); should_pass("-2574750577713", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '18'}); should_pass("-7", $type, 0); should_pass("-33606", $type, 0); should_pass("-435467090", $type, 0); should_pass("-6788246588007", $type, 0); should_pass("-777517648312366647", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-8", $type, 0); should_pass("-8", $type, 0); should_pass("-5", $type, 0); should_pass("-2", $type, 0); should_pass("-8", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_pass("-78241", $type, 0); should_pass("-52356", $type, 0); should_pass("-36965", $type, 0); should_pass("-68554", $type, 0); should_pass("-63668", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_pass("-488322716", $type, 0); should_pass("-437225795", $type, 0); should_pass("-744662475", $type, 0); should_pass("-288473844", $type, 0); should_pass("-986452775", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{13}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{13}$)/}); should_pass("-8275124922345", $type, 0); should_pass("-2469517378287", $type, 0); should_pass("-4715332476686", $type, 0); should_pass("-1895527583514", $type, 0); should_pass("-8372678763482", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_pass("-936563332352235635", $type, 0); should_pass("-942544636732766563", $type, 0); should_pass("-913235447674617174", $type, 0); should_pass("-914656717751452542", $type, 0); should_pass("-962563545524633342", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-2','-9433249751626','-490343697','-34057323631','-4061916853','-761218']}); should_pass("-4061916853", $type, 0); should_pass("-761218", $type, 0); should_pass("-761218", $type, 0); should_pass("-490343697", $type, 0); should_pass("-490343697", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-559044','-69','-40316819','-351','-712506','-118','-748','-23407037','-19','-677813318583757']}); should_pass("-748", $type, 0); should_pass("-40316819", $type, 0); should_pass("-748", $type, 0); should_pass("-69", $type, 0); should_pass("-712506", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-10458828265','-39825826839070','-8989002307','-50729019','-805328452431','-9862058680016422','-92','-29118543','-71959641']}); should_pass("-8989002307", $type, 0); should_pass("-29118543", $type, 0); should_pass("-29118543", $type, 0); should_pass("-8989002307", $type, 0); should_pass("-9862058680016422", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-4710744954','-1090','-9949071662356567','-9764893','-774596823389670285','-216459046','-209931154']}); should_pass("-1090", $type, 0); should_pass("-9764893", $type, 0); should_pass("-774596823389670285", $type, 0); should_pass("-216459046", $type, 0); should_pass("-774596823389670285", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-71','-611','-27','-241238476','-8591039','-934828787','-342967456457','-841018047002872','-8884375099']}); should_pass("-611", $type, 0); should_pass("-241238476", $type, 0); should_pass("-841018047002872", $type, 0); should_pass("-342967456457", $type, 0); should_pass("-27", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('NonPositiveInteger', {'whiteSpace' => 'collapse'}); should_pass("-999999999999999999", $type, 0); should_pass("-336938973883109115", $type, 0); should_pass("-164737809714792127", $type, 0); should_pass("-409009825015166805", $type, 0); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -269608150885451202." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-269608150885451202'}); should_fail("-999999999999999999", $type, 0); should_fail("-389294831499795693", $type, 0); should_fail("-293692742896350827", $type, 0); should_fail("-983208627966342561", $type, 0); should_fail("-269608150885451203", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -890254333493681659." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-890254333493681659'}); should_fail("-999999999999999999", $type, 0); should_fail("-926580995300126740", $type, 0); should_fail("-946004331892225444", $type, 0); should_fail("-997058928016916483", $type, 0); should_fail("-890254333493681660", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -203590473966627882." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-203590473966627882'}); should_fail("-999999999999999999", $type, 0); should_fail("-389158202230241307", $type, 0); should_fail("-725110076828486213", $type, 0); should_fail("-382574530274989215", $type, 0); should_fail("-203590473966627883", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value -228784597763440178." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '-228784597763440178'}); should_fail("-999999999999999999", $type, 0); should_fail("-727240079311177310", $type, 0); should_fail("-953315392318688509", $type, 0); should_fail("-520389547660290105", $type, 0); should_fail("-228784597763440179", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('NonPositiveInteger', {'minInclusive' => '0'}); should_fail("-999999999999999999", $type, 0); should_fail("-250580201345327214", $type, 0); should_fail("-345783375965520223", $type, 0); should_fail("-492839161375730694", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -999999999999999999." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-999999999999999999'}); should_fail("-999999999999999998", $type, 0); should_fail("-838154723768013252", $type, 0); should_fail("-354221138603540430", $type, 0); should_fail("-706632266417767772", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -593437050761786099." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-593437050761786099'}); should_fail("-593437050761786098", $type, 0); should_fail("-138449568698411934", $type, 0); should_fail("-587493942186698299", $type, 0); should_fail("-249368885741101753", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -923171155172606060." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-923171155172606060'}); should_fail("-923171155172606059", $type, 0); should_fail("-41939930644503284", $type, 0); should_fail("-208864230497451625", $type, 0); should_fail("-35995692169824455", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -850796917225226100." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-850796917225226100'}); should_fail("-850796917225226099", $type, 0); should_fail("-78470538010152981", $type, 0); should_fail("-141809537111496421", $type, 0); should_fail("-225569617986930453", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxInclusive with value -196913225599862462." => sub { my $type = mk_type('NonPositiveInteger', {'maxInclusive' => '-196913225599862462'}); should_fail("-196913225599862461", $type, 0); should_fail("-122943505382308148", $type, 0); should_fail("-1741256791526694", $type, 0); should_fail("-151863541637642114", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '1'}); should_fail("-40", $type, 0); should_fail("-577251", $type, 0); should_fail("-2663520623", $type, 0); should_fail("-73212184903048", $type, 0); should_fail("-349504324017759461", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '4'}); should_fail("-27071", $type, 0); should_fail("-14583578", $type, 0); should_fail("-35952536628", $type, 0); should_fail("-40802634248261", $type, 0); should_fail("-449887659171104609", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '7'}); should_fail("-69435458", $type, 0); should_fail("-8891934243", $type, 0); should_fail("-714271107488", $type, 0); should_fail("-43844327248488", $type, 0); should_fail("-302778408231437852", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '10'}); should_fail("-57691455131", $type, 0); should_fail("-245941620212", $type, 0); should_fail("-1428731864416", $type, 0); should_fail("-33312167919807", $type, 0); should_fail("-248648124166262261", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('NonPositiveInteger', {'totalDigits' => '13'}); should_fail("-53297507933173", $type, 0); should_fail("-174713368831614", $type, 0); should_fail("-2787813748806156", $type, 0); should_fail("-16182259713041554", $type, 0); should_fail("-524968710237166743", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -999999999999999999." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-999999999999999999'}); should_fail("-999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -572157627064420859." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-572157627064420859'}); should_fail("-999999999999999999", $type, 0); should_fail("-928148707875611681", $type, 0); should_fail("-886568633074002832", $type, 0); should_fail("-665290110456655127", $type, 0); should_fail("-572157627064420859", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -717484827624413345." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-717484827624413345'}); should_fail("-999999999999999999", $type, 0); should_fail("-728016069820303410", $type, 0); should_fail("-866446949329529514", $type, 0); should_fail("-821705741031630961", $type, 0); should_fail("-717484827624413345", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -791138773234574931." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-791138773234574931'}); should_fail("-999999999999999999", $type, 0); should_fail("-928318088638857581", $type, 0); should_fail("-926771981913107160", $type, 0); should_fail("-899773724187238059", $type, 0); should_fail("-791138773234574931", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet minExclusive with value -1." => sub { my $type = mk_type('NonPositiveInteger', {'minExclusive' => '-1'}); should_fail("-999999999999999999", $type, 0); should_fail("-873838499504295817", $type, 0); should_fail("-305614124670335330", $type, 0); should_fail("-110339095313123026", $type, 0); should_fail("-1", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -999999999999999998." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-999999999999999998'}); should_fail("-999999999999999998", $type, 0); should_fail("-718138374788761189", $type, 0); should_fail("-446535343371481484", $type, 0); should_fail("-702833914246292378", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -698542836566919399." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-698542836566919399'}); should_fail("-698542836566919399", $type, 0); should_fail("-57880152026340493", $type, 0); should_fail("-458861167247245026", $type, 0); should_fail("-436071170160881216", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -730118541643560268." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-730118541643560268'}); should_fail("-730118541643560268", $type, 0); should_fail("-89298064474577713", $type, 0); should_fail("-555479316813332199", $type, 0); should_fail("-485487302763131155", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value -145124311590065779." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '-145124311590065779'}); should_fail("-145124311590065779", $type, 0); should_fail("-60212599132106189", $type, 0); should_fail("-68888204860155179", $type, 0); should_fail("-80561746828064702", $type, 0); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet maxExclusive with value 0." => sub { my $type = mk_type('NonPositiveInteger', {'maxExclusive' => '0'}); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("-2944", $type, 0); should_fail("-84382889683379", $type, 0); should_fail("-72847445", $type, 0); should_fail("-316573813744", $type, 0); should_fail("-43534164", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_fail("-922653546988", $type, 0); should_fail("-7967", $type, 0); should_fail("-7547535873", $type, 0); should_fail("-62748861729234844", $type, 0); should_fail("-577473345", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{9}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{9}$)/}); should_fail("-87135695", $type, 0); should_fail("-287435868776", $type, 0); should_fail("-1533523342", $type, 0); should_fail("-25959", $type, 0); should_fail("-298362", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{13}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{13}$)/}); should_fail("-83736172817", $type, 0); should_fail("-686465751752", $type, 0); should_fail("-4", $type, 0); should_fail("-4", $type, 0); should_fail("-947565246385256254", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet pattern with value \\-\\d{18}." => sub { my $type = mk_type('NonPositiveInteger', {'pattern' => qr/(?ms:^\-\d{18}$)/}); should_fail("-64954588", $type, 0); should_fail("-44652546", $type, 0); should_fail("-78771773424874684", $type, 0); should_fail("-961813642", $type, 0); should_fail("-6335537862842", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-29490','-303','-73972936855','-19635989421241','-16838537','-40673062','-85295918','-387069093','-1203933612287135']}); should_fail("-555070367802298014", $type, 0); should_fail("-335893637421509793", $type, 0); should_fail("-369608200113519802", $type, 0); should_fail("-112026868098659248", $type, 0); should_fail("-360925289666946813", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-2755','-211641047466678','-8075493294856522','-678561','-175870582528','-715614697774']}); should_fail("-876186417532006877", $type, 0); should_fail("-660065142213748567", $type, 0); should_fail("-656032272225989365", $type, 0); should_fail("-356592693188201081", $type, 0); should_fail("-795920270681258367", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-92771046753','-563135454','-918435967979','-1','-10650441353166639']}); should_fail("-511157760572277796", $type, 0); should_fail("-693810004742233420", $type, 0); should_fail("-433490516337204700", $type, 0); should_fail("-136027461971012342", $type, 0); should_fail("-503867689398694195", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-467623039','-6728877914982','-331486169353','-16','-88530367946759','-68666','-37798693952976']}); should_fail("-139412945140734878", $type, 0); should_fail("-703463435374974576", $type, 0); should_fail("-216525328808880312", $type, 0); should_fail("-917371313089531902", $type, 0); should_fail("-157030679799715633", $type, 0); done_testing; }; subtest "Type atomic/nonPositiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('NonPositiveInteger', {'enumeration' => ['-5225075','-36843','-230','-20382978','-7843737','-8212','-1033086645']}); should_fail("-304729948399550032", $type, 0); should_fail("-104695326054680681", $type, 0); should_fail("-661256908744913273", $type, 0); should_fail("-933227475071535027", $type, 0); should_fail("-803859958473912560", $type, 0); done_testing; }; done_testing; 50normalizedString.t000664001750001750 27570112404317273 16264 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/normalizedString is restricted by facet maxLength with value 0." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '0'}); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 861." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '861'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced", $type, 0); should_pass(" concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computer", $type, 0); should_pass("s to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from we", $type, 0); should_pass("b browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conf", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 295." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '295'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language f", $type, 0); should_pass("or defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced con", $type, 0); should_pass("cepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world ", $type, 0); should_pass(" XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to ", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 266." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '266'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation lan", $type, 0); should_pass("guage for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML w", $type, 0); should_pass("ith more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one o", $type, 0); should_pass("f the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 1000." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '1000'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commu", $type, 0); should_pass("nity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain ", $type, 0); should_pass("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processo", $type, 0); should_pass("rs and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tes", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 0." => sub { my $type = mk_type('NormalizedString', {'minLength' => '0'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commu", $type, 0); should_pass("nity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain ", $type, 0); should_pass("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processo", $type, 0); should_pass("rs and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tes", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 139." => sub { my $type = mk_type('NormalizedString', {'minLength' => '139'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the wo", $type, 0); should_pass("rld s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applicati", $type, 0); should_pass("ons alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for i", $type, 0); should_pass("nteracting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations", $type, 0); should_pass(" is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as m", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 628." => sub { my $type = mk_type('NormalizedString', {'minLength' => '628'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way tha", $type, 0); should_pass("t allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virt", $type, 0); should_pass("ually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NI", $type, 0); should_pass("ST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widel", $type, 0); should_pass("y used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 74." => sub { my $type = mk_type('NormalizedString', {'minLength' => '74'}); should_pass("The advent of Internet-enabled browsers and a first-generation language fo", $type, 0); should_pass("r defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapid", $type, 0); should_pass("ly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-r", $type, 0); should_pass("ich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availabili", $type, 0); should_pass("ty of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML S", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 1000." => sub { my $type = mk_type('NormalizedString', {'minLength' => '1000'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex do", $type, 0); should_pass("cuments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to ", $type, 0); should_pass("accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS X", $type, 0); should_pass("ML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging sp", $type, 0); should_pass("ecifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies for business relationships and transactions The vocabularies business templates and business processes ", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 0." => sub { my $type = mk_type('NormalizedString', {'length' => '0'}); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 625." => sub { my $type = mk_type('NormalizedString', {'length' => '625'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way ", $type, 0); should_pass("that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML do", $type, 0); should_pass("cuments on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build intero", $type, 0); should_pass("perable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tes", $type, 0); should_pass("t frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed i", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 916." => sub { my $type = mk_type('NormalizedString', {'length' => '916'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-ri", $type, 0); should_pass("ch data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C R", $type, 0); should_pass("ecommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generatio", $type, 0); should_pass("n for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit ", $type, 0); should_pass("intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of th", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 645." => sub { my $type = mk_type('NormalizedString', {'length' => '645'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computer", $type, 0); should_pass("s to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from we", $type, 0); should_pass("b browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of S", $type, 0); should_pass("tructured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner wi", $type, 0); should_pass("th industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including X", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 1000." => sub { my $type = mk_type('NormalizedString', {'length' => '1000'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex do", $type, 0); should_pass("cuments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to ", $type, 0); should_pass("accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS X", $type, 0); should_pass("ML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging sp", $type, 0); should_pass("ecifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies for business relationships and transactions The vocabularies business templates and business processes ", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\s([A-Z][a-z]{1,20}\\s){1},\\s[A-Z]{2}\\s18037." => sub { my $type = mk_type('NormalizedString', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\s([A-Z][a-z]{1,20}\s){1},\s[A-Z]{2}\s18037$)/}); should_pass("8259 Structured Participants And Of Street Forum , MT 18037", $type, 0); should_pass("55 Improved Computing Future Such Street Individual , OR 18037", $type, 0); should_pass("32 To And And Collaborate Street Organizations , DE 18037", $type, 0); should_pass("735 To Groups Signatures Acting Street And , MI 18037", $type, 0); should_pass("874 Of Primary Standards To Street Disseminate , HI 18037", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\s([A-Z][a-z]{1,20}\\s){2},\\s[A-Z]{2}\\s11352." => sub { my $type = mk_type('NormalizedString', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\s([A-Z][a-z]{1,20}\s){2},\s[A-Z]{2}\s11352$)/}); should_pass("63663 That These At Certain Street Meets Of , MI 11352", $type, 0); should_pass("9568 Registry Standards Those Beta Street Of Organizations , IA 11352", $type, 0); should_pass("637 For Issues Associated Guidelines Street Better Of , LA 11352", $type, 0); should_pass("1 Both Language Is And Street Must Infrastructure , SC 11352", $type, 0); should_pass("7 Modeling Versions To The Street Is File , CT 11352", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\s([A-Z][a-z]{1,20}\\s){3},\\s[A-Z]{2}\\s12317." => sub { my $type = mk_type('NormalizedString', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\s([A-Z][a-z]{1,20}\s){3},\s[A-Z]{2}\s12317$)/}); should_pass("4 The Language That Reviewed Street Object Furthermore Not , AL 12317", $type, 0); should_pass("382 This Academy Is Is Street For Accelerate Computing , NY 12317", $type, 0); should_pass("437 Promises That Allow Xml Street The Software Review , UT 12317", $type, 0); should_pass("31272 Technical To On To Street As Software And , WA 12317", $type, 0); should_pass("66 Build The Law Into Street Defining Industry Be , MD 12317", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){1}Street\\s([A-Z][a-z]{1,20}\\s){1},\\s[A-Z]{2}\\s17076." => sub { my $type = mk_type('NormalizedString', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){1}Street\s([A-Z][a-z]{1,20}\s){1},\s[A-Z]{2}\s17076$)/}); should_pass("5 Provide Street Location , SD 17076", $type, 0); should_pass("81846 Reviewed Street By , IL 17076", $type, 0); should_pass("537 Dom Street In , WI 17076", $type, 0); should_pass("4 If Street Bandwidth , UT 17076", $type, 0); should_pass("89 Offer Street Dom , HI 17076", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){1}Street\\s([A-Z][a-z]{1,20}\\s){3},\\s[A-Z]{2}\\s19099-1858." => sub { my $type = mk_type('NormalizedString', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){1}Street\s([A-Z][a-z]{1,20}\s){3},\s[A-Z]{2}\s19099-1858$)/}); should_pass("3453 Of Street Do Of Security , NM 19099-1858", $type, 0); should_pass("236 Industry Street Chi Standardization Tools , NE 19099-1858", $type, 0); should_pass("154 Be Street Of Database Oasis , IL 19099-1858", $type, 0); should_pass("837 Provide Street Information The Environments , DE 19099-1858", $type, 0); should_pass("158 Intelligent Street Files And Documents , ME 19099-1858", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet enumeration." => sub { my $type = mk_type('NormalizedString', {'enumeration' => ['tests','Therefore','by','Such','participating','into','and']}); should_pass("and", $type, 0); should_pass("Therefore", $type, 0); should_pass("participating", $type, 0); should_pass("participating", $type, 0); should_pass("participating", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet enumeration." => sub { my $type = mk_type('NormalizedString', {'enumeration' => ['be','as','tools','XML','Such','creates','related','software']}); should_pass("Such", $type, 0); should_pass("Such", $type, 0); should_pass("Such", $type, 0); should_pass("tools", $type, 0); should_pass("related", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet enumeration." => sub { my $type = mk_type('NormalizedString', {'enumeration' => ['and','NIST','enabling','manufacturers','database','the','pico-cellular','including','ebXML']}); should_pass("the", $type, 0); should_pass("enabling", $type, 0); should_pass("database", $type, 0); should_pass("enabling", $type, 0); should_pass("NIST", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet enumeration." => sub { my $type = mk_type('NormalizedString', {'enumeration' => ['without','measurement','and','engineering','of']}); should_pass("of", $type, 0); should_pass("of", $type, 0); should_pass("and", $type, 0); should_pass("without", $type, 0); should_pass("without", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet enumeration." => sub { my $type = mk_type('NormalizedString', {'enumeration' => ['By','devices','the','PC','be','operating']}); should_pass("By", $type, 0); should_pass("PC", $type, 0); should_pass("PC", $type, 0); should_pass("PC", $type, 0); should_pass("PC", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet whiteSpace with value replace." => sub { my $type = mk_type('NormalizedString', {'whiteSpace' => 'replace'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defi", $type, 0); should_pass("ning data known as HTML has led to the creation of the world s first digital l", $type, 0); should_pass("ibrary Using the simplicity of HTML with more advanced concepts from the publis", $type, 0); should_pass("hing community has led to the creation of a second-generation Internet language ", $type, 0); should_pass("called the Extensible Markup Language XML which is rapidly becoming one of th", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('NormalizedString', {'whiteSpace' => 'collapse'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defi", $type, 0); should_pass("ning data known as HTML has led to the creation of the world s first digital lib", $type, 0); should_pass("rary Using the simplicity of HTML with more advanced concepts from the publishin", $type, 0); should_pass("g community has led to the creation of a second-generation Internet language cal", $type, 0); should_pass("led the Extensible Markup Language XML which is rapidly becoming one of the most", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 261." => sub { my $type = mk_type('NormalizedString', {'minLength' => '261'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation la", $type, 0); should_fail("nguage for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTM", $type, 0); should_fail("L with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming", $type, 0); should_fail(" one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to ", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 247." => sub { my $type = mk_type('NormalizedString', {'minLength' => '247'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generatio", $type, 0); should_fail("n language for defining data known as HTML has led to the creation of the world s first digital library Using the simpl", $type, 0); should_fail("icity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML w", $type, 0); should_fail("hich is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes informat", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 230." => sub { my $type = mk_type('NormalizedString', {'minLength' => '230'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-gener", $type, 0); should_fail("ation language for defining data known as HTML has led to the creation of the world s first digital library Usi", $type, 0); should_fail("ng the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible ", $type, 0); should_fail("Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications ", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 452." => sub { my $type = mk_type('NormalizedString', {'minLength' => '452'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has le", $type, 0); should_fail("d to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Exten", $type, 0); should_fail("sible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatic", $type, 0); should_fail("ally act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet minLength with value 1000." => sub { my $type = mk_type('NormalizedString', {'minLength' => '1000'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing comm", $type, 0); should_fail("unity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certa", $type, 0); should_fail("in processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML pr", $type, 0); should_fail("ocessors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Prov", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 0." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '0'}); should_fail("T", $type, 0); should_fail("he advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commun", $type, 0); should_fail("ity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain ", $type, 0); should_fail("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML proces", $type, 0); should_fail("sors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide t", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 823." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '823'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet langua", $type, 0); should_fail("ge define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of thes", $type, 0); should_fail("e technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants", $type, 0); should_fail(" to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic com", $type, 0); should_fail("merce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object includin", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 841." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '841'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich s", $type, 0); should_fail("et of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them ob", $type, 0); should_fail("vious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for ", $type, 0); should_fail("XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily o", $type, 0); should_fail("n that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 374." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '374'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is r", $type, 0); should_fail("apidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display ", $type, 0); should_fail("context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta version", $type, 0); should_fail("s of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W", $type, 0); should_fail("3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet maxLength with value 1000." => sub { my $type = mk_type('NormalizedString', {'maxLength' => '1000'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex doc", $type, 0); should_fail("uments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following relate", $type, 0); should_fail("d tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Mar", $type, 0); should_fail("kup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies for business relationships and transactions The vocabularies business templates and business processes used by these groups to transact business must be accessible by all partners at any time Furthermore newcomers to the supply chain or business partnerships must be able to discover these documents and retrieve them A registry and repository can be used to provide this service A series of registries and repositories can link many organizations and industries acting as a web of registries for discovery Standards are needed to ensure interoperability of these registries; additionally a reg", $type, 0); should_fail("istry vocabulary must be created for consistency of discovery information among them NIST/ITL is working with the Organization for the Advancement of Structured Information Standards OASIS the prominent industry consortium for defining specifications for the discovery and retrieval of XML-related documents NIST chairs the OASIS Registry/Repository Technical Committee and is a significant contributor NIST/ITL is also working within the ebXML Project a joint project between OASIS and the United Nations body for Trade Facilitation and Electronic Business UN/CEFACT the prominent business-oriented international standards organization for the discovery retrieval and use of business processes and related documents The role of NIST/ITL is to influence the quality correctness and testability of the specifications of both the OASIS and ebXML Registry/Repository Working Groups through our reference implementation of a registry and repository that is conformant to both specifications Additionally NIST/ITL facilitates cross-over discussions between OASIS and ebXML; thus helping to ensure compatibility of the specifications NIST/ITL through its leadership in developing a reference implementation that is compliant to both specifications will help ensure that both specifications are unambiguous complete and testable This work will also contribute to the compatibility of these two specifications An early indication of success is that the draft ebXML specification uses the OASIS specification as its basis The completion of these specifications will allow small- and medium-sized enterprises SMEs to make appropriate choices with regard to EC tools and applications and will allow them access to the emerging supply chain and industry partnership EC models The National Software Reference Library NSRL provides a repository of known software file profiles and file signatures for use by law enforcement organizations in computer forensics investigations", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 0." => sub { my $type = mk_type('NormalizedString', {'length' => '0'}); should_fail("T", $type, 0); should_fail("he advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commun", $type, 0); should_fail("ity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain ", $type, 0); should_fail("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML proces", $type, 0); should_fail("sors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide t", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 359." => sub { my $type = mk_type('NormalizedString', {'length' => '359'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language X", $type, 0); should_fail("ML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define", $type, 0); should_fail(" manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technolog", $type, 0); should_fail("ies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSL", $type, 0); should_fail("T/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguiti", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 213." => sub { my $type = mk_type('NormalizedString', {'length' => '213'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advance", $type, 0); should_fail("d concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way", $type, 0); should_fail(" that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming a", $type, 0); should_fail("nd displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these", $type, 0); should_fail(" standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIS", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 683." => sub { my $type = mk_type('NormalizedString', {'length' => '683'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Us", $type, 0); should_fail("ing the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike partic", $type, 0); should_fail("ularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Documen", $type, 0); should_fail("t Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technolo", $type, 0); done_testing; }; subtest "Type atomic/normalizedString is restricted by facet length with value 1000." => sub { my $type = mk_type('NormalizedString', {'length' => '1000'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing comm", $type, 0); should_fail("unity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certa", $type, 0); should_fail("in processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML pr", $type, 0); should_fail("ocessors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Prov", $type, 0); done_testing; }; done_testing; 50positiveInteger.t000664001750001750 7047412404317273 16071 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 1." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '1'}); should_pass("2", $type, 0); should_pass("982349033495275913", $type, 0); should_pass("991909556031309923", $type, 0); should_pass("932234447917123620", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 262638891446532185." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '262638891446532185'}); should_pass("262638891446532186", $type, 0); should_pass("876689699487020075", $type, 0); should_pass("305127189898932780", $type, 0); should_pass("546875430332327851", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 173303931811171541." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '173303931811171541'}); should_pass("173303931811171542", $type, 0); should_pass("988296320075830472", $type, 0); should_pass("187207554565913903", $type, 0); should_pass("878376937391018269", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 506558727413711217." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '506558727413711217'}); should_pass("506558727413711218", $type, 0); should_pass("875004857999238131", $type, 0); should_pass("641501311423161415", $type, 0); should_pass("668695977727626858", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '999999999999999998'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 1." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '1'}); should_pass("1", $type, 0); should_pass("312555068067347119", $type, 0); should_pass("406416714419411406", $type, 0); should_pass("317956959553971186", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 15066261577183049." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '15066261577183049'}); should_pass("15066261577183049", $type, 0); should_pass("58253528157596052", $type, 0); should_pass("205376965405062076", $type, 0); should_pass("913187852637643351", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 828758841369869991." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '828758841369869991'}); should_pass("828758841369869991", $type, 0); should_pass("910584086949352167", $type, 0); should_pass("936085115171037335", $type, 0); should_pass("918098813427214593", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 69860014844260743." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '69860014844260743'}); should_pass("69860014844260743", $type, 0); should_pass("225746133856350748", $type, 0); should_pass("770102717928348466", $type, 0); should_pass("90419069275015919", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '999999999999999999'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 2." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '2'}); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 32371283896903692." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '32371283896903692'}); should_pass("1", $type, 0); should_pass("4486244211931743", $type, 0); should_pass("30697555039207401", $type, 0); should_pass("24352217317326215", $type, 0); should_pass("32371283896903691", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 685616415831176051." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '685616415831176051'}); should_pass("1", $type, 0); should_pass("645153569833015152", $type, 0); should_pass("572235003435245836", $type, 0); should_pass("447037998416114053", $type, 0); should_pass("685616415831176050", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 571841216500225568." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '571841216500225568'}); should_pass("1", $type, 0); should_pass("22031580018851121", $type, 0); should_pass("383029359970327560", $type, 0); should_pass("71789437680291185", $type, 0); should_pass("571841216500225567", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '999999999999999999'}); should_pass("1", $type, 0); should_pass("720027946340477952", $type, 0); should_pass("75300685728174277", $type, 0); should_pass("236166620433764906", $type, 0); should_pass("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 1." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '1'}); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 423285904007674851." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '423285904007674851'}); should_pass("1", $type, 0); should_pass("153349543491418210", $type, 0); should_pass("192168039749809891", $type, 0); should_pass("330253502610144334", $type, 0); should_pass("423285904007674851", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 809380027468239004." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '809380027468239004'}); should_pass("1", $type, 0); should_pass("376556333955278357", $type, 0); should_pass("282180434046745516", $type, 0); should_pass("186033623824917075", $type, 0); should_pass("809380027468239004", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 619618676703699189." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '619618676703699189'}); should_pass("1", $type, 0); should_pass("458184742283352808", $type, 0); should_pass("270348752837021310", $type, 0); should_pass("56691669269610340", $type, 0); should_pass("619618676703699189", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 999999999999999999." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '999999999999999999'}); should_pass("1", $type, 0); should_pass("339696864049625069", $type, 0); should_pass("399326842300909867", $type, 0); should_pass("143280828597479371", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('PositiveInteger', {'fractionDigits' => '0'}); should_pass("1", $type, 0); should_pass("496604127571227182", $type, 0); should_pass("866575962853341485", $type, 0); should_pass("258197386597402434", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '1'}); should_pass("5", $type, 0); should_pass("6", $type, 0); should_pass("4", $type, 0); should_pass("6", $type, 0); should_pass("7", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '5'}); should_pass("3", $type, 0); should_pass("45", $type, 0); should_pass("564", $type, 0); should_pass("1275", $type, 0); should_pass("13714", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '9'}); should_pass("2", $type, 0); should_pass("151", $type, 0); should_pass("81986", $type, 0); should_pass("8472964", $type, 0); should_pass("319266366", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '13'}); should_pass("6", $type, 0); should_pass("8272", $type, 0); should_pass("8651131", $type, 0); should_pass("7238618218", $type, 0); should_pass("6979035245178", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '18'}); should_pass("9", $type, 0); should_pass("73765", $type, 0); should_pass("721731556", $type, 0); should_pass("6587555823776", $type, 0); should_pass("171462243233917146", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("2", $type, 0); should_pass("4", $type, 0); should_pass("3", $type, 0); should_pass("7", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("88253", $type, 0); should_pass("35956", $type, 0); should_pass("37377", $type, 0); should_pass("71439", $type, 0); should_pass("96766", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{9}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{9}$)/}); should_pass("769719874", $type, 0); should_pass("328264516", $type, 0); should_pass("788695745", $type, 0); should_pass("466944674", $type, 0); should_pass("484763277", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{13}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{13}$)/}); should_pass("2233735692359", $type, 0); should_pass("2466125676771", $type, 0); should_pass("5661425462852", $type, 0); should_pass("8245223398863", $type, 0); should_pass("3737767893432", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{18}$)/}); should_pass("977784185831812352", $type, 0); should_pass("954768745235645523", $type, 0); should_pass("964636143567451713", $type, 0); should_pass("942757486532436464", $type, 0); should_pass("925841177113784843", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['29','3059918349066803','44881','557','39237065970202644','101001635697','7652','408576971836088']}); should_pass("408576971836088", $type, 0); should_pass("3059918349066803", $type, 0); should_pass("101001635697", $type, 0); should_pass("44881", $type, 0); should_pass("3059918349066803", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['853441','5705619952894463','468315652460615','54802934845216066','10','801','8410074843393','87378193514885904','127831830298']}); should_pass("468315652460615", $type, 0); should_pass("801", $type, 0); should_pass("468315652460615", $type, 0); should_pass("801", $type, 0); should_pass("801", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['12730','518340460','27263821738066862','63621988','7678','7942666042']}); should_pass("12730", $type, 0); should_pass("7678", $type, 0); should_pass("63621988", $type, 0); should_pass("518340460", $type, 0); should_pass("63621988", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['66130353503','2337','27711148','849926','600957','822','7497','3167940084','435109']}); should_pass("2337", $type, 0); should_pass("849926", $type, 0); should_pass("435109", $type, 0); should_pass("600957", $type, 0); should_pass("849926", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['85265','2633','20007586335496','24394','15836086414917927','84017762294','378362663062']}); should_pass("15836086414917927", $type, 0); should_pass("15836086414917927", $type, 0); should_pass("24394", $type, 0); should_pass("378362663062", $type, 0); should_pass("85265", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('PositiveInteger', {'whiteSpace' => 'collapse'}); should_pass("1", $type, 0); should_pass("840635356637731478", $type, 0); should_pass("857418719546887752", $type, 0); should_pass("324146775533287634", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 874370595268603056." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '874370595268603056'}); should_fail("1", $type, 0); should_fail("463969428287285252", $type, 0); should_fail("571284772856430574", $type, 0); should_fail("751601505559521427", $type, 0); should_fail("874370595268603055", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 975077401610746407." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '975077401610746407'}); should_fail("1", $type, 0); should_fail("340511711975447020", $type, 0); should_fail("222561909334976317", $type, 0); should_fail("703175082919244117", $type, 0); should_fail("975077401610746406", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 520520563111862677." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '520520563111862677'}); should_fail("1", $type, 0); should_fail("242844343134479483", $type, 0); should_fail("199625598517031173", $type, 0); should_fail("194628006109212701", $type, 0); should_fail("520520563111862676", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 884867483068111581." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '884867483068111581'}); should_fail("1", $type, 0); should_fail("789270698540434769", $type, 0); should_fail("800583676657285039", $type, 0); should_fail("574809300350579814", $type, 0); should_fail("884867483068111580", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('PositiveInteger', {'minInclusive' => '999999999999999999'}); should_fail("1", $type, 0); should_fail("878144925461554313", $type, 0); should_fail("334020139353938039", $type, 0); should_fail("25382068101232114", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 1." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '1'}); should_fail("2", $type, 0); should_fail("45468464539782817", $type, 0); should_fail("829562509786757495", $type, 0); should_fail("704807950524782400", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 177196767521656029." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '177196767521656029'}); should_fail("177196767521656030", $type, 0); should_fail("887357412961596139", $type, 0); should_fail("183935176227759991", $type, 0); should_fail("564160953444496121", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 131706786963028178." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '131706786963028178'}); should_fail("131706786963028179", $type, 0); should_fail("647787532796072695", $type, 0); should_fail("483853198284271574", $type, 0); should_fail("852804698047706080", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 638826049431571618." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '638826049431571618'}); should_fail("638826049431571619", $type, 0); should_fail("705257234714437272", $type, 0); should_fail("844109764788363834", $type, 0); should_fail("717553871867105576", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxInclusive with value 860350668025949171." => sub { my $type = mk_type('PositiveInteger', {'maxInclusive' => '860350668025949171'}); should_fail("860350668025949172", $type, 0); should_fail("906253266082163879", $type, 0); should_fail("933320924116726189", $type, 0); should_fail("867891249566093604", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '1'}); should_fail("82", $type, 0); should_fail("926035", $type, 0); should_fail("4832375246", $type, 0); should_fail("16512552312512", $type, 0); should_fail("137684928197322329", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '4'}); should_fail("34822", $type, 0); should_fail("70637742", $type, 0); should_fail("15793211212", $type, 0); should_fail("26618875674363", $type, 0); should_fail("163842311182224166", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '7'}); should_fail("36643115", $type, 0); should_fail("6351625544", $type, 0); should_fail("815716190557", $type, 0); should_fail("48769445775724", $type, 0); should_fail("110346136636237565", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '10'}); should_fail("74648782350", $type, 0); should_fail("166308411217", $type, 0); should_fail("2044173572041", $type, 0); should_fail("57779138821106", $type, 0); should_fail("398235385338349817", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('PositiveInteger', {'totalDigits' => '13'}); should_fail("21187981634549", $type, 0); should_fail("755658594114345", $type, 0); should_fail("5908446520846672", $type, 0); should_fail("89050264731859148", $type, 0); should_fail("703714577082544222", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 1." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '1'}); should_fail("1", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 159779689100354561." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '159779689100354561'}); should_fail("1", $type, 0); should_fail("4703221073283038", $type, 0); should_fail("83826753273273379", $type, 0); should_fail("47847777004084757", $type, 0); should_fail("159779689100354561", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 196998635864784277." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '196998635864784277'}); should_fail("1", $type, 0); should_fail("82328350442857316", $type, 0); should_fail("191511466403091336", $type, 0); should_fail("94354030643614512", $type, 0); should_fail("196998635864784277", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 975773071955124413." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '975773071955124413'}); should_fail("1", $type, 0); should_fail("366331497857183911", $type, 0); should_fail("599355922918828286", $type, 0); should_fail("298741005666310057", $type, 0); should_fail("975773071955124413", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('PositiveInteger', {'minExclusive' => '999999999999999998'}); should_fail("1", $type, 0); should_fail("292709229968370232", $type, 0); should_fail("4037170947835956", $type, 0); should_fail("860341361129465130", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 2." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '2'}); should_fail("2", $type, 0); should_fail("580035881441445355", $type, 0); should_fail("260948973968477716", $type, 0); should_fail("563331464152950767", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 439492137310005915." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '439492137310005915'}); should_fail("439492137310005915", $type, 0); should_fail("643558600794419319", $type, 0); should_fail("489995076791599946", $type, 0); should_fail("530397461306073535", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 44963355987554522." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '44963355987554522'}); should_fail("44963355987554522", $type, 0); should_fail("699372905347424185", $type, 0); should_fail("702131530495087662", $type, 0); should_fail("888590873668325996", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 77051283049339393." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '77051283049339393'}); should_fail("77051283049339393", $type, 0); should_fail("362331558821822932", $type, 0); should_fail("955585039591778988", $type, 0); should_fail("544302254470812148", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('PositiveInteger', {'maxExclusive' => '999999999999999999'}); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("938684679368", $type, 0); should_fail("161", $type, 0); should_fail("83791567323", $type, 0); should_fail("674", $type, 0); should_fail("8723668", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("26143554", $type, 0); should_fail("3253126293", $type, 0); should_fail("985654524774343281", $type, 0); should_fail("668", $type, 0); should_fail("1517477226927279", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{9}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{9}$)/}); should_fail("8728865", $type, 0); should_fail("5267524", $type, 0); should_fail("924122425827362435", $type, 0); should_fail("52745613725", $type, 0); should_fail("2592", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{13}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{13}$)/}); should_fail("18361538227259", $type, 0); should_fail("238", $type, 0); should_fail("865", $type, 0); should_fail("32458682", $type, 0); should_fail("88183", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('PositiveInteger', {'pattern' => qr/(?ms:^\d{18}$)/}); should_fail("67822567", $type, 0); should_fail("662", $type, 0); should_fail("4542", $type, 0); should_fail("5268746", $type, 0); should_fail("455576", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['89425355401952721','887680011527414','9640188','655587','66','63297','311','98622','355626345463206150']}); should_fail("449018306605672990", $type, 0); should_fail("838199422666880299", $type, 0); should_fail("838199422666880299", $type, 0); should_fail("838199422666880299", $type, 0); should_fail("231700685040938770", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['25429839','8115610159877','483194965216','2979764','208947282923','2051075329','7825']}); should_fail("30345251576797794", $type, 0); should_fail("835629896067205390", $type, 0); should_fail("933075754619171359", $type, 0); should_fail("371963561942588505", $type, 0); should_fail("933075754619171359", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['909089889806','4206487177','67271116222315','828','12484','2716638065015443']}); should_fail("648184620210752848", $type, 0); should_fail("192172868942828590", $type, 0); should_fail("397325780006547835", $type, 0); should_fail("312762109656851694", $type, 0); should_fail("889380911552340446", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['529720439','131717044209','670','5803','792157356069878']}); should_fail("50064529409591608", $type, 0); should_fail("528478019669675447", $type, 0); should_fail("407042767729179355", $type, 0); should_fail("600985861594698578", $type, 0); should_fail("929306415722023325", $type, 0); done_testing; }; subtest "Type atomic/positiveInteger is restricted by facet enumeration." => sub { my $type = mk_type('PositiveInteger', {'enumeration' => ['18','945','922540711065','466381','49453438244','55786266586','6535483','343049990794353','799695914569401']}); should_fail("645640079662813559", $type, 0); should_fail("941561360696071657", $type, 0); should_fail("214611027314337455", $type, 0); should_fail("824272384129683954", $type, 0); should_fail("414831628296158383", $type, 0); done_testing; }; done_testing; 50short.t000664001750001750 5512312404317273 14042 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/short is restricted by facet minExclusive with value -32768." => sub { my $type = mk_type('Short', {'minExclusive' => '-32768'}); should_pass("-32767", $type, 0); should_pass("17213", $type, 0); should_pass("-28122", $type, 0); should_pass("-4838", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value 16190." => sub { my $type = mk_type('Short', {'minExclusive' => '16190'}); should_pass("16191", $type, 0); should_pass("28276", $type, 0); should_pass("19313", $type, 0); should_pass("31624", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value -20001." => sub { my $type = mk_type('Short', {'minExclusive' => '-20001'}); should_pass("-20000", $type, 0); should_pass("11131", $type, 0); should_pass("8642", $type, 0); should_pass("810", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value 6725." => sub { my $type = mk_type('Short', {'minExclusive' => '6725'}); should_pass("6726", $type, 0); should_pass("22862", $type, 0); should_pass("10221", $type, 0); should_pass("16905", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value 32766." => sub { my $type = mk_type('Short', {'minExclusive' => '32766'}); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value -32768." => sub { my $type = mk_type('Short', {'minInclusive' => '-32768'}); should_pass("-32768", $type, 0); should_pass("-7551", $type, 0); should_pass("-17722", $type, 0); should_pass("1204", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 11066." => sub { my $type = mk_type('Short', {'minInclusive' => '11066'}); should_pass("11066", $type, 0); should_pass("22866", $type, 0); should_pass("18900", $type, 0); should_pass("14964", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value -26402." => sub { my $type = mk_type('Short', {'minInclusive' => '-26402'}); should_pass("-26402", $type, 0); should_pass("-13745", $type, 0); should_pass("-25094", $type, 0); should_pass("-5991", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 10698." => sub { my $type = mk_type('Short', {'minInclusive' => '10698'}); should_pass("10698", $type, 0); should_pass("26195", $type, 0); should_pass("23808", $type, 0); should_pass("22312", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 32767." => sub { my $type = mk_type('Short', {'minInclusive' => '32767'}); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value -32767." => sub { my $type = mk_type('Short', {'maxExclusive' => '-32767'}); should_pass("-32768", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value -8209." => sub { my $type = mk_type('Short', {'maxExclusive' => '-8209'}); should_pass("-32768", $type, 0); should_pass("-27515", $type, 0); should_pass("-14331", $type, 0); should_pass("-31226", $type, 0); should_pass("-8210", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value -14442." => sub { my $type = mk_type('Short', {'maxExclusive' => '-14442'}); should_pass("-32768", $type, 0); should_pass("-25304", $type, 0); should_pass("-25964", $type, 0); should_pass("-25615", $type, 0); should_pass("-14443", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value 21269." => sub { my $type = mk_type('Short', {'maxExclusive' => '21269'}); should_pass("-32768", $type, 0); should_pass("-4982", $type, 0); should_pass("20891", $type, 0); should_pass("19578", $type, 0); should_pass("21268", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value 32767." => sub { my $type = mk_type('Short', {'maxExclusive' => '32767'}); should_pass("-32768", $type, 0); should_pass("31953", $type, 0); should_pass("-26115", $type, 0); should_pass("23045", $type, 0); should_pass("32766", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value -32768." => sub { my $type = mk_type('Short', {'maxInclusive' => '-32768'}); should_pass("-32768", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value 2249." => sub { my $type = mk_type('Short', {'maxInclusive' => '2249'}); should_pass("-32768", $type, 0); should_pass("-17742", $type, 0); should_pass("-14557", $type, 0); should_pass("-27127", $type, 0); should_pass("2249", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value -25835." => sub { my $type = mk_type('Short', {'maxInclusive' => '-25835'}); should_pass("-32768", $type, 0); should_pass("-27611", $type, 0); should_pass("-30459", $type, 0); should_pass("-29273", $type, 0); should_pass("-25835", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value -24465." => sub { my $type = mk_type('Short', {'maxInclusive' => '-24465'}); should_pass("-32768", $type, 0); should_pass("-28633", $type, 0); should_pass("-25802", $type, 0); should_pass("-25248", $type, 0); should_pass("-24465", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value 32767." => sub { my $type = mk_type('Short', {'maxInclusive' => '32767'}); should_pass("-32768", $type, 0); should_pass("26073", $type, 0); should_pass("-6557", $type, 0); should_pass("14683", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('Short', {'fractionDigits' => '0'}); should_pass("-32768", $type, 0); should_pass("-15359", $type, 0); should_pass("-12604", $type, 0); should_pass("28392", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Short', {'totalDigits' => '1'}); should_pass("5", $type, 0); should_pass("3", $type, 0); should_pass("3", $type, 0); should_pass("9", $type, 0); should_pass("7", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('Short', {'totalDigits' => '2'}); should_pass("8", $type, 0); should_pass("46", $type, 0); should_pass("8", $type, 0); should_pass("12", $type, 0); should_pass("6", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('Short', {'totalDigits' => '3'}); should_pass("2", $type, 0); should_pass("51", $type, 0); should_pass("655", $type, 0); should_pass("1", $type, 0); should_pass("12", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('Short', {'totalDigits' => '4'}); should_pass("2", $type, 0); should_pass("54", $type, 0); should_pass("468", $type, 0); should_pass("5547", $type, 0); should_pass("7", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('Short', {'totalDigits' => '5'}); should_pass("3", $type, 0); should_pass("41", $type, 0); should_pass("764", $type, 0); should_pass("4635", $type, 0); should_pass("16428", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_pass("-31224", $type, 0); should_pass("-31431", $type, 0); should_pass("-31512", $type, 0); should_pass("-31225", $type, 0); should_pass("-31443", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\-\\d{3}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\-\d{3}$)/}); should_pass("-572", $type, 0); should_pass("-678", $type, 0); should_pass("-295", $type, 0); should_pass("-448", $type, 0); should_pass("-524", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_pass("-8", $type, 0); should_pass("-8", $type, 0); should_pass("-8", $type, 0); should_pass("-3", $type, 0); should_pass("-8", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\d{2}$)/}); should_pass("86", $type, 0); should_pass("67", $type, 0); should_pass("56", $type, 0); should_pass("48", $type, 0); should_pass("62", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("31456", $type, 0); should_pass("31345", $type, 0); should_pass("31221", $type, 0); should_pass("31234", $type, 0); should_pass("31624", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['-8076','5805','11013','-5','7589','-84']}); should_pass("11013", $type, 0); should_pass("11013", $type, 0); should_pass("-84", $type, 0); should_pass("5805", $type, 0); should_pass("-8076", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['4','-7086','154','589','3','-32768','78','-888']}); should_pass("154", $type, 0); should_pass("3", $type, 0); should_pass("3", $type, 0); should_pass("-32768", $type, 0); should_pass("78", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['448','-172','-9314','740','-570']}); should_pass("-570", $type, 0); should_pass("-570", $type, 0); should_pass("-570", $type, 0); should_pass("740", $type, 0); should_pass("-9314", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['902','19','4452','41','6','-8727']}); should_pass("6", $type, 0); should_pass("6", $type, 0); should_pass("4452", $type, 0); should_pass("19", $type, 0); should_pass("41", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['-49','370','74','3112','3174','-45','32767']}); should_pass("74", $type, 0); should_pass("32767", $type, 0); should_pass("-45", $type, 0); should_pass("74", $type, 0); should_pass("3112", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Short', {'whiteSpace' => 'collapse'}); should_pass("-32768", $type, 0); should_pass("6618", $type, 0); should_pass("-6402", $type, 0); should_pass("-19297", $type, 0); should_pass("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 19101." => sub { my $type = mk_type('Short', {'minInclusive' => '19101'}); should_fail("-32768", $type, 0); should_fail("16520", $type, 0); should_fail("12214", $type, 0); should_fail("3202", $type, 0); should_fail("19100", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value -5120." => sub { my $type = mk_type('Short', {'minInclusive' => '-5120'}); should_fail("-32768", $type, 0); should_fail("-22160", $type, 0); should_fail("-9704", $type, 0); should_fail("-15662", $type, 0); should_fail("-5121", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 26269." => sub { my $type = mk_type('Short', {'minInclusive' => '26269'}); should_fail("-32768", $type, 0); should_fail("-32296", $type, 0); should_fail("-22041", $type, 0); should_fail("16409", $type, 0); should_fail("26268", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 14671." => sub { my $type = mk_type('Short', {'minInclusive' => '14671'}); should_fail("-32768", $type, 0); should_fail("13055", $type, 0); should_fail("-1872", $type, 0); should_fail("-24417", $type, 0); should_fail("14670", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minInclusive with value 32767." => sub { my $type = mk_type('Short', {'minInclusive' => '32767'}); should_fail("-32768", $type, 0); should_fail("11466", $type, 0); should_fail("15729", $type, 0); should_fail("-926", $type, 0); should_fail("32766", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value -32768." => sub { my $type = mk_type('Short', {'maxInclusive' => '-32768'}); should_fail("-32767", $type, 0); should_fail("-18854", $type, 0); should_fail("32591", $type, 0); should_fail("2052", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value -6204." => sub { my $type = mk_type('Short', {'maxInclusive' => '-6204'}); should_fail("-6203", $type, 0); should_fail("834", $type, 0); should_fail("15414", $type, 0); should_fail("-5410", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value -24936." => sub { my $type = mk_type('Short', {'maxInclusive' => '-24936'}); should_fail("-24935", $type, 0); should_fail("15", $type, 0); should_fail("-1864", $type, 0); should_fail("-845", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value 24888." => sub { my $type = mk_type('Short', {'maxInclusive' => '24888'}); should_fail("24889", $type, 0); should_fail("30103", $type, 0); should_fail("26629", $type, 0); should_fail("32766", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxInclusive with value 2651." => sub { my $type = mk_type('Short', {'maxInclusive' => '2651'}); should_fail("2652", $type, 0); should_fail("11075", $type, 0); should_fail("8514", $type, 0); should_fail("13224", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('Short', {'totalDigits' => '1'}); should_fail("51", $type, 0); should_fail("644", $type, 0); should_fail("3267", $type, 0); should_fail("15585", $type, 0); should_fail("62", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('Short', {'totalDigits' => '2'}); should_fail("424", $type, 0); should_fail("7042", $type, 0); should_fail("31473", $type, 0); should_fail("842", $type, 0); should_fail("7593", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('Short', {'totalDigits' => '3'}); should_fail("6133", $type, 0); should_fail("21567", $type, 0); should_fail("4598", $type, 0); should_fail("21557", $type, 0); should_fail("1787", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('Short', {'totalDigits' => '4'}); should_fail("18587", $type, 0); should_fail("28450", $type, 0); should_fail("27965", $type, 0); should_fail("25147", $type, 0); should_fail("31987", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value -32768." => sub { my $type = mk_type('Short', {'minExclusive' => '-32768'}); should_fail("-32768", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value -18150." => sub { my $type = mk_type('Short', {'minExclusive' => '-18150'}); should_fail("-32768", $type, 0); should_fail("-22506", $type, 0); should_fail("-24820", $type, 0); should_fail("-23399", $type, 0); should_fail("-18150", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value -30410." => sub { my $type = mk_type('Short', {'minExclusive' => '-30410'}); should_fail("-32768", $type, 0); should_fail("-31021", $type, 0); should_fail("-31134", $type, 0); should_fail("-31509", $type, 0); should_fail("-30410", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value 18160." => sub { my $type = mk_type('Short', {'minExclusive' => '18160'}); should_fail("-32768", $type, 0); should_fail("-18491", $type, 0); should_fail("-8369", $type, 0); should_fail("-29369", $type, 0); should_fail("18160", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet minExclusive with value 32766." => sub { my $type = mk_type('Short', {'minExclusive' => '32766'}); should_fail("-32768", $type, 0); should_fail("-9951", $type, 0); should_fail("-3126", $type, 0); should_fail("30239", $type, 0); should_fail("32766", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value -32767." => sub { my $type = mk_type('Short', {'maxExclusive' => '-32767'}); should_fail("-32767", $type, 0); should_fail("11252", $type, 0); should_fail("31729", $type, 0); should_fail("-21256", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value -32719." => sub { my $type = mk_type('Short', {'maxExclusive' => '-32719'}); should_fail("-32719", $type, 0); should_fail("-28629", $type, 0); should_fail("-25994", $type, 0); should_fail("-13596", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value -31994." => sub { my $type = mk_type('Short', {'maxExclusive' => '-31994'}); should_fail("-31994", $type, 0); should_fail("-30590", $type, 0); should_fail("28507", $type, 0); should_fail("14160", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value 13491." => sub { my $type = mk_type('Short', {'maxExclusive' => '13491'}); should_fail("13491", $type, 0); should_fail("19175", $type, 0); should_fail("28305", $type, 0); should_fail("17791", $type, 0); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet maxExclusive with value 32767." => sub { my $type = mk_type('Short', {'maxExclusive' => '32767'}); should_fail("32767", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\-\\d{5}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\-\d{5}$)/}); should_fail("-4", $type, 0); should_fail("-52", $type, 0); should_fail("637", $type, 0); should_fail("-7", $type, 0); should_fail("-556", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\-\\d{3}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\-\d{3}$)/}); should_fail("-94", $type, 0); should_fail("99", $type, 0); should_fail("-2361", $type, 0); should_fail("31222", $type, 0); should_fail("-9", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\-\\d{1}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\-\d{1}$)/}); should_fail("42", $type, 0); should_fail("585", $type, 0); should_fail("-37", $type, 0); should_fail("-37", $type, 0); should_fail("156", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\d{2}$)/}); should_fail("193", $type, 0); should_fail("611", $type, 0); should_fail("795", $type, 0); should_fail("2", $type, 0); should_fail("-3574", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('Short', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("-895", $type, 0); should_fail("3625", $type, 0); should_fail("217", $type, 0); should_fail("7582", $type, 0); should_fail("49", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['180','9','-53','-541','-701','605','4219','-617','485','2161']}); should_fail("-25871", $type, 0); should_fail("15402", $type, 0); should_fail("-22645", $type, 0); should_fail("4289", $type, 0); should_fail("17544", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['78','402','4258','-285','-982','581','32767','-65','-989']}); should_fail("-10725", $type, 0); should_fail("-29670", $type, 0); should_fail("-17752", $type, 0); should_fail("10505", $type, 0); should_fail("21905", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['533','-52','1','-5309','26','64']}); should_fail("14800", $type, 0); should_fail("-14241", $type, 0); should_fail("27690", $type, 0); should_fail("27690", $type, 0); should_fail("-25304", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['582','6052','10544','-298','-1','24','-60','6601','-32768']}); should_fail("-19678", $type, 0); should_fail("-3079", $type, 0); should_fail("8129", $type, 0); should_fail("-19678", $type, 0); should_fail("-29696", $type, 0); done_testing; }; subtest "Type atomic/short is restricted by facet enumeration." => sub { my $type = mk_type('Short', {'enumeration' => ['25','32','-8','9','-960']}); should_fail("21151", $type, 0); should_fail("20850", $type, 0); should_fail("19698", $type, 0); should_fail("-16635", $type, 0); should_fail("-23570", $type, 0); done_testing; }; done_testing; 50string.t000664001750001750 30345212404317273 14232 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/string is restricted by facet maxLength with value 0." => sub { my $type = mk_type('String', {'maxLength' => '0'}); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 969." => sub { my $type = mk_type('String', {'maxLength' => '969'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishi", $type, 0); should_pass("ng community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be u", $type, 0); should_pass("sed to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange s", $type, 0); should_pass("tructured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance S", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 913." => sub { my $type = mk_type('String', {'maxLength' => '913'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts fro", $type, 0); should_pass("m the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on ", $type, 0); should_pass("the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all applicati", $type, 0); should_pass("on domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical le", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 205." => sub { my $type = mk_type('String', {'maxLength' => '205'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a\nfirst", $type, 0); should_pass("-generation language for defining data known as HTML has led to\nthe creation of the world s first di", $type, 0); should_pass("gital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Inte", $type, 0); should_pass("rnet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particu", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 1000." => sub { my $type = mk_type('String', {'maxLength' => '1000'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing commu", $type, 0); should_pass("nity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\n", $type, 0); should_pass("processes A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processo", $type, 0); should_pass("rs and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide tes", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 0." => sub { my $type = mk_type('String', {'minLength' => '0'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing commu", $type, 0); should_pass("nity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\n", $type, 0); should_pass("processes A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processo", $type, 0); should_pass("rs and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide tes", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 657." => sub { my $type = mk_type('String', {'minLength' => '657'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchang", $type, 0); should_pass("e and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use X", $type, 0); should_pass("ML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems u", $type, 0); should_pass("sing the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation", $type, 0); should_pass(" with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partners and\nthroughout the industry The eXtensible Markup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by which industries are defining the structure and semantics of\ntheir information XML is a base recommendation coupled with a set of\nemerging specifications and related vocabularies based upon the XML\nsyntax \n\nIn the simplest sense the benefits of XML will only be achieved if\nor", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 90." => sub { my $type = mk_type('String', {'minLength' => '90'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data ", $type, 0); should_pass(" known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost ", $type, 0); should_pass("popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas", $type, 0); should_pass("\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them o", $type, 0); should_pass("bvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 946." => sub { my $type = mk_type('String', {'minLength' => '946'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Sc", $type, 0); should_pass("hemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organiz", $type, 0); should_pass("ation for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the re", $type, 0); should_pass("sults of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partners and\nthroughout the industry The eXtensible Markup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by whic", $type, 0); should_pass("h industries are defining the structure and semantics of\ntheir information XML is a base recommendation coupled with a set of\nemerging specifications and related vocabularies based upon the XML\nsyntax \n\nIn the simplest sense the benefits of XML will only be achieved if\norganizations of a significant number are using the same XML documents \nTherefore these XML documents must be available for partners to\ndiscover and retrieve A registry/repository is a mechanism used to\ndiscover and retrieve documents templates software i e objects\nand resources over the Internet A registry is the mechanism used to\ndiscover the object The registry provides information about the\nobject including the location of the object A repository is where\nthe object resides A user retrieves an object from a repository \n\n Although XML is a recent newcomer in the\nelectronic commerce landscape supply chains in many industries as well\nas industry consortiums and standards organizations are using XML t", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 1000." => sub { my $type = mk_type('String', {'minLength' => '1000'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex do", $type, 0); should_pass("cuments The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\n", $type, 0); should_pass("accelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS X", $type, 0); should_pass("ML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partners and\nthroughout the industry The eXtensible Markup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by which industries are defining the structure and semantics of\ntheir information XML is a base recommendation coupled with a set of\nemerging sp", $type, 0); should_pass("ecifications and related vocabularies based upon the XML\nsyntax \n\nIn the simplest sense the benefits of XML will only be achieved if\norganizations of a significant number are using the same XML documents \nTherefore these XML documents must be available for partners to\ndiscover and retrieve A registry/repository is a mechanism used to\ndiscover and retrieve documents templates software i e objects\nand resources over the Internet A registry is the mechanism used to\ndiscover the object The registry provides information about the\nobject including the location of the object A repository is where\nthe object resides A user retrieves an object from a repository \n\n Although XML is a recent newcomer in the\nelectronic commerce landscape supply chains in many industries as well\nas industry consortiums and standards organizations are using XML to\ndefine their own vocabularies for business relationships and\ntransactions The vocabularies business templates and business\nprocesses ", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 0." => sub { my $type = mk_type('String', {'length' => '0'}); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 925." => sub { my $type = mk_type('String', {'length' => '925'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data ", $type, 0); should_pass("In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is ", $type, 0); should_pass("necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based langu", $type, 0); should_pass("ages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partne", $type, 0); should_pass("rs and\nthroughout the industry The eXtensible Markup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by which industries are defining the structure and semantics of\ntheir information XML is a base recommendation coupled with a set of\nemerging specifications and related vocabularies based upon the XML\nsyntax \n\nIn the simplest sense the benefits of XML will only be achieved if\norganizations of a significant number are using the same XML documents \nTherefore these XML documents must be available for partners to\ndiscover and retrieve A registry/repository is a mechanism used to\ndiscover and retrieve documents templates software i e objects\nand resources over the Internet A registry is the mechanism used to\ndiscover the object The registry provides information about the\nobject including the location of the object A repository is where\nthe object re", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 713." => sub { my $type = mk_type('String', {'length' => '713'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently", $type, 0); should_pass(" it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define ", $type, 0); should_pass("manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperabil", $type, 0); should_pass("ity\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrolo", $type, 0); should_pass("gy tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 243." => sub { my $type = mk_type('String', {'length' => '243'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishin", $type, 0); should_pass("g community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and ap", $type, 0); should_pass("plications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used", $type, 0); should_pass(" to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive met", $type, 0); should_pass("hods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 1000." => sub { my $type = mk_type('String', {'length' => '1000'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex do", $type, 0); should_pass("cuments The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\n", $type, 0); should_pass("accelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS X", $type, 0); should_pass("ML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partners and\nthroughout the industry The eXtensible Markup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by which industries are defining the structure and semantics of\ntheir information XML is a base recommendation coupled with a set of\nemerging sp", $type, 0); should_pass("ecifications and related vocabularies based upon the XML\nsyntax \n\nIn the simplest sense the benefits of XML will only be achieved if\norganizations of a significant number are using the same XML documents \nTherefore these XML documents must be available for partners to\ndiscover and retrieve A registry/repository is a mechanism used to\ndiscover and retrieve documents templates software i e objects\nand resources over the Internet A registry is the mechanism used to\ndiscover the object The registry provides information about the\nobject including the location of the object A repository is where\nthe object resides A user retrieves an object from a repository \n\n Although XML is a recent newcomer in the\nelectronic commerce landscape supply chains in many industries as well\nas industry consortiums and standards organizations are using XML to\ndefine their own vocabularies for business relationships and\ntransactions The vocabularies business templates and business\nprocesses ", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\n([A-Z][a-z]{1,20}\\s){2},\\s[A-Z]{2}\\s12848." => sub { my $type = mk_type('String', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\n([A-Z][a-z]{1,20}\s){2},\s[A-Z]{2}\s12848$)/}); should_pass("27951 Frameworks Library Them Objects Street\nRegard As , DC 12848", $type, 0); should_pass("7 Of Typical To Original Street\nIn Prominent , AK 12848", $type, 0); should_pass("5367 Bandwidth To Oasis Based Street\nCommunication Popular , NM 12848", $type, 0); should_pass("4 Many Different Means Of Street\nFiles In , OR 12848", $type, 0); should_pass("64 Those Soc Full Software Street\nChain Is , MT 12848", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){2}Street\\n([A-Z][a-z]{1,20}\\s){3},\\s[A-Z]{2}\\s15849." => sub { my $type = mk_type('String', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){2}Street\n([A-Z][a-z]{1,20}\s){3},\s[A-Z]{2}\s15849$)/}); should_pass("726 Of In Street\nUser Those Of , IL 15849", $type, 0); should_pass("598 In This Street\nDespite Partnerships Generation , TN 15849", $type, 0); should_pass("53544 Compatibility Already Street\nTesting Business For , NY 15849", $type, 0); should_pass("3 Manipulate Robust Street\nUse Is And , AZ 15849", $type, 0); should_pass("41135 Tools Standardization Street\nThe Signatures Compatibility , ND 15849", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\n([A-Z][a-z]{1,20}\\s){1},\\s[A-Z]{2}\\s13420-1016." => sub { my $type = mk_type('String', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\n([A-Z][a-z]{1,20}\s){1},\s[A-Z]{2}\s13420-1016$)/}); should_pass("367 Less Of Of Testing Street\nWidespread , MN 13420-1016", $type, 0); should_pass("138 Provides Available Related Efforts Street\nAct , IN 13420-1016", $type, 0); should_pass("967 Systems Allows Technology Health Street\nCommunity , IL 13420-1016", $type, 0); should_pass("8333 Chair Of Pc Languages Street\nTo , IA 13420-1016", $type, 0); should_pass("88539 Them Data Build That Street\nResides , MI 13420-1016", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\n([A-Z][a-z]{1,20}\\s){2},\\s[A-Z]{2}\\s17687." => sub { my $type = mk_type('String', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\n([A-Z][a-z]{1,20}\s){2},\s[A-Z]{2}\s17687$)/}); should_pass("45 Paradigm User Management Dependability Street\nThe Industry , SD 17687", $type, 0); should_pass("96 Mediums Benefits Technologies Reference Street\nMicrosystems Files , UT 17687", $type, 0); should_pass("1138 Computing Systems Other Architectural Street\nIts Key , AZ 17687", $type, 0); should_pass("6131 Object Techniques To Transmit Street\nIs Applications , AR 17687", $type, 0); should_pass("32 Addressing Nsrl Typical The Street\nTo All , OR 17687", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){3}Street\\n([A-Z][a-z]{1,20}\\s){1},\\s[A-Z]{2}\\s11101." => sub { my $type = mk_type('String', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){3}Street\n([A-Z][a-z]{1,20}\s){1},\s[A-Z]{2}\s11101$)/}); should_pass("37 To Filter The Street\nAnd , GA 11101", $type, 0); should_pass("3358 Techniques Interoperability Exchange Street\nAs , AL 11101", $type, 0); should_pass("327 Criteria Information The Street\nTools , FL 11101", $type, 0); should_pass("6643 Interoperability Robust Of Street\nClean , LA 11101", $type, 0); should_pass("4173 Defines An Addressing Street\nTransforming , SC 11101", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet enumeration." => sub { my $type = mk_type('String', {'enumeration' => ['EC','obvious','to','design','enterprises','associated','and/or','standards','development']}); should_pass("to", $type, 0); should_pass("and/or", $type, 0); should_pass("associated", $type, 0); should_pass("design", $type, 0); should_pass("enterprises", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet enumeration." => sub { my $type = mk_type('String', {'enumeration' => ['voice-enabled','launching','tremendous','robust','is','NIST/ITL','as','Business']}); should_pass("tremendous", $type, 0); should_pass("tremendous", $type, 0); should_pass("NIST/ITL", $type, 0); should_pass("is", $type, 0); should_pass("as", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet enumeration." => sub { my $type = mk_type('String', {'enumeration' => ['syntax','through','only','any','our','that']}); should_pass("only", $type, 0); should_pass("through", $type, 0); should_pass("our", $type, 0); should_pass("only", $type, 0); should_pass("through", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet enumeration." => sub { my $type = mk_type('String', {'enumeration' => ['the','ebXML','The','many','2000']}); should_pass("ebXML", $type, 0); should_pass("The", $type, 0); should_pass("many", $type, 0); should_pass("ebXML", $type, 0); should_pass("The", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet enumeration." => sub { my $type = mk_type('String', {'enumeration' => ['well','for','these','such','as']}); should_pass("such", $type, 0); should_pass("as", $type, 0); should_pass("well", $type, 0); should_pass("these", $type, 0); should_pass("for", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet whiteSpace with value preserve." => sub { my $type = mk_type('String', {'whiteSpace' => 'preserve'}); should_pass("The advent of Internet-enabled browsers and a\nfirst-generation language for defi", $type, 0); should_pass("ning data known as HTML has led to\nthe creation of the world s first digital l", $type, 0); should_pass("ibrary Using the simplicity\nof HTML with more advanced concepts from the publis", $type, 0); should_pass("hing community has\nled to the creation of a second-generation Internet language ", $type, 0); should_pass("called the\nExtensible Markup Language XML which is rapidly becoming one of th", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('String', {'whiteSpace' => 'collapse'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defi", $type, 0); should_pass("ning data known as HTML has led to the creation of the world s first digital lib", $type, 0); should_pass("rary Using the simplicity of HTML with more advanced concepts from the publishin", $type, 0); should_pass("g community has led to the creation of a second-generation Internet language cal", $type, 0); should_pass("led the Extensible Markup Language XML which is rapidly becoming one of the most", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet whiteSpace with value replace." => sub { my $type = mk_type('String', {'whiteSpace' => 'replace'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defi", $type, 0); should_pass("ning data known as HTML has led to the creation of the world s first digital l", $type, 0); should_pass("ibrary Using the simplicity of HTML with more advanced concepts from the publis", $type, 0); should_pass("hing community has led to the creation of a second-generation Internet language ", $type, 0); should_pass("called the Extensible Markup Language XML which is rapidly becoming one of th", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 998." => sub { my $type = mk_type('String', {'minLength' => '998'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing comm", $type, 0); should_fail("unity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certa", $type, 0); should_fail("in\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML pr", $type, 0); should_fail("ocessors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nPr", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 275." => sub { my $type = mk_type('String', {'minLength' => '275'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation langu", $type, 0); should_fail("age for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with mo", $type, 0); should_fail("re advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost p", $type, 0); should_fail("opular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact o", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 838." => sub { my $type = mk_type('String', {'minLength' => '838'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more ad", $type, 0); should_fail("vanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way th", $type, 0); should_fail("at allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML docume", $type, 0); should_fail("nts on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and r", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 791." => sub { my $type = mk_type('String', {'minLength' => '791'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML ", $type, 0); should_fail("with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language th", $type, 0); should_fail("at describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet L", $type, 0); should_fail("anguage XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASI", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet minLength with value 1000." => sub { my $type = mk_type('String', {'minLength' => '1000'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing comm", $type, 0); should_fail("unity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certa", $type, 0); should_fail("in\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML pr", $type, 0); should_fail("ocessors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProv", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 0." => sub { my $type = mk_type('String', {'maxLength' => '0'}); should_fail("T", $type, 0); should_fail("he advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing commun", $type, 0); should_fail("ity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\n", $type, 0); should_fail("processes A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML proces", $type, 0); should_fail("sors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide t", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 567." => sub { my $type = mk_type('String', {'maxLength' => '567'}); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applicatio", $type, 0); should_fail("ns It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying ", $type, 0); should_fail("XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of t", $type, 0); should_fail("hese standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into ", $type, 0); should_fail("both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partners and\nthroughout the industry The eXtensible Markup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by which industries are defining the structure and semantics of\nt", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 46." => sub { my $type = mk_type('String', {'maxLength' => '46'}); should_fail("The advent of Internet-enabled browsers and a\nf", $type, 0); should_fail("irst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nE", $type, 0); should_fail("xtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools t", $type, 0); should_fail("hat can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browse", $type, 0); should_fail("rs and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build ro", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 412." => sub { my $type = mk_type('String', {'maxLength' => '412'}); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popula", $type, 0); should_fail("r languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive met", $type, 0); should_fail("hods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread avail", $type, 0); should_fail("ability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM X", $type, 0); should_fail("SL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet maxLength with value 1000." => sub { my $type = mk_type('String', {'maxLength' => '1000'}); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex doc", $type, 0); should_fail("uments The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following relate", $type, 0); should_fail("d tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the results of the tests are fed back\n into both the standards process and the development process \n\nAs chair of the OASIS XML Conformance Subcommittee NIST/ITL\nled the development of the widely used XML test suite NIST/ITL has\nfurther developed in cooperation with OASIS and W3C robust testing\nresources for related XML technologies including XML Schemas DOM and\nXSL Developers and users utilize these tools to exercise both the\nappropriate W3C Recommendation and the associated implementations \nErrors and ambiguities raised as a result of these tools are fed back\ninto the development process for correction in future revisions \n\n An industry s ability to use electronic commerce EC \neffectively depends primarily on that industry s ability to create \nmanipulate and transmit intelligent information among partners and\nthroughout the industry The eXtensible Mar", $type, 0); should_fail("kup Language XML which is\nalready targeted as the enabling technology for EC is the primary\nstandard by which industries are defining the structure and semantics of\ntheir information XML is a base recommendation coupled with a set of\nemerging specifications and related vocabularies based upon the XML\nsyntax \n\nIn the simplest sense the benefits of XML will only be achieved if\norganizations of a significant number are using the same XML documents \nTherefore these XML documents must be available for partners to\ndiscover and retrieve A registry/repository is a mechanism used to\ndiscover and retrieve documents templates software i e objects\nand resources over the Internet A registry is the mechanism used to\ndiscover the object The registry provides information about the\nobject including the location of the object A repository is where\nthe object resides A user retrieves an object from a repository \n\n Although XML is a recent newcomer in the\nelectronic commerce landscape supply chains in many industries as well\nas industry consortiums and standards organizations are using XML to\ndefine their own vocabularies for business relationships and\ntransactions The vocabularies business templates and business\nprocesses used by these groups to transact business must be accessible\nby all partners at any time Furthermore newcomers to the supply chain\nor business partnerships must be able to discover these documents and\nretrieve them A registry and repository can be used to provide this\nservice A series of registries and repositories can link many\norganizations and industries acting as a web of registries for\ndiscovery Standards are needed to ensure interoperability of these\nregistries; additionally a reg", $type, 0); should_fail("istry vocabulary must be created for\nconsistency of discovery information among them \n\n NIST/ITL is working with the Organization for the\nAdvancement of Structured Information Standards OASIS the prominent\nindustry consortium for defining specifications for the discovery and\nretrieval of XML-related documents NIST chairs the OASIS\nRegistry/Repository Technical Committee and is a significant\ncontributor NIST/ITL is also working within the ebXML Project a joint\nproject between OASIS and the United Nations body for Trade Facilitation\nand Electronic Business UN/CEFACT the prominent business-oriented \ninternational standards organization for the discovery retrieval and\nuse of business processes and related documents The role of NIST/ITL is\nto influence the quality correctness and testability of the\nspecifications of both the OASIS and ebXML Registry/Repository Working\nGroups through our reference implementation of a registry and repository\nthat is conformant to both specifications Additionally NIST/ITL\nfacilitates cross-over discussions between OASIS and ebXML; thus helping\nto ensure compatibility of the specifications \n\n NIST/ITL through its leadership in developing a reference\nimplementation that is compliant to both specifications will help\nensure that both specifications are unambiguous complete and testable \nThis work will also contribute to the compatibility of these two\nspecifications An early indication of success is that the draft ebXML\nspecification uses the OASIS specification as its basis The completion\nof these specifications will allow small- and medium-sized enterprises\n SMEs to make appropriate choices with regard to EC tools and\napplications and will allow them access to the emerging supply chain\nand industry partnership EC models \n\n The National Software Reference Library NSRL provides a\nrepository of known software file profiles and file signatures for use\nby law enforcement organizations in computer forensics investigations", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 0." => sub { my $type = mk_type('String', {'length' => '0'}); should_fail("T", $type, 0); should_fail("he advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing commun", $type, 0); should_fail("ity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\n", $type, 0); should_fail("processes A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML proces", $type, 0); should_fail("sors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide t", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 151." => sub { my $type = mk_type('String', {'length' => '151'}); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first d", $type, 0); should_fail("igital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly", $type, 0); should_fail(" in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \n", $type, 0); should_fail("permitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML processors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperab", $type, 0); should_fail("le solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProvide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML\n Schemas \nPartner with industry participants to build robust test suites for\n XML DOM XSL-FO XSLT/Xpath and XML Schemas \nDevelop in-house tools to aid in automating test generation for\n XML-based languages \nWork with industry to ensure that these tests are used as\n metrology tools and that the resul", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 581." => sub { my $type = mk_type('String', {'length' => '581'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s ", $type, 0); should_fail("first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the wor", $type, 0); should_fail("ld XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used", $type, 0); should_fail(" to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 532." => sub { my $type = mk_type('String', {'length' => '532'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of", $type, 0); should_fail(" the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing community has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one o", $type, 0); should_fail("f the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certain\nprocesses A set of related technologies b", $type, 0); should_fail("uilt around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to vo", $type, 0); done_testing; }; subtest "Type atomic/string is restricted by facet length with value 1000." => sub { my $type = mk_type('String', {'length' => '1000'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a\nfirst-generation language for defining data known as HTML has led to\nthe creation of the world s first digital library Using the simplicity\nof HTML with more advanced concepts from the publishing comm", $type, 0); should_fail("unity has\nled to the creation of a second-generation Internet language called the\nExtensible Markup Language XML which is rapidly becoming one of the\nmost popular languages in the world XML is being incorporated into web\npages and applications alike particularly in those involved in\nelectronic commerce applications It is a language that describes\ninformation in a way that allows computers to exchange and automatically\nact on the information Consequently it can be used to automate certa", $type, 0); should_fail("in\nprocesses A set of related technologies built around this Internet\nlanguage define a rich set of tools that can be used to define \nmanipulate and display context-rich data In particular XML Schemas\ndefine intuitive methods for creating complex documents The Document\nObject Model DOM defines methods for interacting with XML and HTML \npermitting the dynamic creation and manipulation of documents The\nExtensible Stylesheet Language XSL defines methods for transforming\nand displaying XML documents on a variety of devices from web browsers\nto print mediums to voice-enabled devices \n\nVirtually all application domains are looking\nto use XML technologies to define manipulate and exchange structured\ninformation In addition XML pr", $type, 0); should_fail("ocessors and support for the related\nSchema DOM and XSL technologies are available in beta versions of\npopular web browsers and application development software The\nwidespread availability of these technologies has made them obvious\nchoices as building blocks for electronic commerce As such conformance\nof these products to the W3C Recommendations is necessary to build\ninteroperable solutions The Organization for the Advancement of\nStructured Information Standards OASIS consortium was formed to\naccelerate the adoption of these standards by addressing market needs\nand directions and recommending guidelines for product interoperability\nand conformance \n\nNIST/ITL is collaborating with industry to solve\nthese problems using the following related tasks:\n\nProvide technical leadership by chairing and/or participating in\n appropriate OASIS and W3C efforts including OASIS XML and\n XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML\n Schema Working Groups \nProv", $type, 0); done_testing; }; done_testing; 50time.t000664001750001750 5173512404317273 13646 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/time is restricted by facet minExclusive with value 00:00:00." => sub { my $type = mk_type('Time', {'minExclusive' => '00:00:00'}); should_pass("00:00:01", $type, 0); should_pass("03:11:11", $type, 0); should_pass("13:07:31", $type, 0); should_pass("23:06:10", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 02:57:29." => sub { my $type = mk_type('Time', {'minExclusive' => '02:57:29'}); should_pass("02:57:30", $type, 0); should_pass("04:40:10", $type, 0); should_pass("08:05:06", $type, 0); should_pass("16:53:43", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 13:38:10." => sub { my $type = mk_type('Time', {'minExclusive' => '13:38:10'}); should_pass("13:38:11", $type, 0); should_pass("15:10:50", $type, 0); should_pass("15:56:14", $type, 0); should_pass("20:23:46", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 18:16:28." => sub { my $type = mk_type('Time', {'minExclusive' => '18:16:28'}); should_pass("18:16:29", $type, 0); should_pass("23:15:39", $type, 0); should_pass("22:44:24", $type, 0); should_pass("20:07:23", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 23:59:58." => sub { my $type = mk_type('Time', {'minExclusive' => '23:59:58'}); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 00:00:00." => sub { my $type = mk_type('Time', {'minInclusive' => '00:00:00'}); should_pass("00:00:00", $type, 0); should_pass("06:37:23", $type, 0); should_pass("17:22:07", $type, 0); should_pass("01:39:25", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 21:11:44." => sub { my $type = mk_type('Time', {'minInclusive' => '21:11:44'}); should_pass("21:11:44", $type, 0); should_pass("21:14:21", $type, 0); should_pass("23:40:37", $type, 0); should_pass("21:37:20", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 01:03:08." => sub { my $type = mk_type('Time', {'minInclusive' => '01:03:08'}); should_pass("01:03:08", $type, 0); should_pass("02:38:50", $type, 0); should_pass("05:59:03", $type, 0); should_pass("16:51:26", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 19:31:35." => sub { my $type = mk_type('Time', {'minInclusive' => '19:31:35'}); should_pass("19:31:35", $type, 0); should_pass("20:53:52", $type, 0); should_pass("22:28:34", $type, 0); should_pass("23:40:04", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 23:59:59." => sub { my $type = mk_type('Time', {'minInclusive' => '23:59:59'}); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 00:00:01." => sub { my $type = mk_type('Time', {'maxExclusive' => '00:00:01'}); should_pass("00:00:00", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 08:19:11." => sub { my $type = mk_type('Time', {'maxExclusive' => '08:19:11'}); should_pass("00:00:00", $type, 0); should_pass("00:57:42", $type, 0); should_pass("06:00:38", $type, 0); should_pass("06:26:36", $type, 0); should_pass("08:19:10", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 23:35:02." => sub { my $type = mk_type('Time', {'maxExclusive' => '23:35:02'}); should_pass("00:00:00", $type, 0); should_pass("08:50:26", $type, 0); should_pass("05:19:06", $type, 0); should_pass("10:35:34", $type, 0); should_pass("23:35:01", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 12:25:37." => sub { my $type = mk_type('Time', {'maxExclusive' => '12:25:37'}); should_pass("00:00:00", $type, 0); should_pass("03:02:54", $type, 0); should_pass("02:53:04", $type, 0); should_pass("00:23:56", $type, 0); should_pass("12:25:36", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 23:59:59." => sub { my $type = mk_type('Time', {'maxExclusive' => '23:59:59'}); should_pass("00:00:00", $type, 0); should_pass("19:23:13", $type, 0); should_pass("10:54:21", $type, 0); should_pass("06:20:41", $type, 0); should_pass("23:59:58", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 00:00:00." => sub { my $type = mk_type('Time', {'maxInclusive' => '00:00:00'}); should_pass("00:00:00", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 13:46:08." => sub { my $type = mk_type('Time', {'maxInclusive' => '13:46:08'}); should_pass("00:00:00", $type, 0); should_pass("05:22:29", $type, 0); should_pass("02:13:46", $type, 0); should_pass("06:23:18", $type, 0); should_pass("13:46:08", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 05:07:34." => sub { my $type = mk_type('Time', {'maxInclusive' => '05:07:34'}); should_pass("00:00:00", $type, 0); should_pass("00:07:23", $type, 0); should_pass("04:49:01", $type, 0); should_pass("02:17:28", $type, 0); should_pass("05:07:34", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 18:06:59." => sub { my $type = mk_type('Time', {'maxInclusive' => '18:06:59'}); should_pass("00:00:00", $type, 0); should_pass("03:11:39", $type, 0); should_pass("07:07:10", $type, 0); should_pass("03:30:13", $type, 0); should_pass("18:06:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 23:59:59." => sub { my $type = mk_type('Time', {'maxInclusive' => '23:59:59'}); should_pass("00:00:00", $type, 0); should_pass("14:43:02", $type, 0); should_pass("12:26:24", $type, 0); should_pass("02:23:22", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value \\d9:\\d2:5\\d." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^\d9:\d2:5\d$)/}); should_pass("09:12:57", $type, 0); should_pass("19:12:57", $type, 0); should_pass("09:12:56", $type, 0); should_pass("19:12:58", $type, 0); should_pass("19:32:56", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value \\d6:\\d9:\\d9." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^\d6:\d9:\d9$)/}); should_pass("16:49:59", $type, 0); should_pass("06:59:19", $type, 0); should_pass("06:49:39", $type, 0); should_pass("06:09:49", $type, 0); should_pass("06:49:49", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value 1\\d:3\\d:\\d5." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^1\d:3\d:\d5$)/}); should_pass("10:33:45", $type, 0); should_pass("16:36:05", $type, 0); should_pass("15:35:55", $type, 0); should_pass("14:38:55", $type, 0); should_pass("16:37:05", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value \\d8:\\d4:\\d6." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^\d8:\d4:\d6$)/}); should_pass("18:54:16", $type, 0); should_pass("18:34:46", $type, 0); should_pass("08:14:16", $type, 0); should_pass("18:14:56", $type, 0); should_pass("18:44:06", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value \\d0:3\\d:2\\d." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^\d0:3\d:2\d$)/}); should_pass("00:37:22", $type, 0); should_pass("00:37:20", $type, 0); should_pass("00:33:24", $type, 0); should_pass("00:34:25", $type, 0); should_pass("10:31:23", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['01:44:56','07:44:41','05:55:52','21:59:07','12:41:23','02:47:45','03:43:07','02:00:14','01:42:27']}); should_pass("02:47:45", $type, 0); should_pass("07:44:41", $type, 0); should_pass("05:55:52", $type, 0); should_pass("01:42:27", $type, 0); should_pass("07:44:41", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['10:32:33','11:18:46','06:00:33','14:01:48','11:14:02','02:02:10']}); should_pass("11:14:02", $type, 0); should_pass("11:18:46", $type, 0); should_pass("14:01:48", $type, 0); should_pass("02:02:10", $type, 0); should_pass("06:00:33", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['03:47:11','16:04:46','01:35:26','22:39:51','15:13:10','23:32:59','02:39:19']}); should_pass("23:32:59", $type, 0); should_pass("23:32:59", $type, 0); should_pass("22:39:51", $type, 0); should_pass("15:13:10", $type, 0); should_pass("01:35:26", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['18:04:07','05:41:14','15:07:15','01:18:17','01:13:21','23:24:35','15:25:08','18:20:35','03:53:17']}); should_pass("01:18:17", $type, 0); should_pass("23:24:35", $type, 0); should_pass("05:41:14", $type, 0); should_pass("01:18:17", $type, 0); should_pass("23:24:35", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['06:18:04','07:45:10','12:06:46','21:01:58','05:34:33','22:22:06','12:17:04']}); should_pass("07:45:10", $type, 0); should_pass("05:34:33", $type, 0); should_pass("22:22:06", $type, 0); should_pass("05:34:33", $type, 0); should_pass("21:01:58", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Time', {'whiteSpace' => 'collapse'}); should_pass("00:00:00", $type, 0); should_pass("18:13:01", $type, 0); should_pass("05:12:21", $type, 0); should_pass("01:41:44", $type, 0); should_pass("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 02:50:21." => sub { my $type = mk_type('Time', {'minInclusive' => '02:50:21'}); should_fail("00:00:00", $type, 0); should_fail("01:56:56", $type, 0); should_fail("01:29:31", $type, 0); should_fail("00:24:24", $type, 0); should_fail("02:50:20", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 06:43:33." => sub { my $type = mk_type('Time', {'minInclusive' => '06:43:33'}); should_fail("00:00:00", $type, 0); should_fail("01:31:46", $type, 0); should_fail("00:06:50", $type, 0); should_fail("00:50:44", $type, 0); should_fail("06:43:32", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 11:03:36." => sub { my $type = mk_type('Time', {'minInclusive' => '11:03:36'}); should_fail("00:00:00", $type, 0); should_fail("05:39:21", $type, 0); should_fail("01:35:20", $type, 0); should_fail("00:50:16", $type, 0); should_fail("11:03:35", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 09:12:46." => sub { my $type = mk_type('Time', {'minInclusive' => '09:12:46'}); should_fail("00:00:00", $type, 0); should_fail("05:36:48", $type, 0); should_fail("00:50:52", $type, 0); should_fail("04:26:25", $type, 0); should_fail("09:12:45", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minInclusive with value 23:59:59." => sub { my $type = mk_type('Time', {'minInclusive' => '23:59:59'}); should_fail("00:00:00", $type, 0); should_fail("04:00:40", $type, 0); should_fail("01:43:09", $type, 0); should_fail("21:44:22", $type, 0); should_fail("23:59:58", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 00:00:00." => sub { my $type = mk_type('Time', {'maxInclusive' => '00:00:00'}); should_fail("00:00:01", $type, 0); should_fail("03:50:03", $type, 0); should_fail("05:17:58", $type, 0); should_fail("22:25:09", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 18:28:53." => sub { my $type = mk_type('Time', {'maxInclusive' => '18:28:53'}); should_fail("18:28:54", $type, 0); should_fail("20:12:28", $type, 0); should_fail("19:43:30", $type, 0); should_fail("22:15:48", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 13:09:12." => sub { my $type = mk_type('Time', {'maxInclusive' => '13:09:12'}); should_fail("13:09:13", $type, 0); should_fail("22:37:25", $type, 0); should_fail("14:00:03", $type, 0); should_fail("15:19:17", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 13:51:43." => sub { my $type = mk_type('Time', {'maxInclusive' => '13:51:43'}); should_fail("13:51:44", $type, 0); should_fail("18:14:02", $type, 0); should_fail("22:45:18", $type, 0); should_fail("18:47:55", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxInclusive with value 02:55:06." => sub { my $type = mk_type('Time', {'maxInclusive' => '02:55:06'}); should_fail("02:55:07", $type, 0); should_fail("18:51:45", $type, 0); should_fail("15:36:18", $type, 0); should_fail("23:34:55", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 00:00:00." => sub { my $type = mk_type('Time', {'minExclusive' => '00:00:00'}); should_fail("00:00:00", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 00:09:21." => sub { my $type = mk_type('Time', {'minExclusive' => '00:09:21'}); should_fail("00:00:00", $type, 0); should_fail("00:01:37", $type, 0); should_fail("00:07:26", $type, 0); should_fail("00:09:09", $type, 0); should_fail("00:09:21", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 10:11:47." => sub { my $type = mk_type('Time', {'minExclusive' => '10:11:47'}); should_fail("00:00:00", $type, 0); should_fail("01:54:01", $type, 0); should_fail("00:29:05", $type, 0); should_fail("09:06:13", $type, 0); should_fail("10:11:47", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 13:55:42." => sub { my $type = mk_type('Time', {'minExclusive' => '13:55:42'}); should_fail("00:00:00", $type, 0); should_fail("10:04:41", $type, 0); should_fail("10:03:21", $type, 0); should_fail("04:11:15", $type, 0); should_fail("13:55:42", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet minExclusive with value 23:59:58." => sub { my $type = mk_type('Time', {'minExclusive' => '23:59:58'}); should_fail("00:00:00", $type, 0); should_fail("23:18:52", $type, 0); should_fail("19:52:19", $type, 0); should_fail("13:35:32", $type, 0); should_fail("23:59:58", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 00:00:01." => sub { my $type = mk_type('Time', {'maxExclusive' => '00:00:01'}); should_fail("00:00:01", $type, 0); should_fail("02:05:24", $type, 0); should_fail("00:10:23", $type, 0); should_fail("16:26:28", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 22:37:46." => sub { my $type = mk_type('Time', {'maxExclusive' => '22:37:46'}); should_fail("22:37:46", $type, 0); should_fail("23:51:55", $type, 0); should_fail("23:00:04", $type, 0); should_fail("23:07:53", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 08:48:12." => sub { my $type = mk_type('Time', {'maxExclusive' => '08:48:12'}); should_fail("08:48:12", $type, 0); should_fail("09:36:32", $type, 0); should_fail("10:57:53", $type, 0); should_fail("22:32:25", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 10:24:23." => sub { my $type = mk_type('Time', {'maxExclusive' => '10:24:23'}); should_fail("10:24:23", $type, 0); should_fail("15:44:07", $type, 0); should_fail("13:43:09", $type, 0); should_fail("19:46:06", $type, 0); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet maxExclusive with value 23:59:59." => sub { my $type = mk_type('Time', {'maxExclusive' => '23:59:59'}); should_fail("23:59:59", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value 1\\d:2\\d:\\d4." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^1\d:2\d:\d4$)/}); should_fail("56:42:06", $type, 0); should_fail("41:49:38", $type, 0); should_fail("24:51:31", $type, 0); should_fail("57:19:49", $type, 0); should_fail("41:37:05", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value 1\\d:0\\d:3\\d." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^1\d:0\d:3\d$)/}); should_fail("44:26:28", $type, 0); should_fail("06:17:26", $type, 0); should_fail("47:42:05", $type, 0); should_fail("33:34:02", $type, 0); should_fail("59:17:12", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value 0\\d:1\\d:\\d1." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^0\d:1\d:\d1$)/}); should_fail("41:48:13", $type, 0); should_fail("17:38:26", $type, 0); should_fail("21:48:06", $type, 0); should_fail("25:38:35", $type, 0); should_fail("22:51:53", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value 0\\d:4\\d:\\d9." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^0\d:4\d:\d9$)/}); should_fail("58:22:17", $type, 0); should_fail("47:32:47", $type, 0); should_fail("36:37:38", $type, 0); should_fail("35:38:14", $type, 0); should_fail("28:03:27", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet pattern with value \\d0:\\d6:\\d7." => sub { my $type = mk_type('Time', {'pattern' => qr/(?ms:^\d0:\d6:\d7$)/}); should_fail("03:01:42", $type, 0); should_fail("17:30:11", $type, 0); should_fail("17:39:45", $type, 0); should_fail("06:44:41", $type, 0); should_fail("06:15:33", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['05:50:46','08:19:59','18:25:29','18:17:12','16:58:48','05:47:40','02:13:18','13:13:27','20:57:19']}); should_fail("21:33:28", $type, 0); should_fail("09:52:14", $type, 0); should_fail("22:38:25", $type, 0); should_fail("16:42:35", $type, 0); should_fail("21:49:16", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['22:31:41','14:22:25','01:05:23','18:15:39','13:03:07','08:53:02','19:11:09','23:10:24']}); should_fail("22:44:51", $type, 0); should_fail("16:28:23", $type, 0); should_fail("08:39:14", $type, 0); should_fail("06:29:29", $type, 0); should_fail("21:12:57", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['05:55:55','05:44:40','20:59:49','21:57:22','23:16:05','19:47:39','23:29:45']}); should_fail("21:20:53", $type, 0); should_fail("00:23:42", $type, 0); should_fail("06:08:54", $type, 0); should_fail("19:38:44", $type, 0); should_fail("10:21:30", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['08:50:27','09:36:04','15:17:44','03:09:02','00:12:41']}); should_fail("16:26:32", $type, 0); should_fail("02:52:00", $type, 0); should_fail("19:49:30", $type, 0); should_fail("22:47:05", $type, 0); should_fail("17:23:58", $type, 0); done_testing; }; subtest "Type atomic/time is restricted by facet enumeration." => sub { my $type = mk_type('Time', {'enumeration' => ['18:17:03','10:18:31','07:16:40','16:34:47','08:06:50','19:52:55','18:22:17','10:14:45','12:03:21','01:02:49']}); should_fail("10:52:55", $type, 0); should_fail("01:35:14", $type, 0); should_fail("23:47:21", $type, 0); should_fail("18:02:39", $type, 0); should_fail("20:06:44", $type, 0); done_testing; }; done_testing; 50token.t000664001750001750 27340612404317273 14051 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/token is restricted by facet maxLength with value 0." => sub { my $type = mk_type('Token', {'maxLength' => '0'}); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 919." => sub { my $type = mk_type('Token', {'maxLength' => '919'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts fromlrd", $type, 0); should_pass("the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on theqvhpwdz", $type, 0); should_pass("information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domkjkzjglkrlwizdgdaw", $type, 0); should_pass("ains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership byjbmjshidnoxpmtyo", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 834." => sub { my $type = mk_type('Token', {'maxLength' => '834'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more acew", $type, 0); should_pass("dvanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a wayrqubye", $type, 0); should_pass("that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XMLvmesshpypdqyersu", $type, 0); should_pass("documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directiocfcrsvtxltxhvq", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 670." => sub { my $type = mk_type('Token', {'maxLength' => '670'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital librarybdb", $type, 0); should_pass("Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alikdrdwx", $type, 0); should_pass("e particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex docuqnewftihq", $type, 0); should_pass("ments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespreadvfcganfbzmbpferfk", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 1000." => sub { my $type = mk_type('Token', {'maxLength' => '1000'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commujgd", $type, 0); should_pass("nity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certainxxtyripih", $type, 0); should_pass("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processohfmjlsewictictbyzoq", $type, 0); should_pass("rs and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tesnzocbkousxtoplnkosxnovdlihsiukytsw", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 0." => sub { my $type = mk_type('Token', {'minLength' => '0'}); should_pass("", $type, 0); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commuqkg", $type, 0); should_pass("nity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certainjrwtvkxkz", $type, 0); should_pass("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processosejjuewomjzhcvibrny", $type, 0); should_pass("rs and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tespwazobgdywpuwpexwmmrwxftxzyhrynwag", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 305." => sub { my $type = mk_type('Token', {'minLength' => '305'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Intmjv", $type, 0); should_pass("ernet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technhqoerxiiv", $type, 0); should_pass("ologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulahewjbspmdpbuitr", $type, 0); should_pass("te and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related taskswtpbmjmjvlsmu", $type, 0); should_pass(": Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developdyjlwzxkedyoebbvhhpyxdniocbwekohkjriydphdldjnsujoztacrjqfvzhugrncnacdbvvpxb", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 39." => sub { my $type = mk_type('Token', {'minLength' => '39'}); should_pass("The advent of Internet-enabled browsers", $type, 0); should_pass("and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet languagktej", $type, 0); should_pass("e called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rpqvjmjpnq", $type, 0); should_pass("ich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions owvbputcqgjirrhrepks", $type, 0); should_pass("f popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry partdjwwslylzqxffbmvlifrnieywcvwkiwwxiqupdlheruj", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 202." => sub { my $type = mk_type('Token', {'minLength' => '202'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML withpuhu", $type, 0); should_pass("more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describesbgmomi", $type, 0); should_pass("information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL definesqdktbjfuxqkhzgu", $type, 0); should_pass("methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to acihwpjrpmqlrhfji", $type, 0); should_pass("celerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XMLvvnpsrihgdzmwoevgonbfhxwccydmzrgcxopbxsvcqyrxyzlmtubpltdnnyqbcjxbimghue", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 1000." => sub { my $type = mk_type('Token', {'minLength' => '1000'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex dochrespcimyeaoelg", $type, 0); should_pass("cuments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed tohsnaqxsbzjdjsqsgcmenel", $type, 0); should_pass("accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS Xsmkvphruqvoefeblqmgjldgdwjfhvwocsefnqfdltvzectqluuyajpwpstwwqruxujmioec", $type, 0); should_pass("ML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging spjsjzivtiqshkciivvedhe", $type, 0); should_pass("ecifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies for business relationships and transactions The vocabularies business templates and business processesdvrdbvqevgvfpjrdpjzfofqtpavag", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 0." => sub { my $type = mk_type('Token', {'length' => '0'}); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); should_pass("", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 295." => sub { my $type = mk_type('Token', {'length' => '295'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-geneixp", $type, 0); should_pass("ration Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language tuwnhxp", $type, 0); should_pass("hat describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manaduy", $type, 0); should_pass("ipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheetcqylqany", $type, 0); should_pass("Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured informationdrjyfzhfhn", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 662." => sub { my $type = mk_type('Token', {'length' => '662'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange andwynpoolvq", $type, 0); should_pass("automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voixvcrloalxqyotfsk", $type, 0); should_pass("ce-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortiumwaotlmkrpytcio", $type, 0); should_pass("was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XMLohkjfhkqrmhomvezqsoejqfdquiboikkumcbxefytllkjk", $type, 0); should_pass("DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both tafycrkcrydnjnjslthgvpixrhkjrnsbio", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 979." => sub { my $type = mk_type('Token', {'length' => '979'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods fobuxycesnxtwypgqn", $type, 0); should_pass("r creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Sjrdpqjkvpoynnfefoei", $type, 0); should_pass("tandards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standardjbosdwwzdftmjmcbidisoxqxiprxmirifldwxrkpvhxggroanbbnqotpuerztkcipmabnbp", $type, 0); should_pass("s process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semanticsgysgujpwlpynhfujnkkdvml", $type, 0); should_pass("of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies frxopjjdtgkppellghxyughqtnt", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 1000." => sub { my $type = mk_type('Token', {'length' => '1000'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex dotsfbhegyrrjhkyxr", $type, 0); should_pass("cuments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed tojxhfhffyrmqiqexonwouxb", $type, 0); should_pass("accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS Xyplsindndoyiwhhwovllwhamovxmdkthwbxnhqwxgyzjtvpygvopyiejjhswseiujdjeqss", $type, 0); should_pass("ML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging spaypbxeuhirlmueandfmkd", $type, 0); should_pass("ecifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies for business relationships and transactions The vocabularies business templates and business processesrkcvylgrdcppyycrfjwbwchymditf", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\s([A-Z][a-z]{1,20}\\s){2},\\s[A-Z]{2}\\s15464." => sub { my $type = mk_type('Token', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\s([A-Z][a-z]{1,20}\s){2},\s[A-Z]{2}\s15464$)/}); should_pass("47 On And Build Are Street Use Soc , SD 15464", $type, 0); should_pass("5397 Xml Newcomers Program Technology Street The The , PA 15464", $type, 0); should_pass("7764 Templates Into The Be Street Been Technologies , DE 15464", $type, 0); should_pass("224 And And Approach Nist Street Also Chairing , ID 15464", $type, 0); should_pass("3 Older The And Technologies Street The Specifications , OR 15464", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\s([A-Z][a-z]{1,20}\\s){3},\\s[A-Z]{2}\\s19851-1515." => sub { my $type = mk_type('Token', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\s([A-Z][a-z]{1,20}\s){3},\s[A-Z]{2}\s19851-1515$)/}); should_pass("289 Them And Means Aid Street Appropriate Needed Well , OR 19851-1515", $type, 0); should_pass("7782 To Devices Pervasive Computed Street Information And Will , AZ 19851-1515", $type, 0); should_pass("3 To Interoperability Nist And Street Its Revolution Oasis , ID 19851-1515", $type, 0); should_pass("234 Implementations Registry Data Tools Street Original Although Discovery , SD 19851-1515", $type, 0); should_pass("5 Object The To Measurement Street Software Collaborating With , NJ 19851-1515", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){4}Street\\s([A-Z][a-z]{1,20}\\s){3},\\s[A-Z]{2}\\s13653." => sub { my $type = mk_type('Token', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){4}Street\s([A-Z][a-z]{1,20}\s){3},\s[A-Z]{2}\s13653$)/}); should_pass("3243 Organizations Are Developed In Street Suites The For , MA 13653", $type, 0); should_pass("59353 And Work Product Tools Street Is Well Base , NC 13653", $type, 0); should_pass("47724 Object And Organization The Street Within Specifications Global , KS 13653", $type, 0); should_pass("58 To Markup Ec And Street The Of Be , FL 13653", $type, 0); should_pass("333 Tests Competence That Technical Street Each Ensure Certain , NJ 13653", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){3}Street\\s([A-Z][a-z]{1,20}\\s){2},\\s[A-Z]{2}\\s13573." => sub { my $type = mk_type('Token', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){3}Street\s([A-Z][a-z]{1,20}\s){2},\s[A-Z]{2}\s13573$)/}); should_pass("224 Assuring Discovery Areas Street Assuring Provided , NE 13573", $type, 0); should_pass("1 The Impact Joint Street Of Testing , KS 13573", $type, 0); should_pass("323 Java More And Street And Efforts , OK 13573", $type, 0); should_pass("535 The In Software Street High Effective , MA 13573", $type, 0); should_pass("896 Be Environments Compatibility Street Web The , PA 13573", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet pattern with value \\d{1,5}\\s([A-Z][a-z]{1,20}\\s){2}Street\\s([A-Z][a-z]{1,20}\\s){2},\\s[A-Z]{2}\\s13926-1478." => sub { my $type = mk_type('Token', {'pattern' => qr/(?ms:^\d{1,5}\s([A-Z][a-z]{1,20}\s){2}Street\s([A-Z][a-z]{1,20}\s){2},\s[A-Z]{2}\s13926-1478$)/}); should_pass("4 Specification Repository Street As Of , MD 13926-1478", $type, 0); should_pass("2547 And Of Street Testing Will , AZ 13926-1478", $type, 0); should_pass("4353 Ec Improved Street Information Use , WY 13926-1478", $type, 0); should_pass("464 Pervasive For Street And Profile , GA 13926-1478", $type, 0); should_pass("32 Dom For Street Can Software , VT 13926-1478", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet enumeration." => sub { my $type = mk_type('Token', {'enumeration' => ['be','key','has','information','shift','discover','provide','user','commerce']}); should_pass("commerce", $type, 0); should_pass("provide", $type, 0); should_pass("be", $type, 0); should_pass("provide", $type, 0); should_pass("shift", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet enumeration." => sub { my $type = mk_type('Token', {'enumeration' => ['maintained','Develop','networks','file','the']}); should_pass("networks", $type, 0); should_pass("networks", $type, 0); should_pass("the", $type, 0); should_pass("file", $type, 0); should_pass("file", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet enumeration." => sub { my $type = mk_type('Token', {'enumeration' => ['Computing','compatibility','standardization','engineering','contains','areas']}); should_pass("contains", $type, 0); should_pass("standardization", $type, 0); should_pass("compatibility", $type, 0); should_pass("contains", $type, 0); should_pass("standardization", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet enumeration." => sub { my $type = mk_type('Token', {'enumeration' => ['pico-cellular','to','techniques','is','visibly','as','syntax','was']}); should_pass("as", $type, 0); should_pass("syntax", $type, 0); should_pass("as", $type, 0); should_pass("was", $type, 0); should_pass("syntax", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet enumeration." => sub { my $type = mk_type('Token', {'enumeration' => ['through','manufacturers','these','this','and']}); should_pass("manufacturers", $type, 0); should_pass("these", $type, 0); should_pass("this", $type, 0); should_pass("and", $type, 0); should_pass("this", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('Token', {'whiteSpace' => 'collapse'}); should_pass("The advent of Internet-enabled browsers and a first-generation language for defi", $type, 0); should_pass("ning data known as HTML has led to the creation of the world s first digital lib", $type, 0); should_pass("rary Using the simplicity of HTML with more advanced concepts from the publishin", $type, 0); should_pass("g community has led to the creation of a second-generation Internet language cal", $type, 0); should_pass("led the Extensible Markup Language XML which is rapidly becoming one of the most", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 211." => sub { my $type = mk_type('Token', {'minLength' => '211'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-", $type, 0); should_fail("generation language for defining data known as HTML has led to the creation of the world s first digitsp", $type, 0); should_fail("al library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet lr", $type, 0); should_fail("anguage called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in thjacbb", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 735." => sub { my $type = mk_type('Token', {'minLength' => '735'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplcwy", $type, 0); should_fail("icity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronictmmnfi", $type, 0); should_fail("commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitmbmzmkembccb", $type, 0); should_fail("ting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Rtuqudpjofoqvsg", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 360." => sub { my $type = mk_type('Token', {'minLength' => '360'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data", $type, 0); should_fail("known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to tprtq", $type, 0); should_fail("he creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involvedlmedx", $type, 0); should_fail("in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulatepegpixg", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 297." => sub { my $type = mk_type('Token', {'minLength' => '297'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language fo", $type, 0); should_fail("r defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepoew", $type, 0); should_fail("ts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML iuknm", $type, 0); should_fail("s being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automatbmhs", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet minLength with value 1000." => sub { my $type = mk_type('Token', {'minLength' => '1000'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commmfq", $type, 0); should_fail("unity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certagduvgnuc", $type, 0); should_fail("in processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML prwfukctoygndmkdhqrzn", $type, 0); should_fail("ocessors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provrbqmfztmpdxcwdsojiermqhxxobdghgspc", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 0." => sub { my $type = mk_type('Token', {'maxLength' => '0'}); should_fail("T", $type, 0); should_fail("he advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing communbwa", $type, 0); should_fail("ity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certaineovkdduzm", $type, 0); should_fail("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML procesbfywxwjjuvtxpxchrdg", $type, 0); should_fail("sors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tobfmavhfsxdagbpnbrpawklqbcvellzrfd", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 576." => sub { my $type = mk_type('Token', {'maxLength' => '576'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It isjqqrrmcko", $type, 0); should_fail("a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents ouuxofoudkgcpgxc", $type, 0); should_fail("n a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards byvonaqslsivfxlhe", $type, 0); should_fail("addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standardspqymicffkqurzkcpntuwruntghaekdsscosmheucameafcuijrnfntbpenbsjfohefqii", $type, 0); should_fail("process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their informationpwieyxtfmjfkpdcyoghktflql", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 664." => sub { my $type = mk_type('Token', {'maxLength' => '664'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and aurymgkzqwf", $type, 0); should_fail("tomatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologievmdefnafttxygwrwo", $type, 0); should_fail("s to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the followingvqbbveiuflyxto", $type, 0); should_fail("related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3Cmmvydclqztgqerqzilfqjqxyaiugysfpzjvvvekfjmgkqkowrxexqxtvfktrejuhigocyhez", $type, 0); should_fail("robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a sigyxsbibrmfmqtiyiewzejmstd", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 720." => sub { my $type = mk_type('Token', {'maxLength' => '720'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it canhtlbcrkpvsm", $type, 0); should_fail("be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and supplocooxfkbxywfprjyyei", $type, 0); should_fail("ort for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts incgibodzisxcurebzqdo", $type, 0); should_fail("luding OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exeuabukjvndntfmqqzncfotsokpralxmrpismqkjmcrsjabsfpbbjkdkhmpxkajostpxs", $type, 0); should_fail("rcise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Markup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve Awjvhmsrcdhtokcfsffqydrl", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet maxLength with value 1000." => sub { my $type = mk_type('Token', {'maxLength' => '1000'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex doczwkgcpmvlpsrotns", $type, 0); should_fail("uments The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following relateylltkrqhqfffnxjfsttvejpe", $type, 0); should_fail("d tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of these tools are fed back into the development process for correction in future revisions An industry s ability to use electronic commerce EC effectively depends primarily on that industry s ability to create manipulate and transmit intelligent information among partners and throughout the industry The eXtensible Marinfwlbfxrhfgxkpmeqgxjcpwdaoerengdfemxuckfchlrzifqvlvvimapvbeliqlatcqytcdvfnmmemypkgc", $type, 0); should_fail("kup Language XML which is already targeted as the enabling technology for EC is the primary standard by which industries are defining the structure and semantics of their information XML is a base recommendation coupled with a set of emerging specifications and related vocabularies based upon the XML syntax In the simplest sense the benefits of XML will only be achieved if organizations of a significant number are using the same XML documents Therefore these XML documents must be available for partners to discover and retrieve A registry/repository is a mechanism used to discover and retrieve documents templates software i e objects and resources over the Internet A registry is the mechanism used to discover the object The registry provides information about the object including the location of the object A repository is where the object resides A user retrieves an object from a repository Although XML is a recent newcomer in the electronic commerce landscape supply chains in many industries as well as industry consortiums and standards organizations are using XML to define their own vocabularies for business relationships and transactions The vocabularies business templates and business processes used by these groups to transact business must be accessible by all partners at any time Furthermore newcomers to the supply chain or business partnerships must be able to discover these documents and retrieve them A registry and repository can be used to provide this service A series of registries and repositories can link many organizations and industries acting as a web of registries for discovery Standards are needed to ensure interoperability of these registries; additionally a regdnrghtrvrdwuyopobsrtvbscricpynrpiamrdkil", $type, 0); should_fail("istry vocabulary must be created for consistency of discovery information among them NIST/ITL is working with the Organization for the Advancement of Structured Information Standards OASIS the prominent industry consortium for defining specifications for the discovery and retrieval of XML-related documents NIST chairs the OASIS Registry/Repository Technical Committee and is a significant contributor NIST/ITL is also working within the ebXML Project a joint project between OASIS and the United Nations body for Trade Facilitation and Electronic Business UN/CEFACT the prominent business-oriented international standards organization for the discovery retrieval and use of business processes and related documents The role of NIST/ITL is to influence the quality correctness and testability of the specifications of both the OASIS and ebXML Registry/Repository Working Groups through our reference implementation of a registry and repository that is conformant to both specifications Additionally NIST/ITL facilitates cross-over discussions between OASIS and ebXML; thus helping to ensure compatibility of the specifications NIST/ITL through its leadership in developing a reference implementation that is compliant to both specifications will help ensure that both specifications are unambiguous complete and testable This work will also contribute to the compatibility of these two specifications An early indication of success is that the draft ebXML specification uses the OASIS specification as its basis The completion of these specifications will allow small- and medium-sized enterprises SMEs to make appropriate choices with regard to EC tools and applications and will allow them access to the emerging supply chain and industry partnership EC models The National Software Reference Library NSRL provides a repository of known software file profiles and file signatures for use by law enforcement organizations in computer forensics investigationsyoiqsimkqtpssjmesezvmqjfqnuasjwxoocwqhdq", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 0." => sub { my $type = mk_type('Token', {'length' => '0'}); should_fail("T", $type, 0); should_fail("he advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing communthx", $type, 0); should_fail("ity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certainncxfhwimh", $type, 0); should_fail("processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML proceseefqeindqnirhewxked", $type, 0); should_fail("sors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provide tmkqlxwhyflzefrlduubpselyjdgmnlomec", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 370." => sub { my $type = mk_type('Token', {'length' => '370'}); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML whichpmywafe", $type, 0); should_fail("is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and dyppysunp", $type, 0); should_fail("isplay context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in betwgsnslnwwfnotqike", $type, 0); should_fail("a versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcomhyxjvkgcdekijygfmlchdwl", $type, 0); should_fail("mittees W3C XSL-FO DOM and XML Schema Working Groups Provide test frameworks for XML DOM XSL-FO XSLT/Xpath and XML Schemas Partner with industry participants to build robust test suites for XML DOM XSL-FO XSLT/Xpath and XML Schemas Develop in-house tools to aid in automating test generation for XML-based languages Work with industry to ensure that these tests are used as metrology tools and that the results of the tests are fed back into both the standards process and the development process As chair of the OASIS XML Conformance Subcommittee NIST/ITL led the development of the widely used XML test suite NIST/ITL has further developed in cooperation with OASIS and W3C robust testing resources for related XML technologies including XML Schemas DOM and XSL Developers and users utilize these tools to exercise both the appropriate W3C Recommendation and the associated implementations Errors and ambiguities raised as a result of tlpohkqyqgwskuvnpiergsyebsddnoaiwltexjnrvdtlndlaizvnjfrneqzgoug", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 780." => sub { my $type = mk_type('Token', {'length' => '780'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTdew", $type, 0); should_fail("ML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a laejwucj", $type, 0); should_fail("nguage that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensibpwcqerqxz", $type, 0); should_fail("sible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structureiubnkylfuxijat", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 645." => sub { my $type = mk_type('Token', {'length' => '645'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital ligy", $type, 0); should_fail("brary Using the simplicity of HTML with more advanced concepts from the publishing community has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages andnsvto", $type, 0); should_fail("applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certain processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitinvzilpnffh", $type, 0); should_fail("ve methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML processors and support for the related Schema DOM and XSL technologies are available in beta versions of popular webdynirmjmhgckeaml", $type, 0); done_testing; }; subtest "Type atomic/token is restricted by facet length with value 1000." => sub { my $type = mk_type('Token', {'length' => '1000'}); should_fail("", $type, 0); should_fail("The advent of Internet-enabled browsers and a first-generation language for defining data known as HTML has led to the creation of the world s first digital library Using the simplicity of HTML with more advanced concepts from the publishing commqsm", $type, 0); should_fail("unity has led to the creation of a second-generation Internet language called the Extensible Markup Language XML which is rapidly becoming one of the most popular languages in the world XML is being incorporated into web pages and applications alike particularly in those involved in electronic commerce applications It is a language that describes information in a way that allows computers to exchange and automatically act on the information Consequently it can be used to automate certaadpxjfzr", $type, 0); should_fail("in processes A set of related technologies built around this Internet language define a rich set of tools that can be used to define manipulate and display context-rich data In particular XML Schemas define intuitive methods for creating complex documents The Document Object Model DOM defines methods for interacting with XML and HTML permitting the dynamic creation and manipulation of documents The Extensible Stylesheet Language XSL defines methods for transforming and displaying XML documents on a variety of devices from web browsers to print mediums to voice-enabled devices Virtually all application domains are looking to use XML technologies to define manipulate and exchange structured information In addition XML prgqlamlorcnkdgwhfodr", $type, 0); should_fail("ocessors and support for the related Schema DOM and XSL technologies are available in beta versions of popular web browsers and application development software The widespread availability of these technologies has made them obvious choices as building blocks for electronic commerce As such conformance of these products to the W3C Recommendations is necessary to build interoperable solutions The Organization for the Advancement of Structured Information Standards OASIS consortium was formed to accelerate the adoption of these standards by addressing market needs and directions and recommending guidelines for product interoperability and conformance NIST/ITL is collaborating with industry to solve these problems using the following related tasks: Provide technical leadership by chairing and/or participating in appropriate OASIS and W3C efforts including OASIS XML and XSLT/Xpath Conformance Subcommittees W3C XSL-FO DOM and XML Schema Working Groups Provymqlzmrkqzpbllftnuiaoyyykvbkcmuyiy", $type, 0); done_testing; }; done_testing; 50unsignedByte.t000664001750001750 5234312404317273 15344 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '0'}); should_pass("1", $type, 0); should_pass("127", $type, 0); should_pass("214", $type, 0); should_pass("55", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 172." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '172'}); should_pass("173", $type, 0); should_pass("190", $type, 0); should_pass("183", $type, 0); should_pass("209", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 253." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '253'}); should_pass("254", $type, 0); should_pass("254", $type, 0); should_pass("254", $type, 0); should_pass("254", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 145." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '145'}); should_pass("146", $type, 0); should_pass("218", $type, 0); should_pass("234", $type, 0); should_pass("169", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 254." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '254'}); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '0'}); should_pass("0", $type, 0); should_pass("169", $type, 0); should_pass("133", $type, 0); should_pass("108", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 14." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '14'}); should_pass("14", $type, 0); should_pass("36", $type, 0); should_pass("195", $type, 0); should_pass("16", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 18." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '18'}); should_pass("18", $type, 0); should_pass("112", $type, 0); should_pass("221", $type, 0); should_pass("200", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 25." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '25'}); should_pass("25", $type, 0); should_pass("220", $type, 0); should_pass("197", $type, 0); should_pass("214", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 255." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '255'}); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '1'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 162." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '162'}); should_pass("0", $type, 0); should_pass("139", $type, 0); should_pass("112", $type, 0); should_pass("155", $type, 0); should_pass("161", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 10." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '10'}); should_pass("0", $type, 0); should_pass("2", $type, 0); should_pass("4", $type, 0); should_pass("8", $type, 0); should_pass("9", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 3." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '3'}); should_pass("0", $type, 0); should_pass("0", $type, 0); should_pass("0", $type, 0); should_pass("1", $type, 0); should_pass("2", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 255." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '255'}); should_pass("0", $type, 0); should_pass("105", $type, 0); should_pass("26", $type, 0); should_pass("135", $type, 0); should_pass("254", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '0'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 232." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '232'}); should_pass("0", $type, 0); should_pass("107", $type, 0); should_pass("218", $type, 0); should_pass("51", $type, 0); should_pass("232", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 104." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '104'}); should_pass("0", $type, 0); should_pass("67", $type, 0); should_pass("65", $type, 0); should_pass("86", $type, 0); should_pass("104", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 217." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '217'}); should_pass("0", $type, 0); should_pass("91", $type, 0); should_pass("99", $type, 0); should_pass("104", $type, 0); should_pass("217", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 255." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '255'}); should_pass("0", $type, 0); should_pass("186", $type, 0); should_pass("43", $type, 0); should_pass("211", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('UnsignedByte', {'fractionDigits' => '0'}); should_pass("0", $type, 0); should_pass("195", $type, 0); should_pass("23", $type, 0); should_pass("126", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedByte', {'totalDigits' => '1'}); should_pass("5", $type, 0); should_pass("3", $type, 0); should_pass("7", $type, 0); should_pass("2", $type, 0); should_pass("3", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('UnsignedByte', {'totalDigits' => '2'}); should_pass("4", $type, 0); should_pass("67", $type, 0); should_pass("1", $type, 0); should_pass("10", $type, 0); should_pass("3", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('UnsignedByte', {'totalDigits' => '3'}); should_pass("2", $type, 0); should_pass("46", $type, 0); should_pass("136", $type, 0); should_pass("3", $type, 0); should_pass("62", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("6", $type, 0); should_pass("5", $type, 0); should_pass("6", $type, 0); should_pass("8", $type, 0); should_pass("5", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{2}$)/}); should_pass("43", $type, 0); should_pass("67", $type, 0); should_pass("48", $type, 0); should_pass("29", $type, 0); should_pass("88", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{3}$)/}); should_pass("242", $type, 0); should_pass("222", $type, 0); should_pass("234", $type, 0); should_pass("222", $type, 0); should_pass("233", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("8", $type, 0); should_pass("4", $type, 0); should_pass("3", $type, 0); should_pass("4", $type, 0); should_pass("5", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{2}$)/}); should_pass("52", $type, 0); should_pass("83", $type, 0); should_pass("45", $type, 0); should_pass("62", $type, 0); should_pass("77", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['21','255','57','70','6','45','8','90','85','14']}); should_pass("70", $type, 0); should_pass("85", $type, 0); should_pass("8", $type, 0); should_pass("255", $type, 0); should_pass("21", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['8','40','6','65','49']}); should_pass("8", $type, 0); should_pass("8", $type, 0); should_pass("6", $type, 0); should_pass("49", $type, 0); should_pass("40", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['61','8','7','101','255','111','47','66','91','99']}); should_pass("91", $type, 0); should_pass("66", $type, 0); should_pass("99", $type, 0); should_pass("101", $type, 0); should_pass("111", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['8','43','15','255','83','72','71']}); should_pass("15", $type, 0); should_pass("255", $type, 0); should_pass("71", $type, 0); should_pass("15", $type, 0); should_pass("43", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['1','21','55','9','132','255','17']}); should_pass("132", $type, 0); should_pass("132", $type, 0); should_pass("132", $type, 0); should_pass("255", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('UnsignedByte', {'whiteSpace' => 'collapse'}); should_pass("0", $type, 0); should_pass("208", $type, 0); should_pass("197", $type, 0); should_pass("20", $type, 0); should_pass("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 70." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '70'}); should_fail("0", $type, 0); should_fail("7", $type, 0); should_fail("13", $type, 0); should_fail("65", $type, 0); should_fail("69", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 202." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '202'}); should_fail("0", $type, 0); should_fail("9", $type, 0); should_fail("108", $type, 0); should_fail("102", $type, 0); should_fail("201", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 252." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '252'}); should_fail("0", $type, 0); should_fail("33", $type, 0); should_fail("148", $type, 0); should_fail("40", $type, 0); should_fail("251", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 171." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '171'}); should_fail("0", $type, 0); should_fail("10", $type, 0); should_fail("0", $type, 0); should_fail("129", $type, 0); should_fail("170", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minInclusive with value 255." => sub { my $type = mk_type('UnsignedByte', {'minInclusive' => '255'}); should_fail("0", $type, 0); should_fail("225", $type, 0); should_fail("90", $type, 0); should_fail("22", $type, 0); should_fail("254", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '0'}); should_fail("1", $type, 0); should_fail("20", $type, 0); should_fail("133", $type, 0); should_fail("169", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 68." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '68'}); should_fail("69", $type, 0); should_fail("156", $type, 0); should_fail("224", $type, 0); should_fail("173", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 195." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '195'}); should_fail("196", $type, 0); should_fail("218", $type, 0); should_fail("216", $type, 0); should_fail("233", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 39." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '39'}); should_fail("40", $type, 0); should_fail("246", $type, 0); should_fail("148", $type, 0); should_fail("251", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxInclusive with value 7." => sub { my $type = mk_type('UnsignedByte', {'maxInclusive' => '7'}); should_fail("8", $type, 0); should_fail("74", $type, 0); should_fail("85", $type, 0); should_fail("118", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedByte', {'totalDigits' => '1'}); should_fail("55", $type, 0); should_fail("230", $type, 0); should_fail("12", $type, 0); should_fail("212", $type, 0); should_fail("62", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('UnsignedByte', {'totalDigits' => '2'}); should_fail("247", $type, 0); should_fail("121", $type, 0); should_fail("187", $type, 0); should_fail("121", $type, 0); should_fail("185", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '0'}); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 35." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '35'}); should_fail("0", $type, 0); should_fail("31", $type, 0); should_fail("13", $type, 0); should_fail("16", $type, 0); should_fail("35", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 137." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '137'}); should_fail("0", $type, 0); should_fail("1", $type, 0); should_fail("47", $type, 0); should_fail("99", $type, 0); should_fail("137", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 251." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '251'}); should_fail("0", $type, 0); should_fail("219", $type, 0); should_fail("89", $type, 0); should_fail("178", $type, 0); should_fail("251", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet minExclusive with value 254." => sub { my $type = mk_type('UnsignedByte', {'minExclusive' => '254'}); should_fail("0", $type, 0); should_fail("205", $type, 0); should_fail("204", $type, 0); should_fail("184", $type, 0); should_fail("254", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '1'}); should_fail("1", $type, 0); should_fail("147", $type, 0); should_fail("103", $type, 0); should_fail("9", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 122." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '122'}); should_fail("122", $type, 0); should_fail("240", $type, 0); should_fail("133", $type, 0); should_fail("143", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 136." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '136'}); should_fail("136", $type, 0); should_fail("162", $type, 0); should_fail("225", $type, 0); should_fail("234", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 113." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '113'}); should_fail("113", $type, 0); should_fail("147", $type, 0); should_fail("199", $type, 0); should_fail("185", $type, 0); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet maxExclusive with value 255." => sub { my $type = mk_type('UnsignedByte', {'maxExclusive' => '255'}); should_fail("255", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("27", $type, 0); should_fail("221", $type, 0); should_fail("31", $type, 0); should_fail("72", $type, 0); should_fail("56", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{2}$)/}); should_fail("7", $type, 0); should_fail("8", $type, 0); should_fail("232", $type, 0); should_fail("8", $type, 0); should_fail("223", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{3}$)/}); should_fail("85", $type, 0); should_fail("85", $type, 0); should_fail("46", $type, 0); should_fail("5", $type, 0); should_fail("1", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("75", $type, 0); should_fail("232", $type, 0); should_fail("223", $type, 0); should_fail("56", $type, 0); should_fail("232", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('UnsignedByte', {'pattern' => qr/(?ms:^\d{2}$)/}); should_fail("1", $type, 0); should_fail("234", $type, 0); should_fail("4", $type, 0); should_fail("223", $type, 0); should_fail("1", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['1','107','54','255','95','12','67','63']}); should_fail("53", $type, 0); should_fail("38", $type, 0); should_fail("81", $type, 0); should_fail("152", $type, 0); should_fail("103", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['78','21','24','73','87','9','55','255','168','84']}); should_fail("48", $type, 0); should_fail("74", $type, 0); should_fail("198", $type, 0); should_fail("213", $type, 0); should_fail("98", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['31','5','7','66','59','44','93']}); should_fail("77", $type, 0); should_fail("58", $type, 0); should_fail("147", $type, 0); should_fail("231", $type, 0); should_fail("193", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['3','66','2','255','9','10','48','7']}); should_fail("193", $type, 0); should_fail("80", $type, 0); should_fail("219", $type, 0); should_fail("39", $type, 0); should_fail("47", $type, 0); done_testing; }; subtest "Type atomic/unsignedByte is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedByte', {'enumeration' => ['76','9','28','1','50','72','23']}); should_fail("63", $type, 0); should_fail("182", $type, 0); should_fail("45", $type, 0); should_fail("40", $type, 0); should_fail("107", $type, 0); done_testing; }; done_testing; 50unsignedInt.t000664001750001750 6213112404317273 15167 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '0'}); should_pass("1", $type, 0); should_pass("1832591814", $type, 0); should_pass("1159363342", $type, 0); should_pass("2761156808", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 72170852." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '72170852'}); should_pass("72170853", $type, 0); should_pass("667832659", $type, 0); should_pass("2383344626", $type, 0); should_pass("3725868637", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 2085810236." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '2085810236'}); should_pass("2085810237", $type, 0); should_pass("2739688204", $type, 0); should_pass("2494311306", $type, 0); should_pass("4000722380", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 4242349370." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '4242349370'}); should_pass("4242349371", $type, 0); should_pass("4258076808", $type, 0); should_pass("4267468898", $type, 0); should_pass("4284182886", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 4294967294." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '4294967294'}); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '0'}); should_pass("0", $type, 0); should_pass("2266183353", $type, 0); should_pass("3817833782", $type, 0); should_pass("1739697344", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 3433747195." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '3433747195'}); should_pass("3433747195", $type, 0); should_pass("3749498688", $type, 0); should_pass("4141075250", $type, 0); should_pass("3867497808", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 2401546713." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '2401546713'}); should_pass("2401546713", $type, 0); should_pass("3115589962", $type, 0); should_pass("3761415141", $type, 0); should_pass("2817083921", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 2912115668." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '2912115668'}); should_pass("2912115668", $type, 0); should_pass("4109011338", $type, 0); should_pass("3088452651", $type, 0); should_pass("2961995942", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 4294967295." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '4294967295'}); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '1'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 339569650." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '339569650'}); should_pass("0", $type, 0); should_pass("23046762", $type, 0); should_pass("235307581", $type, 0); should_pass("334268793", $type, 0); should_pass("339569649", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 1539442072." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '1539442072'}); should_pass("0", $type, 0); should_pass("1084249757", $type, 0); should_pass("1213056054", $type, 0); should_pass("493131837", $type, 0); should_pass("1539442071", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 1033689612." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '1033689612'}); should_pass("0", $type, 0); should_pass("939722023", $type, 0); should_pass("606292023", $type, 0); should_pass("255360374", $type, 0); should_pass("1033689611", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 4294967295." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '4294967295'}); should_pass("0", $type, 0); should_pass("401123804", $type, 0); should_pass("1160725769", $type, 0); should_pass("1186451478", $type, 0); should_pass("4294967294", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '0'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 3323681229." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '3323681229'}); should_pass("0", $type, 0); should_pass("2832786672", $type, 0); should_pass("518374699", $type, 0); should_pass("2045003521", $type, 0); should_pass("3323681229", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 637454996." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '637454996'}); should_pass("0", $type, 0); should_pass("278337081", $type, 0); should_pass("485072777", $type, 0); should_pass("268919441", $type, 0); should_pass("637454996", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 3479012164." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '3479012164'}); should_pass("0", $type, 0); should_pass("1016153814", $type, 0); should_pass("1811092620", $type, 0); should_pass("5643795", $type, 0); should_pass("3479012164", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 4294967295." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '4294967295'}); should_pass("0", $type, 0); should_pass("2154216687", $type, 0); should_pass("3994448256", $type, 0); should_pass("2521119044", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('UnsignedInt', {'fractionDigits' => '0'}); should_pass("0", $type, 0); should_pass("1924287060", $type, 0); should_pass("1509728369", $type, 0); should_pass("252230610", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '1'}); should_pass("1", $type, 0); should_pass("7", $type, 0); should_pass("1", $type, 0); should_pass("2", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '3'}); should_pass("6", $type, 0); should_pass("31", $type, 0); should_pass("852", $type, 0); should_pass("3", $type, 0); should_pass("76", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '5'}); should_pass("3", $type, 0); should_pass("63", $type, 0); should_pass("958", $type, 0); should_pass("3996", $type, 0); should_pass("72469", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '7'}); should_pass("2", $type, 0); should_pass("20", $type, 0); should_pass("328", $type, 0); should_pass("6891", $type, 0); should_pass("7727448", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '10'}); should_pass("8", $type, 0); should_pass("255", $type, 0); should_pass("33841", $type, 0); should_pass("1768503", $type, 0); should_pass("1871752173", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("4", $type, 0); should_pass("7", $type, 0); should_pass("3", $type, 0); should_pass("5", $type, 0); should_pass("2", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{3}$)/}); should_pass("879", $type, 0); should_pass("233", $type, 0); should_pass("783", $type, 0); should_pass("621", $type, 0); should_pass("699", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("68779", $type, 0); should_pass("37876", $type, 0); should_pass("34638", $type, 0); should_pass("48493", $type, 0); should_pass("43284", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{7}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{7}$)/}); should_pass("3384339", $type, 0); should_pass("2273743", $type, 0); should_pass("6664358", $type, 0); should_pass("5263655", $type, 0); should_pass("2323319", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{10}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{10}$)/}); should_pass("4142734124", $type, 0); should_pass("4121131161", $type, 0); should_pass("4142731174", $type, 0); should_pass("4111322122", $type, 0); should_pass("4153734111", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['80391676','162','13943339','582','367952057','283609','844']}); should_pass("582", $type, 0); should_pass("283609", $type, 0); should_pass("582", $type, 0); should_pass("162", $type, 0); should_pass("367952057", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['1331474827','25','576176','944130','62','46','5135198','2157977','311']}); should_pass("2157977", $type, 0); should_pass("62", $type, 0); should_pass("5135198", $type, 0); should_pass("944130", $type, 0); should_pass("62", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['47','2421249','90949193','6248','70884037','959','8001','9175']}); should_pass("2421249", $type, 0); should_pass("959", $type, 0); should_pass("47", $type, 0); should_pass("959", $type, 0); should_pass("2421249", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['47','9906','271268','18558','969778623','237992966']}); should_pass("969778623", $type, 0); should_pass("9906", $type, 0); should_pass("47", $type, 0); should_pass("969778623", $type, 0); should_pass("18558", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['34216','276','99184083','7776','6662698','134172074','93114']}); should_pass("6662698", $type, 0); should_pass("276", $type, 0); should_pass("7776", $type, 0); should_pass("6662698", $type, 0); should_pass("34216", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('UnsignedInt', {'whiteSpace' => 'collapse'}); should_pass("0", $type, 0); should_pass("2626359436", $type, 0); should_pass("934961103", $type, 0); should_pass("1581635374", $type, 0); should_pass("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 2976894290." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '2976894290'}); should_fail("0", $type, 0); should_fail("708347188", $type, 0); should_fail("1122195078", $type, 0); should_fail("174343210", $type, 0); should_fail("2976894289", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 1076892208." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '1076892208'}); should_fail("0", $type, 0); should_fail("15441599", $type, 0); should_fail("316873262", $type, 0); should_fail("459570687", $type, 0); should_fail("1076892207", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 2815670596." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '2815670596'}); should_fail("0", $type, 0); should_fail("863588906", $type, 0); should_fail("1185750112", $type, 0); should_fail("1707302678", $type, 0); should_fail("2815670595", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 795920399." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '795920399'}); should_fail("0", $type, 0); should_fail("26358710", $type, 0); should_fail("718501086", $type, 0); should_fail("657587282", $type, 0); should_fail("795920398", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minInclusive with value 4294967295." => sub { my $type = mk_type('UnsignedInt', {'minInclusive' => '4294967295'}); should_fail("0", $type, 0); should_fail("2582347832", $type, 0); should_fail("3935935285", $type, 0); should_fail("1759957870", $type, 0); should_fail("4294967294", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '0'}); should_fail("1", $type, 0); should_fail("2539298279", $type, 0); should_fail("1594892403", $type, 0); should_fail("2572895521", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 1116575447." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '1116575447'}); should_fail("1116575448", $type, 0); should_fail("3876884850", $type, 0); should_fail("1663494401", $type, 0); should_fail("4066312590", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 3663158687." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '3663158687'}); should_fail("3663158688", $type, 0); should_fail("4112413925", $type, 0); should_fail("3777174703", $type, 0); should_fail("4282922536", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 1600916644." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '1600916644'}); should_fail("1600916645", $type, 0); should_fail("2909227258", $type, 0); should_fail("3587562506", $type, 0); should_fail("2235705500", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxInclusive with value 2354971999." => sub { my $type = mk_type('UnsignedInt', {'maxInclusive' => '2354971999'}); should_fail("2354972000", $type, 0); should_fail("3033595904", $type, 0); should_fail("3931046249", $type, 0); should_fail("3724502281", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '1'}); should_fail("12", $type, 0); should_fail("5241", $type, 0); should_fail("225238", $type, 0); should_fail("57582229", $type, 0); should_fail("3694220168", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '2'}); should_fail("744", $type, 0); should_fail("6087", $type, 0); should_fail("41606", $type, 0); should_fail("575323", $type, 0); should_fail("3207575552", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '3'}); should_fail("8438", $type, 0); should_fail("17357", $type, 0); should_fail("587817", $type, 0); should_fail("4633572", $type, 0); should_fail("3521971725", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '4'}); should_fail("47001", $type, 0); should_fail("823342", $type, 0); should_fail("7164125", $type, 0); should_fail("81398613", $type, 0); should_fail("1850477094", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('UnsignedInt', {'totalDigits' => '5'}); should_fail("147284", $type, 0); should_fail("7452558", $type, 0); should_fail("64885333", $type, 0); should_fail("536553013", $type, 0); should_fail("3684558235", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '0'}); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 1657198128." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '1657198128'}); should_fail("0", $type, 0); should_fail("1502453737", $type, 0); should_fail("308967366", $type, 0); should_fail("1308358655", $type, 0); should_fail("1657198128", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 38976714." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '38976714'}); should_fail("0", $type, 0); should_fail("9799632", $type, 0); should_fail("17346221", $type, 0); should_fail("12100146", $type, 0); should_fail("38976714", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 1759037912." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '1759037912'}); should_fail("0", $type, 0); should_fail("432160371", $type, 0); should_fail("807014465", $type, 0); should_fail("1141429462", $type, 0); should_fail("1759037912", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet minExclusive with value 4294967294." => sub { my $type = mk_type('UnsignedInt', {'minExclusive' => '4294967294'}); should_fail("0", $type, 0); should_fail("908662424", $type, 0); should_fail("712642291", $type, 0); should_fail("2489818821", $type, 0); should_fail("4294967294", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '1'}); should_fail("1", $type, 0); should_fail("1139629629", $type, 0); should_fail("315140948", $type, 0); should_fail("3228964435", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 3352947019." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '3352947019'}); should_fail("3352947019", $type, 0); should_fail("3680518649", $type, 0); should_fail("3578123117", $type, 0); should_fail("4203755449", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 205769955." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '205769955'}); should_fail("205769955", $type, 0); should_fail("297207523", $type, 0); should_fail("2475770327", $type, 0); should_fail("551666909", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 1758636711." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '1758636711'}); should_fail("1758636711", $type, 0); should_fail("4028713122", $type, 0); should_fail("3768820111", $type, 0); should_fail("4142208651", $type, 0); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet maxExclusive with value 4294967295." => sub { my $type = mk_type('UnsignedInt', {'maxExclusive' => '4294967295'}); should_fail("4294967295", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("24292767", $type, 0); should_fail("486586812", $type, 0); should_fail("47856523", $type, 0); should_fail("4663127", $type, 0); should_fail("322455443", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{3}$)/}); should_fail("4867", $type, 0); should_fail("4132656154", $type, 0); should_fail("25552718", $type, 0); should_fail("245348", $type, 0); should_fail("36", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("4133716174", $type, 0); should_fail("2571", $type, 0); should_fail("254428812", $type, 0); should_fail("959824", $type, 0); should_fail("2662511", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{7}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{7}$)/}); should_fail("63283426", $type, 0); should_fail("61451847", $type, 0); should_fail("231944", $type, 0); should_fail("5882", $type, 0); should_fail("36937417", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet pattern with value \\d{10}." => sub { my $type = mk_type('UnsignedInt', {'pattern' => qr/(?ms:^\d{10}$)/}); should_fail("4494", $type, 0); should_fail("3435967", $type, 0); should_fail("34252", $type, 0); should_fail("4365", $type, 0); should_fail("6395", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['383144','253360','99022','503178914','3044','65','577588']}); should_fail("2360970273", $type, 0); should_fail("1229510359", $type, 0); should_fail("4027828735", $type, 0); should_fail("5131048", $type, 0); should_fail("2956850759", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['95667959','252634302','24272511','629494','2239','20054322','356367143','89','738818346','9915']}); should_fail("627887621", $type, 0); should_fail("2473466232", $type, 0); should_fail("2473466232", $type, 0); should_fail("2473466232", $type, 0); should_fail("1911547289", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['1689','917','80','8523258','5050849','1808871','89649934','410760']}); should_fail("4192360433", $type, 0); should_fail("119479023", $type, 0); should_fail("2645499376", $type, 0); should_fail("3252138589", $type, 0); should_fail("4163719111", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['888394','5','59489814','65655','85','4294967295','67788058','20588978','250961411']}); should_fail("1746307776", $type, 0); should_fail("1228359153", $type, 0); should_fail("4225339663", $type, 0); should_fail("1558294678", $type, 0); should_fail("1558294678", $type, 0); done_testing; }; subtest "Type atomic/unsignedInt is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedInt', {'enumeration' => ['649','78','161','3575','2800719','27954','4294967295']}); should_fail("1385287528", $type, 0); should_fail("2035203914", $type, 0); should_fail("2566228164", $type, 0); should_fail("3746628266", $type, 0); should_fail("339657124", $type, 0); done_testing; }; done_testing; 50unsignedLong.t000664001750001750 6776012404317273 15351 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '0'}); should_pass("1", $type, 0); should_pass("579421924029281942", $type, 0); should_pass("219905673220316289", $type, 0); should_pass("825556724778076955", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 853655586043630230." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '853655586043630230'}); should_pass("853655586043630231", $type, 0); should_pass("942139671139083756", $type, 0); should_pass("942175964599979620", $type, 0); should_pass("937601013341671843", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 278671410676320174." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '278671410676320174'}); should_pass("278671410676320175", $type, 0); should_pass("702417656416904009", $type, 0); should_pass("320678524002397993", $type, 0); should_pass("975565089788066280", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 595843373185442780." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '595843373185442780'}); should_pass("595843373185442781", $type, 0); should_pass("953273142321915308", $type, 0); should_pass("817253934811455311", $type, 0); should_pass("983718955254806591", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '999999999999999998'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '0'}); should_pass("0", $type, 0); should_pass("41007894529837773", $type, 0); should_pass("702305597604277131", $type, 0); should_pass("95182362152875343", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 846028599370221122." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '846028599370221122'}); should_pass("846028599370221122", $type, 0); should_pass("858920554078437206", $type, 0); should_pass("868333972315695196", $type, 0); should_pass("854285391376024437", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 842438235652469335." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '842438235652469335'}); should_pass("842438235652469335", $type, 0); should_pass("941589841735488982", $type, 0); should_pass("937796290481633731", $type, 0); should_pass("882381498356502105", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 237916309768272493." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '237916309768272493'}); should_pass("237916309768272493", $type, 0); should_pass("808647780058454955", $type, 0); should_pass("918974327612490334", $type, 0); should_pass("330533892042496564", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '999999999999999999'}); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '1'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 621144438259934594." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '621144438259934594'}); should_pass("0", $type, 0); should_pass("201791954294354993", $type, 0); should_pass("191571782779087926", $type, 0); should_pass("100689026846308507", $type, 0); should_pass("621144438259934593", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 114762413382550444." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '114762413382550444'}); should_pass("0", $type, 0); should_pass("63464628654103891", $type, 0); should_pass("22848637588725746", $type, 0); should_pass("104871003695373474", $type, 0); should_pass("114762413382550443", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 146493734340271798." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '146493734340271798'}); should_pass("0", $type, 0); should_pass("106269794730729926", $type, 0); should_pass("111591154715930884", $type, 0); should_pass("41067703125806682", $type, 0); should_pass("146493734340271797", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '999999999999999999'}); should_pass("0", $type, 0); should_pass("450417699601756592", $type, 0); should_pass("6767563515241548", $type, 0); should_pass("42409174718375575", $type, 0); should_pass("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '0'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 183206970010490244." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '183206970010490244'}); should_pass("0", $type, 0); should_pass("106622141242831681", $type, 0); should_pass("118968621288518129", $type, 0); should_pass("45894558483907457", $type, 0); should_pass("183206970010490244", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 126060676543225391." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '126060676543225391'}); should_pass("0", $type, 0); should_pass("87379499370975988", $type, 0); should_pass("25750459121279535", $type, 0); should_pass("14433512623924316", $type, 0); should_pass("126060676543225391", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 501388613203794019." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '501388613203794019'}); should_pass("0", $type, 0); should_pass("308691166761711236", $type, 0); should_pass("112916681063706516", $type, 0); should_pass("302566782287082417", $type, 0); should_pass("501388613203794019", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 999999999999999999." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '999999999999999999'}); should_pass("0", $type, 0); should_pass("935130467038026934", $type, 0); should_pass("472974001380600860", $type, 0); should_pass("474969679238704811", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('UnsignedLong', {'fractionDigits' => '0'}); should_pass("0", $type, 0); should_pass("163428080161349797", $type, 0); should_pass("968661288039707745", $type, 0); should_pass("666571856464760025", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '1'}); should_pass("5", $type, 0); should_pass("5", $type, 0); should_pass("1", $type, 0); should_pass("5", $type, 0); should_pass("1", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '5'}); should_pass("7", $type, 0); should_pass("12", $type, 0); should_pass("196", $type, 0); should_pass("5786", $type, 0); should_pass("17609", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 9." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '9'}); should_pass("4", $type, 0); should_pass("351", $type, 0); should_pass("23474", $type, 0); should_pass("3788647", $type, 0); should_pass("755984772", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '13'}); should_pass("8", $type, 0); should_pass("1951", $type, 0); should_pass("7799326", $type, 0); should_pass("3329204877", $type, 0); should_pass("3382473510617", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 18." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '18'}); should_pass("1", $type, 0); should_pass("60939", $type, 0); should_pass("353491186", $type, 0); should_pass("4740096172026", $type, 0); should_pass("785697261776857178", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("8", $type, 0); should_pass("8", $type, 0); should_pass("5", $type, 0); should_pass("5", $type, 0); should_pass("5", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("44186", $type, 0); should_pass("48744", $type, 0); should_pass("32321", $type, 0); should_pass("35523", $type, 0); should_pass("85477", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{9}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{9}$)/}); should_pass("357386454", $type, 0); should_pass("428648357", $type, 0); should_pass("644555788", $type, 0); should_pass("495528158", $type, 0); should_pass("699948339", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{13}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{13}$)/}); should_pass("2373271823545", $type, 0); should_pass("2589651918243", $type, 0); should_pass("5147455727632", $type, 0); should_pass("4556844658222", $type, 0); should_pass("5445757533925", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{18}$)/}); should_pass("916127516267662627", $type, 0); should_pass("964523682364156541", $type, 0); should_pass("966625142267332424", $type, 0); should_pass("913784361723264886", $type, 0); should_pass("917217432147464684", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['235157797394','2841737','6246890837920823','502437096339080','475868893660','69228431818957325','16']}); should_pass("475868893660", $type, 0); should_pass("475868893660", $type, 0); should_pass("69228431818957325", $type, 0); should_pass("6246890837920823", $type, 0); should_pass("2841737", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['840115845','2874238170314','355386265673274248','37531498438491484','92597973','320','9340658324154','224645440232296156']}); should_pass("355386265673274248", $type, 0); should_pass("840115845", $type, 0); should_pass("37531498438491484", $type, 0); should_pass("320", $type, 0); should_pass("320", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['760056434','33505897371058979','38','492728752144644066','7037409938820924','51135955','48185','5876730603']}); should_pass("33505897371058979", $type, 0); should_pass("48185", $type, 0); should_pass("48185", $type, 0); should_pass("38", $type, 0); should_pass("51135955", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['10','1737393204819','8333904222','5093784','50511429','602699130']}); should_pass("5093784", $type, 0); should_pass("10", $type, 0); should_pass("1737393204819", $type, 0); should_pass("50511429", $type, 0); should_pass("8333904222", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['47','62233091384207','9211859','81098772','2880505374436178','858510565604495']}); should_pass("858510565604495", $type, 0); should_pass("62233091384207", $type, 0); should_pass("9211859", $type, 0); should_pass("47", $type, 0); should_pass("62233091384207", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('UnsignedLong', {'whiteSpace' => 'collapse'}); should_pass("0", $type, 0); should_pass("515074060769636132", $type, 0); should_pass("636981916365820465", $type, 0); should_pass("671551779918335921", $type, 0); should_pass("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 607303985250778221." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '607303985250778221'}); should_fail("0", $type, 0); should_fail("78776965077975312", $type, 0); should_fail("333626116185448486", $type, 0); should_fail("176760580557294792", $type, 0); should_fail("607303985250778220", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 475565976977797121." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '475565976977797121'}); should_fail("0", $type, 0); should_fail("243057859851789813", $type, 0); should_fail("350287480877992018", $type, 0); should_fail("228617340624930809", $type, 0); should_fail("475565976977797120", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 78231575228674965." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '78231575228674965'}); should_fail("0", $type, 0); should_fail("64436704482788751", $type, 0); should_fail("70479407485482966", $type, 0); should_fail("36771734124550700", $type, 0); should_fail("78231575228674964", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 227623669414460438." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '227623669414460438'}); should_fail("0", $type, 0); should_fail("212874377782275639", $type, 0); should_fail("195872563971949804", $type, 0); should_fail("219070887195480277", $type, 0); should_fail("227623669414460437", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minInclusive with value 999999999999999999." => sub { my $type = mk_type('UnsignedLong', {'minInclusive' => '999999999999999999'}); should_fail("0", $type, 0); should_fail("428678212178694172", $type, 0); should_fail("24363826435765512", $type, 0); should_fail("162032948824023303", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '0'}); should_fail("1", $type, 0); should_fail("378536898276589872", $type, 0); should_fail("940884396243847", $type, 0); should_fail("631245973550001892", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 658823762719767058." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '658823762719767058'}); should_fail("658823762719767059", $type, 0); should_fail("937697798837375450", $type, 0); should_fail("786346002052533289", $type, 0); should_fail("858194201256232558", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 716865919719541721." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '716865919719541721'}); should_fail("716865919719541722", $type, 0); should_fail("957126819824961752", $type, 0); should_fail("881387289577164257", $type, 0); should_fail("939625894887129164", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 456868453150915620." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '456868453150915620'}); should_fail("456868453150915621", $type, 0); should_fail("900842282656852195", $type, 0); should_fail("550194434556833235", $type, 0); should_fail("586332526617090104", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxInclusive with value 988150031519812287." => sub { my $type = mk_type('UnsignedLong', {'maxInclusive' => '988150031519812287'}); should_fail("988150031519812288", $type, 0); should_fail("989538850324977517", $type, 0); should_fail("990718628014227246", $type, 0); should_fail("996605064728778116", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '1'}); should_fail("71", $type, 0); should_fail("832264", $type, 0); should_fail("3620876346", $type, 0); should_fail("53421877661367", $type, 0); should_fail("771132081176184346", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '4'}); should_fail("62708", $type, 0); should_fail("52091547", $type, 0); should_fail("21797978661", $type, 0); should_fail("61362145742181", $type, 0); should_fail("276751123244023818", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 7." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '7'}); should_fail("17624365", $type, 0); should_fail("8895534872", $type, 0); should_fail("712385674179", $type, 0); should_fail("66157908224326", $type, 0); should_fail("216307197451817467", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 10." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '10'}); should_fail("23693737755", $type, 0); should_fail("829142574498", $type, 0); should_fail("3984431563046", $type, 0); should_fail("37945665144127", $type, 0); should_fail("816782121715147780", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet totalDigits with value 13." => sub { my $type = mk_type('UnsignedLong', {'totalDigits' => '13'}); should_fail("41311256703476", $type, 0); should_fail("473130671135359", $type, 0); should_fail("7918868129853453", $type, 0); should_fail("17767433537356947", $type, 0); should_fail("284524557405854053", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '0'}); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 537563135329115037." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '537563135329115037'}); should_fail("0", $type, 0); should_fail("149267670039196492", $type, 0); should_fail("272644907807817373", $type, 0); should_fail("318108153653346079", $type, 0); should_fail("537563135329115037", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 297022948594505064." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '297022948594505064'}); should_fail("0", $type, 0); should_fail("78409358642214020", $type, 0); should_fail("72537417730959616", $type, 0); should_fail("175201384554719027", $type, 0); should_fail("297022948594505064", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 789396117357098912." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '789396117357098912'}); should_fail("0", $type, 0); should_fail("35050767997415899", $type, 0); should_fail("139779438068786013", $type, 0); should_fail("541648064951068808", $type, 0); should_fail("789396117357098912", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet minExclusive with value 999999999999999998." => sub { my $type = mk_type('UnsignedLong', {'minExclusive' => '999999999999999998'}); should_fail("0", $type, 0); should_fail("174557464349445967", $type, 0); should_fail("43446029967720511", $type, 0); should_fail("73036724432510968", $type, 0); should_fail("999999999999999998", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '1'}); should_fail("1", $type, 0); should_fail("710666380484064718", $type, 0); should_fail("848584659967298925", $type, 0); should_fail("291397251626248854", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 237922228245894263." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '237922228245894263'}); should_fail("237922228245894263", $type, 0); should_fail("895682688487357889", $type, 0); should_fail("776950032702901923", $type, 0); should_fail("547019997097664011", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 94265169216393830." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '94265169216393830'}); should_fail("94265169216393830", $type, 0); should_fail("586099638443715153", $type, 0); should_fail("437110086258198767", $type, 0); should_fail("841558355233551889", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 438210007279301816." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '438210007279301816'}); should_fail("438210007279301816", $type, 0); should_fail("616321475942507545", $type, 0); should_fail("747314011206960606", $type, 0); should_fail("733560886475558485", $type, 0); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet maxExclusive with value 999999999999999999." => sub { my $type = mk_type('UnsignedLong', {'maxExclusive' => '999999999999999999'}); should_fail("999999999999999999", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("5735663989573639", $type, 0); should_fail("869", $type, 0); should_fail("45674", $type, 0); should_fail("6485", $type, 0); should_fail("98545644754", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("79299555848824331", $type, 0); should_fail("615", $type, 0); should_fail("87", $type, 0); should_fail("874877689621425", $type, 0); should_fail("324728684982", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{9}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{9}$)/}); should_fail("47686618", $type, 0); should_fail("3532", $type, 0); should_fail("86488", $type, 0); should_fail("57677887556458587", $type, 0); should_fail("56625223858", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{13}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{13}$)/}); should_fail("731645", $type, 0); should_fail("488", $type, 0); should_fail("78", $type, 0); should_fail("4545298", $type, 0); should_fail("8256685967", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet pattern with value \\d{18}." => sub { my $type = mk_type('UnsignedLong', {'pattern' => qr/(?ms:^\d{18}$)/}); should_fail("482", $type, 0); should_fail("427746296", $type, 0); should_fail("56483629", $type, 0); should_fail("4617386", $type, 0); should_fail("15182589862779444", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['7308','4325153467105500','6268632802106','243912','451936956','58']}); should_fail("847636461691905872", $type, 0); should_fail("255989132628767989", $type, 0); should_fail("112195906170641679", $type, 0); should_fail("258011567247514616", $type, 0); should_fail("317350495789223363", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['2164519010239559','872271','9238275371','6932','464535192527820','6820','8017891378905219']}); should_fail("327277750272195299", $type, 0); should_fail("327277750272195299", $type, 0); should_fail("629528569691124139", $type, 0); should_fail("327277750272195299", $type, 0); should_fail("674079386681194602", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['942975980323','161867888670080','206707139691233','40464','41784358560019274','14986736','915079697482']}); should_fail("493755646805543401", $type, 0); should_fail("703130363684031033", $type, 0); should_fail("419931190896128958", $type, 0); should_fail("497867106796829549", $type, 0); should_fail("497867106796829549", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['9181298332184532','84658754203403474','827','2601075','29658436616262884','2632093071072183']}); should_fail("199959556769777946", $type, 0); should_fail("95516130866985959", $type, 0); should_fail("967601475826953437", $type, 0); should_fail("798217836924336453", $type, 0); should_fail("996517474663569878", $type, 0); done_testing; }; subtest "Type atomic/unsignedLong is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedLong', {'enumeration' => ['34048514759406','545128199921885658','66','9323055976172072','5021048514849938','1790','57380694936332','3225725891','13336181','374']}); should_fail("234388474600340401", $type, 0); should_fail("234388474600340401", $type, 0); should_fail("939161833933526034", $type, 0); should_fail("234388474600340401", $type, 0); should_fail("589967306110707245", $type, 0); done_testing; }; done_testing; 50unsignedShort.t000664001750001750 5652512404317273 15546 0ustar00taitai000000000000Types-XSD-0.005/tuse strict; use warnings; use utf8; use Test::More; use Test::TypeTiny; use Types::XSD; sub mk_type { "Types::XSD"->get_type($_[0])->parameterize(%{$_[1]}) } subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '0'}); should_pass("1", $type, 0); should_pass("60599", $type, 0); should_pass("29941", $type, 0); should_pass("7914", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 40528." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '40528'}); should_pass("40529", $type, 0); should_pass("58050", $type, 0); should_pass("58259", $type, 0); should_pass("52022", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 42506." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '42506'}); should_pass("42507", $type, 0); should_pass("60318", $type, 0); should_pass("49883", $type, 0); should_pass("56231", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 909." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '909'}); should_pass("910", $type, 0); should_pass("9903", $type, 0); should_pass("55987", $type, 0); should_pass("48817", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 65534." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '65534'}); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 0." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '0'}); should_pass("0", $type, 0); should_pass("682", $type, 0); should_pass("22318", $type, 0); should_pass("12648", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 57532." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '57532'}); should_pass("57532", $type, 0); should_pass("65510", $type, 0); should_pass("60479", $type, 0); should_pass("64532", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 957." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '957'}); should_pass("957", $type, 0); should_pass("17033", $type, 0); should_pass("13341", $type, 0); should_pass("54459", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 27948." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '27948'}); should_pass("27948", $type, 0); should_pass("28588", $type, 0); should_pass("40398", $type, 0); should_pass("40034", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 65535." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '65535'}); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '1'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 8410." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '8410'}); should_pass("0", $type, 0); should_pass("1562", $type, 0); should_pass("5726", $type, 0); should_pass("608", $type, 0); should_pass("8409", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 64347." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '64347'}); should_pass("0", $type, 0); should_pass("16585", $type, 0); should_pass("51668", $type, 0); should_pass("56497", $type, 0); should_pass("64346", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 43532." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '43532'}); should_pass("0", $type, 0); should_pass("36506", $type, 0); should_pass("30026", $type, 0); should_pass("29076", $type, 0); should_pass("43531", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 65535." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '65535'}); should_pass("0", $type, 0); should_pass("47452", $type, 0); should_pass("64877", $type, 0); should_pass("18765", $type, 0); should_pass("65534", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '0'}); should_pass("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 48200." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '48200'}); should_pass("0", $type, 0); should_pass("42650", $type, 0); should_pass("27539", $type, 0); should_pass("7601", $type, 0); should_pass("48200", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 21008." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '21008'}); should_pass("0", $type, 0); should_pass("3932", $type, 0); should_pass("13434", $type, 0); should_pass("397", $type, 0); should_pass("21008", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 56477." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '56477'}); should_pass("0", $type, 0); should_pass("29538", $type, 0); should_pass("1753", $type, 0); should_pass("172", $type, 0); should_pass("56477", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 65535." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '65535'}); should_pass("0", $type, 0); should_pass("18833", $type, 0); should_pass("38602", $type, 0); should_pass("391", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet fractionDigits with value 0." => sub { my $type = mk_type('UnsignedShort', {'fractionDigits' => '0'}); should_pass("0", $type, 0); should_pass("6747", $type, 0); should_pass("38272", $type, 0); should_pass("59261", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '1'}); should_pass("3", $type, 0); should_pass("2", $type, 0); should_pass("3", $type, 0); should_pass("1", $type, 0); should_pass("6", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '2'}); should_pass("9", $type, 0); should_pass("14", $type, 0); should_pass("2", $type, 0); should_pass("14", $type, 0); should_pass("2", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '3'}); should_pass("5", $type, 0); should_pass("48", $type, 0); should_pass("138", $type, 0); should_pass("8", $type, 0); should_pass("93", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '4'}); should_pass("7", $type, 0); should_pass("23", $type, 0); should_pass("683", $type, 0); should_pass("7638", $type, 0); should_pass("5", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 5." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '5'}); should_pass("5", $type, 0); should_pass("89", $type, 0); should_pass("519", $type, 0); should_pass("4769", $type, 0); should_pass("36744", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{1}$)/}); should_pass("3", $type, 0); should_pass("3", $type, 0); should_pass("4", $type, 0); should_pass("4", $type, 0); should_pass("5", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{2}$)/}); should_pass("13", $type, 0); should_pass("79", $type, 0); should_pass("21", $type, 0); should_pass("33", $type, 0); should_pass("38", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{3}$)/}); should_pass("426", $type, 0); should_pass("375", $type, 0); should_pass("768", $type, 0); should_pass("927", $type, 0); should_pass("397", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{4}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{4}$)/}); should_pass("8774", $type, 0); should_pass("6476", $type, 0); should_pass("7578", $type, 0); should_pass("8532", $type, 0); should_pass("8142", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{5}$)/}); should_pass("61213", $type, 0); should_pass("62223", $type, 0); should_pass("62314", $type, 0); should_pass("61324", $type, 0); should_pass("62324", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['603','121','51760','65535','357','272','570','28']}); should_pass("272", $type, 0); should_pass("65535", $type, 0); should_pass("603", $type, 0); should_pass("272", $type, 0); should_pass("570", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['9294','4614','296','7','30','67']}); should_pass("30", $type, 0); should_pass("30", $type, 0); should_pass("7", $type, 0); should_pass("9294", $type, 0); should_pass("67", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['58929','12','4','2521','3449','1963','6997','609']}); should_pass("1963", $type, 0); should_pass("2521", $type, 0); should_pass("12", $type, 0); should_pass("58929", $type, 0); should_pass("6997", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['3331','794','91','5792','5361','72','1768','37','464']}); should_pass("72", $type, 0); should_pass("5361", $type, 0); should_pass("1768", $type, 0); should_pass("72", $type, 0); should_pass("794", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['3386','700','1','2341','65535','88','3784','870']}); should_pass("1", $type, 0); should_pass("88", $type, 0); should_pass("2341", $type, 0); should_pass("3784", $type, 0); should_pass("870", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet whiteSpace with value collapse." => sub { my $type = mk_type('UnsignedShort', {'whiteSpace' => 'collapse'}); should_pass("0", $type, 0); should_pass("8388", $type, 0); should_pass("3715", $type, 0); should_pass("11321", $type, 0); should_pass("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 34783." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '34783'}); should_fail("0", $type, 0); should_fail("11617", $type, 0); should_fail("22743", $type, 0); should_fail("844", $type, 0); should_fail("34782", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 3790." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '3790'}); should_fail("0", $type, 0); should_fail("1600", $type, 0); should_fail("483", $type, 0); should_fail("459", $type, 0); should_fail("3789", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 38462." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '38462'}); should_fail("0", $type, 0); should_fail("32823", $type, 0); should_fail("16049", $type, 0); should_fail("8155", $type, 0); should_fail("38461", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 5951." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '5951'}); should_fail("0", $type, 0); should_fail("3365", $type, 0); should_fail("2685", $type, 0); should_fail("681", $type, 0); should_fail("5950", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minInclusive with value 65535." => sub { my $type = mk_type('UnsignedShort', {'minInclusive' => '65535'}); should_fail("0", $type, 0); should_fail("51880", $type, 0); should_fail("58412", $type, 0); should_fail("11545", $type, 0); should_fail("65534", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 0." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '0'}); should_fail("1", $type, 0); should_fail("38371", $type, 0); should_fail("18297", $type, 0); should_fail("6389", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 48934." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '48934'}); should_fail("48935", $type, 0); should_fail("61089", $type, 0); should_fail("63415", $type, 0); should_fail("49623", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 2825." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '2825'}); should_fail("2826", $type, 0); should_fail("60219", $type, 0); should_fail("3218", $type, 0); should_fail("37938", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 65125." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '65125'}); should_fail("65126", $type, 0); should_fail("65317", $type, 0); should_fail("65385", $type, 0); should_fail("65355", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxInclusive with value 10406." => sub { my $type = mk_type('UnsignedShort', {'maxInclusive' => '10406'}); should_fail("10407", $type, 0); should_fail("10624", $type, 0); should_fail("63037", $type, 0); should_fail("36430", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 1." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '1'}); should_fail("31", $type, 0); should_fail("867", $type, 0); should_fail("2657", $type, 0); should_fail("28578", $type, 0); should_fail("72", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 2." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '2'}); should_fail("856", $type, 0); should_fail("3781", $type, 0); should_fail("17128", $type, 0); should_fail("989", $type, 0); should_fail("1262", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 3." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '3'}); should_fail("5657", $type, 0); should_fail("33010", $type, 0); should_fail("9302", $type, 0); should_fail("54666", $type, 0); should_fail("8783", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet totalDigits with value 4." => sub { my $type = mk_type('UnsignedShort', {'totalDigits' => '4'}); should_fail("64754", $type, 0); should_fail("43975", $type, 0); should_fail("38842", $type, 0); should_fail("27812", $type, 0); should_fail("48740", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 0." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '0'}); should_fail("0", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 32874." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '32874'}); should_fail("0", $type, 0); should_fail("8315", $type, 0); should_fail("1494", $type, 0); should_fail("26771", $type, 0); should_fail("32874", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 52307." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '52307'}); should_fail("0", $type, 0); should_fail("17019", $type, 0); should_fail("47976", $type, 0); should_fail("51235", $type, 0); should_fail("52307", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 1078." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '1078'}); should_fail("0", $type, 0); should_fail("658", $type, 0); should_fail("159", $type, 0); should_fail("548", $type, 0); should_fail("1078", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet minExclusive with value 65534." => sub { my $type = mk_type('UnsignedShort', {'minExclusive' => '65534'}); should_fail("0", $type, 0); should_fail("20499", $type, 0); should_fail("6193", $type, 0); should_fail("48976", $type, 0); should_fail("65534", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 1." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '1'}); should_fail("1", $type, 0); should_fail("57138", $type, 0); should_fail("21058", $type, 0); should_fail("60680", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 51084." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '51084'}); should_fail("51084", $type, 0); should_fail("61302", $type, 0); should_fail("53499", $type, 0); should_fail("56872", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 24084." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '24084'}); should_fail("24084", $type, 0); should_fail("41115", $type, 0); should_fail("62818", $type, 0); should_fail("61052", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 33466." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '33466'}); should_fail("33466", $type, 0); should_fail("41042", $type, 0); should_fail("34745", $type, 0); should_fail("49171", $type, 0); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet maxExclusive with value 65535." => sub { my $type = mk_type('UnsignedShort', {'maxExclusive' => '65535'}); should_fail("65535", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{1}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{1}$)/}); should_fail("3416", $type, 0); should_fail("3949", $type, 0); should_fail("336", $type, 0); should_fail("3947", $type, 0); should_fail("7853", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{2}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{2}$)/}); should_fail("64421", $type, 0); should_fail("936", $type, 0); should_fail("7", $type, 0); should_fail("138", $type, 0); should_fail("5241", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{3}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{3}$)/}); should_fail("2", $type, 0); should_fail("62124", $type, 0); should_fail("7", $type, 0); should_fail("3", $type, 0); should_fail("4475", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{4}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{4}$)/}); should_fail("369", $type, 0); should_fail("62312", $type, 0); should_fail("67", $type, 0); should_fail("38", $type, 0); should_fail("67", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet pattern with value \\d{5}." => sub { my $type = mk_type('UnsignedShort', {'pattern' => qr/(?ms:^\d{5}$)/}); should_fail("855", $type, 0); should_fail("7577", $type, 0); should_fail("6589", $type, 0); should_fail("23", $type, 0); should_fail("946", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['310','49655','2781','23','12','8314']}); should_fail("50490", $type, 0); should_fail("51650", $type, 0); should_fail("50490", $type, 0); should_fail("30382", $type, 0); should_fail("30202", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['265','9','920','7','291','8068','4053','22','955','9249']}); should_fail("16296", $type, 0); should_fail("23916", $type, 0); should_fail("47521", $type, 0); should_fail("7648", $type, 0); should_fail("24149", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['1191','2','8','441','3200','1449']}); should_fail("43284", $type, 0); should_fail("61880", $type, 0); should_fail("28982", $type, 0); should_fail("58692", $type, 0); should_fail("23002", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['7','399','65535','64','36379','56']}); should_fail("27298", $type, 0); should_fail("18770", $type, 0); should_fail("11640", $type, 0); should_fail("33210", $type, 0); should_fail("14191", $type, 0); done_testing; }; subtest "Type atomic/unsignedShort is restricted by facet enumeration." => sub { my $type = mk_type('UnsignedShort', {'enumeration' => ['199','534','4255','81','6560','13','3451','388','5311']}); should_fail("65535", $type, 0); should_fail("48492", $type, 0); should_fail("53156", $type, 0); should_fail("63266", $type, 0); should_fail("31363", $type, 0); done_testing; }; done_testing; XSD.pm000664001750001750 4753412404317273 14763 0ustar00taitai000000000000Types-XSD-0.005/lib/Typespackage Types::XSD; use 5.008003; use strict; use warnings; use utf8; BEGIN { $Types::XSD::AUTHORITY = 'cpan:TOBYINK'; $Types::XSD::VERSION = '0.005'; } use B qw(perlstring); use Carp; use DateTimeX::Auto qw( dt dur ); use DateTime::Incomplete (); use Type::Utils; use Type::Library -base, -declare => qw( Name NmToken NmTokens NCName Id IdRef IdRefs Entity Entities QName Notation Duration DateTime Time Date GYearMonth GYear GMonthDay GDay GMonth DateTimeStamp YearMonthDuration DayTimeDuration ); use Types::Standard; use Types::XSD::Lite 0.003 (); use XML::RegExp; our @EXPORT_OK = qw( dt_cmp dur_cmp dt_parse dur_parse ); BEGIN { Type::Utils::extends('Types::XSD::Lite'); *create_range_check = \&Types::XSD::Lite::create_range_check; *quick_range_check = \&Types::XSD::Lite::quick_range_check; *hex_length = \&Types::XSD::Lite::hex_length; *b64_length = \&Types::XSD::Lite::b64_length; *facet = \&Types::XSD::Lite::facet; }; use constant MAGIC_DATES => map dt($_), qw( 1696-09-01 1697-02-01 1903-03-01 1903-07-01 ); use constant MAGIC_TABLE => +{ "-1-1-1-1" => -1, "0000" => 0, "1111" => 1 }; sub dur_cmp { my @durations = map ref($_) ? $_ : dur($_), @_[0,1]; my $result = join q[], map "DateTime::Duration"->compare(@durations, $_), MAGIC_DATES; return MAGIC_TABLE->{$result} if exists MAGIC_TABLE->{$result}; return undef; } our @patterns; my $pattern_i = -1; our @assertions; my $assertion_i = -1; my %facets = ( explicitTimezone => sub { my ($o, $var) = @_; return unless exists $o->{explicitTimezone}; my $etz = delete $o->{explicitTimezone}; return sprintf('%s =~ m/(?:Z|(?:[+-]\d{2}:?\d{2}))$/xism', $var) if lc($etz) eq 'required'; return sprintf('%s !~ m/(?:Z|(?:[+-]\d{2}:?\d{2}))$/xism', $var) if lc($etz) eq 'prohibited'; return '!!1' if lc($etz) eq 'optional'; croak "explicitTimezone facet expected to be 'required', 'prohibited' or 'optional'" }, maxInclusiveDuration => sub { my ($o, $var) = @_; return unless exists $o->{maxInclusive}; sprintf('(Types::XSD::dur_cmp(%s, %s)||0) <= 0', $var, perlstring delete $o->{maxInclusive}); }, minInclusiveDuration => sub { my ($o, $var) = @_; return unless exists $o->{minInclusive}; sprintf('(Types::XSD::dur_cmp(%s, %s)||0) >= 0', $var, perlstring delete $o->{minInclusive}); }, maxExclusiveDuration => sub { my ($o, $var) = @_; return unless exists $o->{maxExclusive}; sprintf('(Types::XSD::dur_cmp(%s, %s)||0) < 0', $var, perlstring delete $o->{maxExclusive}); }, minExclusiveDuration => sub { my ($o, $var) = @_; return unless exists $o->{minExclusive}; sprintf('(Types::XSD::dur_cmp(%s, %s)||0) > 0', $var, perlstring delete $o->{minExclusive}); }, maxInclusiveDT => sub { my ($o, $var) = @_; return unless exists $o->{maxInclusive}; sprintf('(Types::XSD::dt_cmp(%s, %s, %s)||0) <= 0', perlstring($Types::XSD::Lite::T), $var, perlstring delete $o->{maxInclusive}); }, minInclusiveDT => sub { my ($o, $var) = @_; return unless exists $o->{minInclusive}; sprintf('(Types::XSD::dt_cmp(%s, %s, %s)||0) >= 0', perlstring($Types::XSD::Lite::T), $var, perlstring delete $o->{minInclusive}); }, maxExclusiveDT => sub { my ($o, $var) = @_; return unless exists $o->{maxExclusive}; sprintf('(Types::XSD::dt_cmp(%s, %s, %s)||0) < 0', perlstring($Types::XSD::Lite::T), $var, perlstring delete $o->{maxExclusive}); }, minExclusiveDT => sub { my ($o, $var) = @_; return unless exists $o->{minExclusive}; sprintf('(Types::XSD::dt_cmp(%s, %s, %s)||0) > 0', perlstring($Types::XSD::Lite::T), $var, perlstring delete $o->{minExclusive}); }, ); $Types::XSD::Lite::facets{$_} = $facets{$_} for keys %facets; our @dtarr; my $i = -1; our $base_datetime = "DateTime"->new(year => 2000, month => 1, day => 1); # leap year, 31 day month our %dt_regexps; sub dt_maker { my ($name, $regexp, @fields) = @_; my $j = ++$i; $dtarr[$j] = $regexp; my $inlined = sub { my $var = $_[1]; my @code; push @code, "do { my \$ok = 1;"; push @code, sprintf( 'my (%s) = (%s =~ $Types::XSD::dtarr[%d]) or --$ok;', join(', ', map "\$$_", @fields), $var, $j, ); push @code, sprintf( '$ok and eval { "DateTime::Incomplete"->new(%s)->to_datetime(base => $Types::XSD::base_datetime) };', join(', ', map "$_ => \$$_", @fields), ); push @code, "}"; "@code"; }; my $type = "Type::Tiny"->new( name => $name, library => __PACKAGE__, constraint => eval sprintf('sub { %s }', $inlined->(undef, '$_')), inlined => $inlined, ); __PACKAGE__->add_type($type); facet( qw( pattern whiteSpace enumeration maxInclusiveDT maxExclusiveDT minInclusiveDT minExclusiveDT explicitTimezone ), $type, ); $dt_regexps{$type} = [$regexp, @fields]; } sub dt_parse { my ($type, $a) = @_; my ($re, @fields) = @{ $dt_regexps{$type} }; my %d; @d{@fields} = ($a =~ $re); !defined($d{$_}) && delete($d{$_}) for @fields; "DateTime::Incomplete"->new(%d); } sub dur_parse { goto \&DateTimeX::Auto::dur; } { my %cache; sub _detect_type { my ($lib, $v) = @_; for my $type (qw(DateTime Time Date GYearMonth GYear GMonthDay GDay GMonth)) { return $type if $lib->get_type($type)->check($v); } return $lib->get_type('DateTime'); } sub dt_cmp { my ($type, $a, $b) = @_; $type = __PACKAGE__->_detect_type($a) unless $type; $type = __PACKAGE__->get_type($type) unless ref $type; my $A = eval($cache{"$type;a"} ||= $type->inline_check('$a')); my $B = eval($cache{"$type;b"} ||= $type->inline_check('$b')); $A <=> $B; } } facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare Name, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::Name)$}sm]; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare NmToken, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::NmToken)$}sm]; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare NmTokens, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::NmToken)(?:\s+$XML::RegExp::NmToken)*$}sm]; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare NCName, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::NCName)$}sm]; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare Id, as NCName; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare IdRef, as NCName; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare IdRefs, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::NCName)(?:\s+$XML::RegExp::NCName)*$}sm]; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare Entity, as NCName; facet qw( length minLength maxLength pattern enumeration whiteSpace ), declare Entities, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::NCName)(?:\s+$XML::RegExp::NCName)*$}sm]; facet qw( lengthQName minLengthQName maxLengthQName pattern enumeration whiteSpace ), declare QName, as Types::Standard::StrMatch[qr{^(?:$XML::RegExp::QName)$}sm]; facet qw( lengthQName minLengthQName maxLengthQName pattern enumeration whiteSpace ), declare Notation, as QName; facet qw( pattern whiteSpace enumeration maxInclusiveDuration maxExclusiveDuration minInclusiveDuration minExclusiveDuration ), declare Duration, as Types::Standard::StrMatch[ qr{^-?P (?:[0-9]+Y)? (?:[0-9]+M)? (?:[0-9]+D)? (?:T (?:[0-9]+H)? (?:[0-9]+M)? (?:[0-9]+(?:\.[0-9]+)?S)? )? $}xism ]; facet qw( pattern whiteSpace enumeration maxInclusiveDuration maxExclusiveDuration minInclusiveDuration minExclusiveDuration ), declare YearMonthDuration, as Duration->parameterize(pattern => qr{^[^DT]*$}i); facet qw( pattern whiteSpace enumeration maxInclusiveDuration maxExclusiveDuration minInclusiveDuration minExclusiveDuration ), declare DayTimeDuration, as Duration->parameterize(pattern => qr{^[^YM]*[DT].*$}i); dt_maker( DateTime => qr{^ (-?[0-9]{4,}) - ([0-9]{2}) - ([0-9]{2}) T ([0-9]{2}) : ([0-9]{2}) : ([0-9]{2}(?:\.[0-9]+)?) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( year month day hour minute second time_zone ), ); dt_maker( DateTimeStamp => qr{^ (-?[0-9]{4,}) - ([0-9]{2}) - ([0-9]{2}) T ([0-9]{2}) : ([0-9]{2}) : ([0-9]{2}(?:\.[0-9]+)?) (Z | (?: [+-]\d{2}:?\d{2} )) $}xism, qw( year month day hour minute second time_zone ), ); dt_maker( Time => qr{^ ([0-9]{2}) : ([0-9]{2}) : ([0-9]{2}(?:\.[0-9]+)?) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( hour minute second time_zone ), ); dt_maker( Date => qr{^ (-?[0-9]{4,}) - ([0-9]{2}) - ([0-9]{2}) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( year month day time_zone ), ); dt_maker( GYearMonth => qr{^ (-?[0-9]{4,}) - ([0-9]{2}) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( year month time_zone ), ); dt_maker( GYear => qr{^ (-?[0-9]{4,}) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( year time_zone ), ); dt_maker( GMonthDay => qr{^ - - ([0-9]{2}) - ([0-9]{2}) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( month day time_zone ), ); dt_maker( GDay => qr{^ - - - ([0-9]{2}) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( day time_zone ), ); dt_maker( GMonth => qr{^ - - ([0-9]{2}) (Z | (?: [+-]\d{2}:?\d{2} ))? $}xism, qw( month time_zone ), ); 1; __END__ =pod =encoding utf-8 =head1 NAME Types::XSD - type constraints based on XML schema datatypes =head1 SYNOPSIS package Person; use Moo; use Types::XSD::Lite qw( PositiveInteger String ); has name => (is => "ro", isa => String[ minLength => 1 ]); has age => (is => "ro", isa => PositiveInteger); =head1 DESCRIPTION Types::XSD is a type constraint library inspired by XML Schema, and built with L. It can be used as a type constraint library for L, L or L, or used completely independently of any OO framework. This module is an extension of L which has fewer type constraints, but fewer dependencies. For completeness, the type constraints and other features inherited from Types::XSD::Lite are documented below too. =head2 Type Constraints This module defines the following type constraints based on the data types defined in L. (The names of the type constraints are the same as the XML Schema data types, but capitalization often differs.) I've added some quick explainations of what each type is, but for details, see the XML Schema specification. =over =item C<< AnyType >> As per C from L. =item C<< AnySimpleType >> As per C from L. =item C<< String >> As per C from L. =item C<< NormalizedString >> A string containing no line breaks, carriage returns or tabs. =item C<< Token >> Like C, but also no leading or trailing space, and no doubled spaces (i.e. not C<< /\s{2,}/ >>). =item C<< Language >> An RFC 3066 language code. =item C<< Name >> Something that could be a valid XML element or attribute name. These roughly correspond to Perl identifiers but may also contain colons, hyphens and stops. (Digits, hyphens and stops are not allowed as the first character.) =item C<< NmToken >> Slightly looser version of C; allows digits, hyphens and stops in the first character. =item C<< NmTokens >> Space-separated list of C. =item C<< NCName >> Slightly tighter vesion of C; disallows colons. =item C<< Id >> Effectively the same as C. =item C<< IdRef >> Effectively the same as C. =item C<< IdRefs >> Space-separated list of C. =item C<< Entity >> Effectively the same as C. =item C<< Entities >> Space-separated list of C. =item C<< Boolean >> Allows C<< "true" >>, C<< "false" >>, C<< "1" >> and C<< "0" >> (case-insensitively). Gotcha: The string C<< "false" >> evaluates to true in Perl. You probably want to use C<< Bool >> from L instead. =item C<< Base64Binary >> Strings which are valid Base64 data. Allows whitespace. Gotcha: If you parameterize this with C, C or C, it is the length of the I string which will be checked. =item C<< HexBinary >> Strings which are valid hexadecimal data. Disallows whitespace; disallows leading C<< 0x >>. Gotcha: If you parameterize this with C, C or C, it is the length of the I string which will be checked. =item C<< Float >> As per C from L. =item C<< Double >> As per C from L. =item C<< AnyURI >> Any absolute I<< or relative >> URI. Effectively, any string at all! =item C<< QName >> An XML QName; something that could be used as a valid element name in a namespaced XML document. Gotcha: while C, C and C are allowed facets for parameterization, they are silently ignored, as per the specification! =item C<< Notation >> Effectively the same as C. According to XML Schema, this is I supposed to be parameterized with an enumeration. But we don't enforce that. Gotcha: while C, C and C are allowed facets for parameterization, they are silently ignored, as per the specification! =item C<< Decimal >> Numbers possibly including a decimal point, but not allowing exponential notation (e.g. C<< "3.14e-3" >>). =item C<< Integer >> As per C from L. =item C<< NonPositiveInteger >> An C 0 or below. =item C<< NegativeInteger >> An C -1 or below. =item C<< Long >> An C between -9223372036854775808 and 9223372036854775807 (inclusive). =item C<< Int >> An C between -2147483648 and 2147483647 (inclusive). =item C<< Short >> An C between -32768 and 32767 (inclusive). =item C<< Byte >> An C between -128 and 127 (inclusive). =item C<< NonNegativeInteger >> An C 0 or above. =item C<< PositiveInteger >> An C 1 or above. =item C<< UnsignedLong >> A C between 0 and 18446744073709551615 (inclusive). =item C<< UnsignedInt >> A C between 0 and 4294967295 (inclusive). =item C<< UnsignedShort >> A C between 0 and 65535 (inclusive). =item C<< UnsignedByte >> A C between 0 and 255 (inclusive). =item C<< Duration >> An ISO 8601 duration. =item C<< YearMonthDuration >> An ISO 8601 duration restricted to cover only years and months. =item C<< DayTimeDuration >> An ISO 8601 duration restricted to cover only days, hours, minutes and seconds. (Note that this still permits durations of many years, as the days component is an arbitrary non-negative integer.) =item C<< DateTime >> An ISO 8601 datetime with optional timezone. =item C<< DateTimeStamp >> An ISO 8601 datetime with required timezone. =item C<< Time >> An ISO 8601 time with optional timezone. =item C<< Date >> An ISO 8601 date with optional timezone. =item C<< GYearMonth >> An year-month pair with optional timezone. =item C<< GYear >> An year with optional timezone. =item C<< GMonthDay >> An month-day pair with optional timezone. =item C<< GDay >> An day with optional timezone. =item C<< GMonth >> An month with optional timezone. =back =head2 Parameters Datatypes can be parameterized using the facets defined by XML Schema. For example: use Types::XSD::Lite qw( String Decimal PositiveInteger Token ); my @sizes = qw( XS S M L XL XXL ); has name => (is => "ro", isa => String[ minLength => 1 ]); has price => (is => "ro", isa => Decimal[ fractionDigits => 2 ]); has rating => (is => "ro", isa => PositiveInteger[ maxInclusive => 5 ]); has size => (is => "ro", isa => Token[ enumeration => \@sizes ]); The following facets exist, but not all facets are supported for all datatypes. (The module will croak if you try to use an unsupported facet.) =over =item C<< enumeration >> An arrayref of allowable values. You should probably use L instead. =item C<< pattern >> A regular expression that the value is expected to conform to. Use a normal Perl quoted regexp: Token[ pattern => qr{^[a-z]+$} ] =item C<< whiteSpace >> The C facet is ignored as I'm not entirely sure what it should do. It perhaps makes sense for coercions, but this module doesn't define any coercions. =item C<< assertions >> An arrayref of arbitrary additional restrictions, expressed as strings of Perl code or coderefs operating on C<< $_ >>. For example: Integer[ assertions => [ '$_ % 3 == 0', # multiple of three, and... sub { is_nice($_) }, # is nice (whatever that means) ], ], Strings of Perl code will result in faster-running type constraints. =item C<< length >>, C<< maxLength >>, C<< minLength >> Restrict the length of a value. For example C<< Integer[length=>2] >> allows C<10>, C<99> and C<-1>, but not C<100>, C<9> or C<-10>. Types::XSD won't prevent you from making ridiculous constraints such as C<< String[ maxLength => 1, minLength => 2 ] >>. Note that on C and C types, the lengths apply to the decoded string. Length restrictions are silently ignored for C and C because the W3C doesn't think you should care what length these datatypes are. =item C<< maxInclusive >>, C<< minInclusive >>, C<< maxExclusive >>, C<< minExclusive >> Supported for numeric types and datetime/duration-related types. Note that to be super-correct, the C<< {max,min}{Inclusive,Exclusive} >> facets for numeric types are performed by passing the numbers through L or L, so may be a little slow. =item C<< totalDigits >> For a decimal (or type derived from decimals) specifies that the total number of digits for the value must be at most this number. Given C<< Decimal[ totalDigits => 3 ] >>, C<1.23>, C<12.3>, C<123>, C<1.2> and C<1> are all allowable; C<1.234> is not. C<1.230> is also not, but this may change in a future version. =item C<< fractionDigits >> Like C but ignores digits before the decimal point. =item C<< explicitTimezone >> May be C<< "optional" >>, C<< "prohibited" >> or C<< "required" >>. For example: Time[ explicitTimezone => "prohibited" ] =back =head2 Functions This module also exports some convenience functions: =over =item C<< dur_parse($str) >> Parse an xsd:duration string, returning a L. =item C<< dur_cmp($a, $b) >> Compare two strings conforming to the xsd:duration datatype to indicate which is the longer duration. Returns -1 if $a is shorter. Returns 1 if $b is shorter. Returns 0 if the durations are identical. Returns undef if the comparison is indeterminate; for example, "P1Y" (one year) and "P365D" (365 days) are not necessarily identical - in leap years "P365D" is shorter. =item C<< dt_cmp($type, $a, $b) >> Compare two datetime-like strings. For example, two C strings can be compared using: dt_cmp(GYearMonth, "2009-02", "2010-10"); Both strings are expected to conform to the same datatype. It doesn't make much sense to compare them otherwise. =item C<< dt_parse($type, $str) >> Parse a datetime-like string, returning a L object. Note that L objects are always returned, even if the datetime is potentially complete. =back =head1 BUGS Please report any bugs to L. =head1 SEE ALSO L, L, L. =over =item * L Datatypes in XML Schema 1.0 =item * L Datatypes in XML Schema 1.1 =back =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2013-2014 by Toby Inkster. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =head1 DISCLAIMER OF WARRANTIES THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.