diff -Nru libtype-tiny-perl-1.000005/Changes libtype-tiny-perl-1.004004/Changes --- libtype-tiny-perl-1.000005/Changes 2014-10-25 19:05:48.000000000 +0000 +++ libtype-tiny-perl-1.004004/Changes 2019-01-08 18:26:37.000000000 +0000 @@ -6,6 +6,472 @@ Bug tracker: Maintainer: Toby Inkster (TOBYINK) +1.004004 2019-01-08 + + [ Bug Fixes ] + - Depend on Exporter::Tiny 0.040; older versions don't provide all the + functions Type::Library needs. + +1.004003 2019-01-08 + + [ Bug Fixes ] + - Fix spelling in error message for Types::Common::String + LowerCaseSimpleStr. + Robert Rothenberg++ + + + [ Documentation ] + - Fix Type::Params documentation error. + Nelo Onyiah++ + + - Fix Types::Standard documentation error: incorrect third-party module + name. + Nelo Onyiah++ + + +1.004002 2018-07-29 + + [ Bug Fixes ] + - Skip one particular test on old versions of Moo because it relies on a + feature introduced in Moo 1.004000. + Fixes RT#125948. + + +1.004001 2018-07-28 + + [ Bug Fixes ] + - Add Eval::TypeTiny::Sandbox to the list of packages which should be + skipped as internal by Error::TypeTiny, as it was mistakenly removed in + 1.003_008. + Fixes RT#125942. + + + [ Documentation ] + - Correct release date of 1.004000 in change log. + +1.004000 2018-07-27 + + [ Documentation ] + - Update NEWS. + - Update TODO. + + [ Packaging ] + - Repackage as a stable release. No functional changes since 1.003_010. + +1.003_010 2018-07-25 + + [ Test Suite ] + - Improve test coverage for Type::Utils, Type::Coercion, + Types::Standard::Tuple, Eval::TypeTiny, Type::Registry, + Type::Tiny::Class, and Types::Standard::Tied. + +1.003_009 2018-07-24 + + [ Documentation ] + - Better documentation of parameterization API. + + [ Test Suite ] + - Improve testing of Test::TypeTiny itself; the matchfor() function in + particular. + - Test bad parameters to NumRange and IntRange. + - Test late loading of Sub::Quote. + + [ Other ] + - Types::Standard::Defined->complementary_type will now return + Types::Standard::Undef, and vice versa. + +1.003_008 2018-07-16 + + [ REGRESSIONS ] + - Make Error::TypeTiny aware of some newer internal modules. + + [ Bug Fixes ] + - Fix error messages generating deep explanations of some parameterized + types. + Fixes RT#125765. + KB Jørgensen++ + + + [ Test Suite ] + - Improve test coverage. + - Test Type::Utils' match_on_type's support for wantarray on strings of + code. + + [ Other ] + - Improve processing of parameters to Types::Standard's parameterized type + constraints + - Simplify how Type::Registry generates the `t()` function. + - Split out some code from Types::Standard into autoloaded modules to + speed up loading. + - Types::Common::Numeric's IntRange and NumRange do better checking of + parameters. + - Types::Common::String's StrLength does better checking of parameters. + +1.003_007 2018-07-12 + + [ Test Suite ] + - Add tests for deep coercions in Tuples. + - Better tests for Eval::TypeTiny's implementations of alias=>1. + - Improve coverage. + - Restructure Types::TypeTiny test cases so more of them run when Moose + and Mouse aren't available. + + [ Other ] + - Added: Eval::TypeTiny now supports PadWalker as a fallback + implementation of alias => 1. + - Added: Eval::TypeTiny provides a collection of constants to indicate the + current implementation of alias => 1. + - Eval::TypeTiny will now throw errors when it detects a mismatch between + sigils and reference types in the environment hashref but only if + EXTENDED_TESTING environment variable is true. Perl will probably give + you its own error message for this later on anyway. + - Improve progressive exporter in Types::TypeTiny to avoid loading + Exporter::TypeTiny more often. + - Removed: Eval::TypeTiny::HAS_LEXICAL_VARS constant is no longer + documented and will be removed at a later date. + - Types::Standard does better at checking the parameters of parameterized + types are valid. + - Updated: Eval::TypeTiny now supports Perl 5.22 refaliasing as the + preferred implementation of alias => 1. + +1.003_006 2018-07-08 + + [ Bug Fixes ] + - Fix issues with arrayref and hashref defaults in Type::Params. + - Workaround for Regexp-based check for Int clobbering $1 sometimes (this + will sometimes slow down Int checks a little, but is needed for + correctness). + Fixes RT#125132. + + + [ Documentation ] + - Better documentation of environment variables. + - Type::Params caller_level option is now documented. + + [ Test Suite ] + - Improve coverage. + + [ Other ] + - Added: PERL_TYPE_PARAMS_XS environment variable. + - Added: Type::Params compile/compile_named now have subname and + description options. + +1.003_005 2018-07-05 + + [ Documentation ] + - Type::Tiny::Manual::Coercions improvements. + Fixes RT#122305. + + + [ Other ] + - Added: Allow type libraries to mark certain type constraints as + deprecated. + Fixes RT#124728. + + +1.003_004 2018-06-12 + + [ Bug Fixes ] + - Load modules with `use` instead of `require` in 00-begin.t. + Fixes RT#124067. + Andreas J König++ + Slaven Rezić++ + + +1.003_003 2018-06-10 + + [ BACK COMPAT ] + - Bool (Types::Standard) is stricter, no longer allowing blessed objects + that overload stringification because that's weird. + + [ Other ] + - Added: Bool now allows coercion from Any. + +1.003_002 2018-05-28 + + - Added: Types::Common::Numeric now has NumRange and IntRange types. + - Added: Types::Common::String now has a StrLength type. + +1.003_001 2018-05-22 + + [ Test Suite ] + - Tests for coercions to CycleTuple from Types::Standard with + non-inlineable type constraints. + + [ Other ] + - Don't use Type::Tiny::XS's implementation of Bool in Types::Standard + unless Type::Tiny::XS >= 0.014. + - Looser definition of FileHandle in Types::Standard. + Fixes RT#121762. + + +1.003_000 2018-05-20 + + [ Bug Fixes ] + - Compatibility with constants and with CV-in-stash optimisation. + Fixes RT#123408. + + + [ Documentation ] + - Add a new CONTRIBUTING.pod file. + - Document Type::Library's :coercion export tag. + Diab Jerius++ + - Fix typo. + Philippe Bruhat++ + - Improvements to Type::Params documentation. + + [ Test Suite ] + - Skip t/30-integration/Moose/native-attribute-traits.t on older Moose + because Test::Moose is broken. + + [ Packaging ] + - Ref::Util::XS 0.100 should be recommended, not 0.200 (which doesn't + exist yet). + Fixes RT#121981. + + + [ Other ] + - Added: Allow Type::Coercion's add_type_coercion to accept a + Type::Coercion object, which was already documented as working. + Diab Jerius++ + - Added: Type::Params compile_named now supports bless/class/constructor + options. + - Added: Type::Params now exports a compile_named_oo function which + returns a parameters object. + - Added: Type::Params now supports parameter defaults. + - Don't use Type::Tiny::XS's implementation of PositiveInt in + Types::Common::Numeric unless Type::Tiny::XS >= 0.013. + +1.002001 2017-06-08 + + [ Test Suite ] + - Skip t/30-integration/Moose/native-attribute-traits.t on older Moose + because Test::Moose is broken. + + [ Packaging ] + - Ref::Util::XS 0.100 should be recommended, not 0.200 (which doesn't + exist yet). + Fixes RT#121981. + + +1.002000 2017-06-01 + + [ Packaging ] + - Stable version number. + +1.001_016 2017-05-30 + + [ Documentation ] + - Include page-numbers.pl example + +1.001_015 2017-05-20 + + [ Bug Fixes ] + - Fix HashRef[Str]|Undef|Str parsing on Perl < 5.14. + Fixes RT#121764. + Aran Clary Deltac++ + Graham Knop++ + + +1.001_014 2017-05-19 + + - Include trailing line break at the end of stringified version of some + exceptions. + Peter Valdemar Mørch++ + +1.001_013 2017-05-18 Kittiversary + + [ Bug Fixes ] + - Fixed crazy amount of UTF-8 warnings from Type::Params on Perl 5.6.x and + Perl 5.8.x. + Fixes RT#101582. + André Walker++ + + + - StrMatch changes in previous release broke the ability to check type + equality between two parameterized StrMatch types under some + circumstances. Changed how the hash key for stashing regexp references + gets built — is now closer to the old way. This doesn't revert the + change in 1.001_012 where regexp checks can be inlined better, but only + applies to those regexp references that can't easily be inlined. + +1.001_012 2017-05-17 + + [ BACK COMPAT ] + - RegexpRef now accepts blessed objects if $object->isa('Regexp') returns + true. + + [ Other ] + - StrMatch will use Regexp::Util (if available) to inline regular + expressions more sensibly. + +1.001_011 2017-05-17 + + [ Bug Fixes ] + - Type constraints like Tuple[Int] shouldn't report they have a coercion + if Int doesn't have a coercion. + + [ Other ] + - Added: Types::Standard now has a CycleTuple type. + +1.001_010 2017-05-16 Puppiversary + + [ Test Suite ] + - t/00-begin.t will now work around ANDK's apparently broken XS testing + environment. + +1.001_009 2017-05-13 + + - Rewrite some benchmarking scripts to use + Benchmark::Featureset::ParamCheck. + - Use Ref::Util::XS (if it's installed) to speed up certain type checks. + +1.001_008 2017-05-10 + + [ Bug Fixes ] + - Type::Params should make sure Type::Utils is loaded before calling + english_list(). + + [ Documentation ] + - Rearrange the examples directory in the distribution. + + [ Other ] + - Added: Named parameter validation benchmarking script. + - Added: Reduce scope of local $SIG{__DIE__} in Type::Registry. + Graham Knop++ + +1.001_007 2017-05-04 May the fourth be with you + + [ Documentation ] + - Comparison of Type::Params with new(ish) CPAN module + Params::ValidationCompiler. + - Show example of how to set defaults for parameters with Type::Params. + + [ Other ] + - Added: Type::Params' `multisig` function now sets a variable + `${^TYPE_PARAMS_MULTISIG}` to indicate which signature succeeded. + - Optimization of Type::Params positional parameter checking for simple + cases with no slurpy parameter and no coercions. + - Optimizations for Tuple and StrMatch type constraints from + Types::Standard. + +1.001_006 2017-04-30 + + - Allow Type::Tiny's `constraint` parameter to be a string of Perl code. + - Localize $SIG{__DIE__} in Type::Registry. + Fixes RT#100780. + + +1.001_005 2017-04-19 + + [ Bug Fixes ] + - 02-api.t should check version of Moose available. + + - 20-unit/Type-Utils/warnings.t should check version of Test::Warnings. + Alexandr Ciornii++ + + - Fix minor typos in documentation for Types::Standard. + Zoffix Znet++ + + - Fix variable name typo in documentation for Type::Params. + Lucas Buchala++ + + + [ Documentation ] + - Include projected release date for Type::Tiny 1.002000 in NEWS. + + [ Test Suite ] + - Bundle a test case for GH issue 14. + + + [ Other ] + - Improved error location reporting for Moo + Peter Valdemar Mørch++ + + - Updated: NumericCode now coerces from strings with whitespace in them, + like MooseX::Types::Common::Numeric. + Denis Ibaev++ + + +1.001_004 2017-02-06 + + - Attempting ArrayRef[Int, Int] or similar now throws an exception. + Fixes RT#105299. + Thomas Sibley++ + + +1.001_003 2017-02-02 + + - Updated: Merge fixes from stable Type-Tiny 1.000006. + +1.001_002 2014-10-25 + + [ Bug Fixes ] + - Fix short-circuiting optimizations for parameterized HashRef, ArrayRef, + ScalarRef, and Map type constraints. + Fixes RT#99312. + Marcel Timmerman++ + + - Inlined version of Types::Standard::Int should check that the value is + not a reference. + + [ Test Suite ] + - Fix annoying warning message in test suite with recent versions of + Exporter::Tiny. + + [ Other ] + - Make equals/is_a_type_of/is_subtype_of/is_supertype_of in + Type::Tiny::Union work more like Moose::Meta::TypeConstraint::Union. + +1.001_001 2014-09-19 + + - Lazy-load Text::Balanced in Type::Parser. (Many parses don't even need + it.) + - Lazy-load Type::Tiny::Union in Type::Params. + - Updated: Prefer Sub::Util over Sub::Name. (The former is smaller.) + +1.001_000 2014-09-07 + + [ Bug Fixes ] + - Fix for Type::Registry::DWIM. + Fixes RT#98458. + Marcel Montes++ + + - Fix issues with coercions and native attribute traits with some oldish + versions of Moose on oldish versions of Perl. + Fixes RT#98159. + Peter Flanigan++ + + + [ Documentation ] + - Updated NEWS file. + - Updated TODO file. + - Updates to Type::Tiny::Manual::UsingWithMoose, + Type::Tiny::Manual::UsingWithMoo, and + Type::Tiny::Manual::UsingWithMouse. + + [ Test Suite ] + - Make some of the test case skip_all bits more ambitious; test older + versions of Moose and Moo than we were testing before. + + [ Other ] + - Added: Type::Params now provides `compile_named` and `validate_named` + functions which do the same thing as `compile` and `validate` but are + better for named arguments. + - Updated: If Sub::Name is unavailable, but the shiny new core Sub::Util + is available, then use it instead. + - Updated: Want Type::Tiny::XS 0.011. + - `Type::Utils::dwim_type` now allows more control over fallback + behaviours. + +1.000006 2017-01-30 + + [ Bug Fixes ] + - Fix escaping within q{...} in a test case. + Fixes RT#114386. + Karen Etheridge++ + + 1.000005 2014-10-25 [ Bug Fixes ] diff -Nru libtype-tiny-perl-1.000005/CONTRIBUTING.pod libtype-tiny-perl-1.004004/CONTRIBUTING.pod --- libtype-tiny-perl-1.000005/CONTRIBUTING.pod 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/CONTRIBUTING.pod 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,58 @@ +=head1 NAME + +CONTRIBUTING - how to help with Type::Tiny + +=head1 DESCRIPTION + +=head2 Reporting bugs + +Bug reports (including wishlist items) can be submitted to RT. + +L. + +Test cases written using L are always appreciated. + +=head2 Fixing bugs + +If something doesn't work as documented, or causes unexpected crashes, +and you know how to fix it, then either attach a patch to the bug report +(see above) or as a pull request to the project on GitHub. + +L. + +Please try to follow the coding style used in the rest of the project. +(Tab indents, spaces for alignment, British English spellings, pod at +the end of code but the start of test cases, etc.) + +=head2 Adding Test Cases + +New test cases for the Type::Tiny test suite are always welcome. +The coveralls page for Type::Tiny should reveal what parts of the +code are most needing good test cases. Any files with below 95% +coverage are highest priority. + +L. + +=head2 Improving Documentation + +While the documentation for each package in Type::Tiny is fairly +complete, Type::Tiny::Manual needs a bit of work. + +=head2 Writing Type Libraries + +Though I'm unlikely to bundle many more type libraries in this distribution, +uploading your own type libraries to CPAN will strengthen the Type::Tiny +ecosystem. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018 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 diff -Nru libtype-tiny-perl-1.000005/COPYRIGHT libtype-tiny-perl-1.004004/COPYRIGHT --- libtype-tiny-perl-1.000005/COPYRIGHT 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/COPYRIGHT 2019-01-08 18:27:21.000000000 +0000 @@ -3,9 +3,7 @@ Upstream-Contact: Toby Inkster (TOBYINK) Source: https://metacpan.org/release/Type-Tiny -Files: examples/benchmark-coercions.pl - examples/benchmark-constraints.pl - lib/Devel/TypeTiny/Perl56Compat.pm +Files: lib/Devel/TypeTiny/Perl56Compat.pm lib/Devel/TypeTiny/Perl58Compat.pm lib/Error/TypeTiny.pm lib/Error/TypeTiny/Assertion.pm @@ -47,6 +45,8 @@ lib/Types/Standard/HashRef.pm lib/Types/Standard/Map.pm lib/Types/Standard/ScalarRef.pm + lib/Types/Standard/StrMatch.pm + lib/Types/Standard/Tied.pm lib/Types/Standard/Tuple.pm lib/Types/TypeTiny.pm t/00-begin.t @@ -58,8 +58,11 @@ t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t t/20-unit/Error-TypeTiny/basic.t t/20-unit/Error-TypeTiny/stacktrace.t + t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t + t/20-unit/Eval-TypeTiny/aliases-native.t + t/20-unit/Eval-TypeTiny/aliases-padwalker.t + t/20-unit/Eval-TypeTiny/aliases-tie.t t/20-unit/Eval-TypeTiny/basic.t - t/20-unit/Eval-TypeTiny/fallback-aliases.t t/20-unit/Eval-TypeTiny/lexical-subs.t t/20-unit/Type-Coercion-Union/basic.t t/20-unit/Type-Coercion/basic.t @@ -75,6 +78,9 @@ t/20-unit/Type-Params/badsigs.t t/20-unit/Type-Params/carping.t t/20-unit/Type-Params/coerce.t + t/20-unit/Type-Params/compile-named-bless.t + t/20-unit/Type-Params/compile-named.t + t/20-unit/Type-Params/hashorder.t t/20-unit/Type-Params/methods.t t/20-unit/Type-Params/mixednamed.t t/20-unit/Type-Params/multisig.t @@ -97,6 +103,7 @@ t/20-unit/Type-Tiny-Role/basic.t t/20-unit/Type-Tiny-Role/errors.t t/20-unit/Type-Tiny-Union/basic.t + t/20-unit/Type-Tiny-Union/relationships.t t/20-unit/Type-Tiny/arithmetic.t t/20-unit/Type-Tiny/basic.t t/20-unit/Type-Tiny/coercion-modifiers.t @@ -117,6 +124,7 @@ t/30-integration/Exporter-Tiny/installer.t t/30-integration/Exporter-Tiny/role-conflict.t t/30-integration/Function-Parameters/basic.t + t/30-integration/Kavorka/80returntype.t t/30-integration/Moo/basic.t t/30-integration/Moo/coercion.t t/30-integration/Moo/exceptions.t @@ -126,6 +134,7 @@ t/30-integration/Moops/library-keyword.t t/30-integration/Moose/accept-moose-types.t t/30-integration/Moose/basic.t + t/30-integration/Moose/coercion-more.t t/30-integration/Moose/coercion.t t/30-integration/Moose/native-attribute-traits.t t/30-integration/MooseX-Types/basic.t @@ -141,7 +150,7 @@ t/30-integration/Validation-Class-Simple/basic.t t/lib/BiggerLib.pm t/lib/DemoLib.pm -Copyright: This software is copyright (c) 2013-2014 by Toby Inkster. +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t @@ -173,6 +182,7 @@ t/20-unit/Types-TypeTiny/basic.t t/20-unit/Types-TypeTiny/coercion.t t/20-unit/Types-TypeTiny/meta.t + t/20-unit/Types-TypeTiny/moosemouse.t t/30-integration/Kavorka/basic.t t/30-integration/Moo/coercion-inlining-avoidance.t t/30-integration/Moose/inflate-then-inline.t @@ -182,28 +192,29 @@ t/30-integration/Switcheroo/basic.t t/30-integration/Type-Tie/basic.t t/30-integration/match-simple/basic.t -Copyright: This software is copyright (c) 2014 by Toby Inkster. +Copyright: This software is copyright (c) 2014, 2017-2019 by Toby Inkster. License: GPL-1.0+ or Artistic-1.0 -Files: META.json - META.yml - NEWS - TODO - dist.ini - doap.ttl - examples/benchmark-param-validation.pl -Copyright: Copyright 2014 Toby Inkster. +Files: t/20-unit/Type-Library/deprecation.t + t/20-unit/Type-Params/compile-named-oo.t + t/20-unit/Type-Tiny/deprecation.t + t/20-unit/Types-Common-Numeric/ranges.t + t/20-unit/Types-Common-String/strlength.t + t/20-unit/Types-Standard/filehandle.t + t/20-unit/Types-TypeTiny/progressiveexporter.t + t/30-integration/Sub-Quote/delayed-quoting.t +Copyright: This software is copyright (c) 2018-2019 by Toby Inkster. +License: GPL-1.0+ or Artistic-1.0 + +Files: examples/benchmarking/benchmark-constraints.pl + examples/benchmarking/benchmark-named-param-validation.pl + examples/benchmarking/versus-scalar-validation.pl + examples/datetime-coercions.pl + examples/nonempty.pl + examples/page-numbers.pl +Copyright: Copyright 2017 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 -Files: INSTALL - examples/versus-scalar-validation.pl - t/README - t/TODO - t/mk-test-manifest.pl - t/not-covered.pl -Copyright: Unknown -License: Unknown - Files: CREDITS Changes LICENSE @@ -212,32 +223,61 @@ Copyright: Copyright 1970 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 +Files: lib/Types/Standard/CycleTuple.pm + t/20-unit/Type-Tiny-_HalfOp/double-union.t + t/20-unit/Type-Tiny/constraint-strings.t + t/20-unit/Types-Standard/cycletuple.t + t/40-regression/gh14.t +Copyright: This software is copyright (c) 2017-2019 by Toby Inkster. +License: GPL-1.0+ or Artistic-1.0 + Files: t/40-regression/rt92571-2.t t/40-regression/rt92571.t t/40-regression/rt92591.t t/40-regression/rt94196.t t/40-regression/rt97684.t -Copyright: This software is copyright (c) 2014 by Diab Jerius. +Copyright: This software is copyright (c) 2014, 2017-2019 by Diab Jerius. License: GPL-1.0+ or Artistic-1.0 +Files: META.json + META.yml + NEWS + doap.ttl + t/20-unit/Type-Params/defaults.t +Copyright: Copyright 2019 Toby Inkster. +License: GPL-1.0+ or Artistic-1.0 + +Files: INSTALL + t/README + t/TODO + t/mk-test-manifest.pl + t/not-covered.pl +Copyright: Unknown +License: Unknown + Files: t/20-unit/Types-Common-Numeric/basic.t t/20-unit/Types-Common-String/basic.t t/20-unit/Types-Common-String/coerce.t t/20-unit/Types-Common-String/unicode.t -Copyright: This software is copyright (c) 2013-2014 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). License: GPL-1.0+ or Artistic-1.0 Files: lib/Type/Tiny/_HalfOp.pm t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t t/40-regression/73f51e2d.pl t/40-regression/73f51e2d.t -Copyright: This software is copyright (c) 2014 by Graham Knop. +Copyright: This software is copyright (c) 2014, 2017-2019 by Graham Knop. License: GPL-1.0+ or Artistic-1.0 Files: t/40-regression/rt85911.t t/40-regression/rt86004.t t/40-regression/rt90096-2.t -Copyright: This software is copyright (c) 2013-2014 by Diab Jerius. +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Diab Jerius. +License: GPL-1.0+ or Artistic-1.0 + +Files: TODO + examples/benchmarking/benchmark-param-validation.pl +Copyright: Copyright 2018 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: COPYRIGHT @@ -247,62 +287,78 @@ Files: t/40-regression/rt86233.t t/40-regression/rt86239.t -Copyright: This software is copyright (c) 2013-2014 by Vyacheslav Matyukhin. +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Vyacheslav Matyukhin. License: GPL-1.0+ or Artistic-1.0 -Files: t/40-regression/gh1.t -Copyright: This software is copyright (c) 2013-2014 by Richard Simões. +Files: inc/Try/Tiny.pm +Copyright: Copyright 2014 Yuval Kogman. License: GPL-1.0+ or Artistic-1.0 -Files: t/99-moose-std-types-test.t -Copyright: This software is copyright (c) 2013-2014 by Infinity Interactive, Inc.. +Files: dist.ini +Copyright: Copyright 2014 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 -Files: t/40-regression/rt90096.t -Copyright: This software is copyright (c) 2013-2014 by Samuel Kaufman. +Files: t/40-regression/rt98113.t +Copyright: This software is copyright (c) 2014, 2017-2019 by Dagfinn Ilmari MannsÃ¥ker. License: GPL-1.0+ or Artistic-1.0 -Files: inc/Try/Tiny.pm -Copyright: Copyright 2014 Yuval Kogman. +Files: t/30-integration/MooseX-Getopt/coercion.t +Copyright: This software is copyright (c) 2014, 2017-2019 by Alexander Hartmaier. License: GPL-1.0+ or Artistic-1.0 -Files: t/30-integration/Class-InsideOut/basic.t -Copyright: This software is copyright (c) 2013-2014 by David Golden, Toby Inkster. +Files: CONTRIBUTING.pod +Copyright: This software is copyright (c) 2018 by Toby Inkster. License: GPL-1.0+ or Artistic-1.0 -Files: t/40-regression/ttxs-gh1.t -Copyright: This software is copyright (c) 2014 by Jed Lund. +Files: t/99-moose-std-types-test.t +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Infinity Interactive, Inc.. License: GPL-1.0+ or Artistic-1.0 -Files: examples/datetime-coercions.pl -Copyright: This software is copyright (c) 2013 by Toby Inkster. +Files: t/40-regression/gh1.t +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Richard Simões. License: GPL-1.0+ or Artistic-1.0 -Files: t/30-integration/MooseX-Getopt/coercion.t -Copyright: This software is copyright (c) 2014 by Alexander Hartmaier. +Files: t/40-regression/ttxs-gh1.t +Copyright: This software is copyright (c) 2014, 2017-2019 by Jed Lund. License: GPL-1.0+ or Artistic-1.0 Files: inc/Test/Fatal.pm Copyright: Copyright 2014 Ricardo Signes. License: GPL-1.0+ or Artistic-1.0 +Files: t/40-regression/rt125765.t +Copyright: This software is copyright (c) 2018-2019 by KB Jørgensen. +License: GPL-1.0+ or Artistic-1.0 + +Files: t/40-regression/rt125132.t +Copyright: This software is copyright (c) 2018-2019 by Marc Ballarin. +License: GPL-1.0+ or Artistic-1.0 + Files: inc/Test/Requires.pm Copyright: Copyright 2014 MATSUNO Tokuhiro. License: GPL-1.0+ or Artistic-1.0 -Files: t/40-regression/rt98113.t -Copyright: This software is copyright (c) 2014 by Dagfinn Ilmari MannsÃ¥ker. +Files: examples/benchmarking/benchmark-coercions.pl +Copyright: This software is copyright (c) 2013-2014, 2017 by Toby Inkster. +License: GPL-1.0+ or Artistic-1.0 + +Files: t/30-integration/Class-InsideOut/basic.t +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by David Golden, Toby Inkster. +License: GPL-1.0+ or Artistic-1.0 + +Files: t/40-regression/rt90096.t +Copyright: This software is copyright (c) 2013-2014, 2017-2019 by Samuel Kaufman. License: GPL-1.0+ or Artistic-1.0 License: Artistic-1.0 - This software is Copyright (c) 2014 by the copyright holder(s). + This software is Copyright (c) 2019 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 software is Copyright (c) 2019 by the copyright holder(s). This is free software, licensed under: diff -Nru libtype-tiny-perl-1.000005/CREDITS libtype-tiny-perl-1.004004/CREDITS --- libtype-tiny-perl-1.000005/CREDITS 2014-10-25 19:05:48.000000000 +0000 +++ libtype-tiny-perl-1.004004/CREDITS 2019-01-08 18:26:37.000000000 +0000 @@ -3,24 +3,39 @@ Contributor: - Alexander Hartmaier (ABRAXXA) +- Alexandr Ciornii - Dagfinn Ilmari Mannsåker (ILMARI) - David Steinbrunner +- Denis Ibaev - Diab Jerius (DJERIUS) - Gianni Ceccarelli (DAKKAR) - Graham Knop (HAARG) +- Karen Etheridge (ETHER) +- Lucas Buchala - Mark Stosberg (MARKSTOS) +- Nelo Onyiah - Peter Flanigan (PJFL) - Peter Karman (KARMAN) +- Peter Valdemar Mørch +- Philippe Bruhat (BOOK) - Pierre Masci +- Robert Rothenberg (RRWO) - Samuel Kaufman (SKAUFMAN) +- Thomas Sibley (TSIBLEY) - Vyacheslav Matyukhin (MMCLERIC) +- Zoffix Znet Thanks: +- Andreas J König (ANDK) +- André Walker +- Aran Clary Deltac (BLUEFEET) - Benct Philip Jonsson - Brendan Byrd (BBYRD) - Caleb Cushing (XENO) - David Golden (DAGOLDEN) - Jason R Mash (JRMASH) +- Jon Portnoy (AVENJ) +- KB Jørgensen - Kevin Dawson (BOWTIE) - Marcel Montes (SPICEMAN) - Marcel Timmerman (MARTIMM) @@ -31,6 +46,7 @@ - Peter Rabbitson (RIBASUSHI) - Richard Simões (RSIMOES) - Shlomi Fish (SHLOMIF) +- Slaven Rezić (SREZIC) - Steven Lee (STEVENL) - Tim Bunce (TIMB) diff -Nru libtype-tiny-perl-1.000005/debian/changelog libtype-tiny-perl-1.004004/debian/changelog --- libtype-tiny-perl-1.000005/debian/changelog 2015-02-15 15:08:35.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/changelog 2019-07-23 13:52:46.000000000 +0000 @@ -1,3 +1,143 @@ +libtype-tiny-perl (1.004004-ppa1~xenial) xenial; urgency=medium + + * No-changes build backported to Ubuntu 16.04.6 LTS "Xenial Xerus" + + -- Peter J. Mello Tue, 23 Jul 2019 06:52:46 -0700 + +libtype-tiny-perl (1.004004-1) unstable; urgency=medium + + * Team upload. + * Import upstream version 1.004004. + * Sync debian/copyright with upstream COPYRIGHT. + * Update build and runtime dependencies. + * Declare compliance with Debian Policy 4.3.0. + + -- gregor herrmann Fri, 11 Jan 2019 20:46:19 +0100 + +libtype-tiny-perl (1.004002-1) unstable; urgency=medium + + * Team upload. + + [ intrigeri ] + * Remove obsolete README.source. + + [ gregor herrmann ] + * Import upstream version 1.004002 + * Don't install upstream README. + Just a text version of the POD/manpage. + * Update build dependencies, and split Build-Depends{,-Indep}. + * Sync debian/copyright with upstream COPYRIGHT. + * Install new CONTRIBUTING.pod. + + -- gregor herrmann Wed, 01 Aug 2018 16:30:21 +0200 + +libtype-tiny-perl (1.002002-1) unstable; urgency=medium + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ gregor herrmann ] + * debian/*: update URLs from {search,www}.cpan.org to MetaCPAN. + + [ intrigeri ] + * Import new upstream release. + * Port to dh. + * Bump dh compat level to 11, bump versioned build-dependency accordingly. + * Declare compatibility with Policy 4.1.5. + * Add myself to uploaders. + * Enable autopkgtests. + * Reformat debian/control and drop obsoleted versions on dependencies. + * Reformat debian/copyright with cme. + * Drop packages that are not in the archive from the Enhances control field. + * debian/copyright: drop paragraph about non-existing file. + * Add build-dependency on libtest-requires-perl. + * Add debian/upstream/metadata. + * Update debian/copyright. + * Mention Types::Standard and Type::Params in the package description. + + -- intrigeri Wed, 25 Jul 2018 15:52:19 +0000 + +libtype-tiny-perl (1.002001-1) unstable; urgency=medium + + [ upstream ] + * New release(s). + News: + + Type::Params now has compile_named and validate_named. + + Type::Tiny's constraint parameter may be a string of code. + + Types::Standard::CycleTuple added. + + Types::Standard::RegexpRef now accepts blessed objects where + $object->isa('Regexp'). This plays better with re::engine::* + pragmas. + + Fixed bug where Types::Standard::Int would *sometimes* accept + an overloaded object. (It never should.) + + Various performance enhancements and bug fixes. + + [ Jonas Smedegaard ] + * Update watch file: Use substitution strings. + * Modernize cdbs: + + Drop upstream-tarball hints: Use gbp import-orig --uscan. + + Do copyright-check in maintainer script (not during build). + + Stop build-depend on licensecheck. + * Update copyright info: Use https protocol in file format URL. + * Declare compliance with Debian Policy 4.1.0. + * Tighten lintian overrides regarding License-Reference. + * Update package relations: + + Recommend recent perl or recent libscalar-list-utils-perl (not + libsub-name-perl). + + Recommend libref-util-perl. + + Build-depend on and enhance libfunction-parameters-perl. + + Relax to build-depend unversioned on libvalidation-class-perl + libmoo-perl: Needed version satisfied even in oldstable. + + Stop build-depend explicitly on (recent perl or) + libtest-simple-perl, or (recent perl or) libjson-pp-perl: Needed + perl version satisfied even in oldstable. + + Relax build-dependency on libobject-accessor-perl to drop fallback + on older perl: Package available even in oldstable. + + Relax to suggest (not recommend) libdevel-lexalias-perl. + + Enhance perl (for Params::Check) libmoo-perl libmoose-perl + libmouse-perl libregexp-util-perl + libparams-validationcompiler-perl libdata-validator-perl. + + -- Jonas Smedegaard Thu, 14 Sep 2017 12:33:29 +0200 + +libtype-tiny-perl (1.000006-1) unstable; urgency=medium + + [ upstream ] + * New release. + + Fix escaping within q{...} in a test case. + + [ gregor herrmann ] + * Update Test::Tester build dependency. + + [ Jonas Smedegaard ] + * Update watch file: + + Bump to version 4. + + Track only MetaCPAN URL. + + Mention gbp import-orig --uscan in usage comment. + + Tighten version regex. + * Update git-buildpage config: + + Avoid git- prefix. + + Filter any .git* file. + * Modernize Vcs-* fields: + + Use https protocol. + + Use git subdir (not cgit). + + Add .git suffix for Vcs-Git URL. + * Declare compliance with Debian Policy 3.9.8. + * Bump debhelper compatibility level to 9. + * Update copyright info: + + Use License-Grant and License-Reference fields. + Thanks to Ben Finney. + + Extend coverage of Debian packaging. + + Extend coverage for upstream authors. + * Add lintian override regarding license in License-Reference field. + See bug#786450. + * Update package relations: + + Favor recent perl over (recent libtest-simple-perl over) + libtest-tester-perl. + + Build-depend on licensecheck (not devscripts). + + -- Jonas Smedegaard Wed, 01 Feb 2017 02:50:18 +0100 + libtype-tiny-perl (1.000005-1) unstable; urgency=medium [ upstream ] diff -Nru libtype-tiny-perl-1.000005/debian/compat libtype-tiny-perl-1.004004/debian/compat --- libtype-tiny-perl-1.000005/debian/compat 2014-04-30 00:41:08.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -8 diff -Nru libtype-tiny-perl-1.000005/debian/control libtype-tiny-perl-1.004004/debian/control --- libtype-tiny-perl-1.000005/debian/control 2015-02-15 15:08:46.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/control 2019-07-23 13:52:46.000000000 +0000 @@ -1,48 +1,33 @@ Source: libtype-tiny-perl Section: perl Priority: optional -Build-Depends: cdbs, - devscripts, - perl, - debhelper, - dh-buildinfo, - libmoose-perl, - libmouse-perl, - libclass-insideout-perl, - libmoosex-types-perl, - libmousex-types-perl, - libtest-fatal-perl, - libtest-tester-perl, - libmoosex-types-common-perl, - libtest-warnings-perl, - libmatch-simple-perl, - libmoosex-getopt-perl, - libdevel-hide-perl, - perl (>= 5.13.4) | libtest-simple-perl (>= 0.96), - libmoo-perl (>= 1.001000), - perl (>= 5.13.11) | libjson-pp-perl (>= 2.27105), - libvalidation-class-perl (>= 7.900017), - libobject-accessor-perl | perl (<= 5.18.2), - libexporter-tiny-perl, - libdevel-stacktrace-perl -Maintainer: Debian Perl Group -Uploaders: Jonas Smedegaard -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/git/pkg-perl/packages/libtype-tiny-perl -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libtype-tiny-perl.git +Maintainer: Peter J. Mello +Build-Depends: debhelper-compat (= 12) +Build-Depends-Indep: perl, libclass-insideout-perl, libdevel-hide-perl, + libdevel-stacktrace-perl, libexporter-tiny-perl (>= 0.040), + libfunction-parameters-perl, libmatch-simple-perl, libmoo-perl, libmoose-perl, + libmoosex-getopt-perl, libmoosex-types-common-perl, libmoosex-types-perl, + libmouse-perl, libmousex-types-perl, libobject-accessor-perl, + libtest-fatal-perl, libtest-requires-perl, libtest-simple-perl (>= 1.001010), + libtest-warnings-perl, libvalidation-class-perl +Standards-Version: 4.4.0 Homepage: https://metacpan.org/release/Type-Tiny +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libtype-tiny-perl +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libtype-tiny-perl.git +Testsuite: autopkgtest-pkg-perl Package: libtype-tiny-perl Architecture: all -Depends: ${cdbs:Depends}, - ${misc:Depends}, - ${perl:Depends} -Recommends: ${cdbs:Recommends} -Suggests: ${cdbs:Suggests} -Provides: ${cdbs:Provides} -Conflicts: ${cdbs:Conflicts} -Replaces: ${cdbs:Replaces} -Enhances: ${cdbs:Enhances} -Description: tiny, yet Moo(se)-compatible type constraint +Depends: libexporter-tiny-perl (>= 0.040), ${perl:Depends}, ${misc:Depends} +Recommends: libref-util-perl, libscalar-list-utils-perl (>= 1:1.40), + libtype-tiny-xs-perl +Suggests: libdevel-lexalias-perl, libdevel-stacktrace-perl +Enhances: perl, libfunction-parameters-perl, libmoo-perl, libmoose-perl, + libmouse-perl, libparams-validationcompiler-perl, libreply-perl +Description: Tiny, yet Moo(se)-compatible type constraint Type::Tiny is a tiny class for creating Moose-like type constraint objects which are compatible with Moo, Moose and Mouse. + . + This package also includes Types::Standard, a Moose-inspired library + of useful type constraints, and Type::Params, to allow very fast checking + and coercion of function and method parameters. diff -Nru libtype-tiny-perl-1.000005/debian/control.in libtype-tiny-perl-1.004004/debian/control.in --- libtype-tiny-perl-1.000005/debian/control.in 2015-02-15 15:08:22.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/control.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -Source: libtype-tiny-perl -Section: perl -Priority: optional -Build-Depends: @cdbs@ -Maintainer: Debian Perl Group -Uploaders: Jonas Smedegaard -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/git/pkg-perl/packages/libtype-tiny-perl -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libtype-tiny-perl.git -Homepage: https://metacpan.org/release/Type-Tiny - -Package: libtype-tiny-perl -Architecture: all -Depends: ${cdbs:Depends}, - ${misc:Depends}, - ${perl:Depends} -Recommends: ${cdbs:Recommends} -Suggests: ${cdbs:Suggests} -Provides: ${cdbs:Provides} -Conflicts: ${cdbs:Conflicts} -Replaces: ${cdbs:Replaces} -Enhances: ${cdbs:Enhances} -Description: tiny, yet Moo(se)-compatible type constraint - Type::Tiny is a tiny class for creating Moose-like type constraint - objects which are compatible with Moo, Moose and Mouse. diff -Nru libtype-tiny-perl-1.000005/debian/copyright libtype-tiny-perl-1.004004/debian/copyright --- libtype-tiny-perl-1.000005/debian/copyright 2014-08-26 20:16:29.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/copyright 2019-07-23 13:52:46.000000000 +0000 @@ -1,207 +1,267 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: Type::Tiny -Upstream-Contact: http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny -Source: http://search.cpan.org/dist/Type-Tiny/ - https://github.com/tobyink/p5-type-tiny +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Type-Tiny +Upstream-Contact: Toby Inkster +Source: https://metacpan.org/release/Type-Tiny Files: * -Copyright: 2012-2014, Toby Inkster -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. - . - Comment: - . - Perl 5 is licensed under either the 'Artistic license' or the 'GNU - General Public License' version 1 or later. +Copyright: 2012-2014, 2017-2019, Toby Inkster +License: Artistic or GPL-1.0-or-later -Files: t/40-regression/rt85911.t - t/40-regression/rt86004.t - t/40-regression/rt90096-2.t - t/40-regression/rt92571-2.t - t/40-regression/rt92571.t - t/40-regression/rt92591.t - t/40-regression/rt94196.t -Copyright: 2013-2014, Diab Jerius -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. - -Files: lib/Type/Tiny/_HalfOp.pm - t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t - t/40-regression/73f51e2d.pl - t/40-regression/73f51e2d.t -Copyright: 2014, Graham Knop -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Files: lib/Devel/TypeTiny/Perl56Compat.pm lib/Devel/TypeTiny/Perl58Compat.pm + lib/Error/TypeTiny.pm lib/Error/TypeTiny/Assertion.pm + lib/Error/TypeTiny/Compilation.pm lib/Error/TypeTiny/WrongNumberOfParameters.pm + lib/Eval/TypeTiny.pm lib/Reply/Plugin/TypeTiny.pm lib/Test/TypeTiny.pm + lib/Type/Coercion.pm lib/Type/Coercion/FromMoose.pm lib/Type/Coercion/Union.pm + lib/Type/Library.pm lib/Type/Params.pm lib/Type/Parser.pm lib/Type/Registry.pm + lib/Type/Tiny.pm lib/Type/Tiny/Class.pm lib/Type/Tiny/Duck.pm + lib/Type/Tiny/Enum.pm lib/Type/Tiny/Intersection.pm lib/Type/Tiny/Manual.pod + lib/Type/Tiny/Manual/Coercions.pod lib/Type/Tiny/Manual/Libraries.pod + lib/Type/Tiny/Manual/Optimization.pod lib/Type/Tiny/Manual/Params.pod + lib/Type/Tiny/Manual/Policies.pod lib/Type/Tiny/Manual/UsingWithMoo.pod + lib/Type/Tiny/Manual/UsingWithMoose.pod lib/Type/Tiny/Manual/UsingWithMouse.pod + lib/Type/Tiny/Manual/UsingWithOther.pod lib/Type/Tiny/Role.pm + lib/Type/Tiny/Union.pm lib/Type/Utils.pm lib/Types/Common/Numeric.pm + lib/Types/Common/String.pm lib/Types/Standard.pm lib/Types/Standard/ArrayRef.pm + lib/Types/Standard/Dict.pm lib/Types/Standard/HashRef.pm + lib/Types/Standard/Map.pm lib/Types/Standard/ScalarRef.pm + lib/Types/Standard/StrMatch.pm lib/Types/Standard/Tied.pm + lib/Types/Standard/Tuple.pm lib/Types/TypeTiny.pm t/00-begin.t t/01-compile.t + t/02-api.t t/03-leak.t t/20-unit/Error-TypeTiny-Assertion/basic.t + t/20-unit/Error-TypeTiny-Compilation/basic.t + t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t + t/20-unit/Error-TypeTiny/basic.t t/20-unit/Error-TypeTiny/stacktrace.t + t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t + t/20-unit/Eval-TypeTiny/aliases-native.t + t/20-unit/Eval-TypeTiny/aliases-padwalker.t + t/20-unit/Eval-TypeTiny/aliases-tie.t t/20-unit/Eval-TypeTiny/basic.t + t/20-unit/Eval-TypeTiny/lexical-subs.t t/20-unit/Type-Coercion-Union/basic.t + t/20-unit/Type-Coercion/basic.t t/20-unit/Type-Coercion/frozen.t + t/20-unit/Type-Coercion/inlining.t t/20-unit/Type-Coercion/parameterized.t + t/20-unit/Type-Library/assert.t t/20-unit/Type-Library/errors.t + t/20-unit/Type-Library/inheritance.t t/20-unit/Type-Library/is.t + t/20-unit/Type-Library/to.t t/20-unit/Type-Library/types.t + t/20-unit/Type-Params/badsigs.t t/20-unit/Type-Params/carping.t + t/20-unit/Type-Params/coerce.t t/20-unit/Type-Params/compile-named-bless.t + t/20-unit/Type-Params/compile-named.t t/20-unit/Type-Params/hashorder.t + t/20-unit/Type-Params/methods.t t/20-unit/Type-Params/mixednamed.t + t/20-unit/Type-Params/multisig.t t/20-unit/Type-Params/named.t + t/20-unit/Type-Params/noninline.t t/20-unit/Type-Params/optional.t + t/20-unit/Type-Params/positional.t t/20-unit/Type-Params/slurpy.t + t/20-unit/Type-Parser/basic.t t/20-unit/Type-Parser/moosextypes.t + t/20-unit/Type-Registry/basic.t t/20-unit/Type-Registry/moosextypes.t + t/20-unit/Type-Registry/mousextypes.t t/20-unit/Type-Tiny-Class/basic.t + t/20-unit/Type-Tiny-Class/errors.t t/20-unit/Type-Tiny-Class/plus-constructors.t + t/20-unit/Type-Tiny-Duck/basic.t t/20-unit/Type-Tiny-Enum/basic.t + t/20-unit/Type-Tiny-Intersection/basic.t t/20-unit/Type-Tiny-Role/basic.t + t/20-unit/Type-Tiny-Role/errors.t t/20-unit/Type-Tiny-Union/basic.t + t/20-unit/Type-Tiny-Union/relationships.t t/20-unit/Type-Tiny/arithmetic.t + t/20-unit/Type-Tiny/basic.t t/20-unit/Type-Tiny/coercion-modifiers.t + t/20-unit/Type-Tiny/parameterization.t t/20-unit/Type-Tiny/syntax.t + t/20-unit/Type-Utils/dwim-moose.t t/20-unit/Type-Utils/dwim-mouse.t + t/20-unit/Type-Utils/match-on-type.t t/20-unit/Types-Standard/basic.t + t/20-unit/Types-Standard/deep-coercions.t + t/20-unit/Types-Standard/mxtmlb-alike.t t/20-unit/Types-Standard/optlist.t + t/20-unit/Types-Standard/overload.t t/20-unit/Types-Standard/strmatch.t + t/20-unit/Types-Standard/structured.t t/20-unit/Types-Standard/tied.t + t/30-integration/Exporter-Tiny/basic.t + t/30-integration/Exporter-Tiny/installer.t + t/30-integration/Exporter-Tiny/role-conflict.t + t/30-integration/Function-Parameters/basic.t + t/30-integration/Kavorka/80returntype.t t/30-integration/Moo/basic.t + t/30-integration/Moo/coercion.t t/30-integration/Moo/exceptions.t + t/30-integration/Moo/inflation.t t/30-integration/Moo/inflation2.t + t/30-integration/Moops/basic.t t/30-integration/Moops/library-keyword.t + t/30-integration/Moose/accept-moose-types.t t/30-integration/Moose/basic.t + t/30-integration/Moose/coercion-more.t t/30-integration/Moose/coercion.t + t/30-integration/Moose/native-attribute-traits.t + t/30-integration/MooseX-Types/basic.t t/30-integration/MooseX-Types/extending.t + t/30-integration/MooseX-Types/more.t t/30-integration/Mouse/basic.t + t/30-integration/Mouse/coercion.t t/30-integration/MouseX-Types/basic.t + t/30-integration/MouseX-Types/extending.t + t/30-integration/Object-Accessor/basic.t t/30-integration/Sub-Quote/basic.t + t/30-integration/Validation-Class-Simple/archaic.t + t/30-integration/Validation-Class-Simple/basic.t t/lib/BiggerLib.pm + t/lib/DemoLib.pm +Copyright: 2013-2014, 2017-2019, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t + t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t t/20-unit/Test-TypeTiny/basic.t + t/20-unit/Test-TypeTiny/extended.t t/20-unit/Test-TypeTiny/matchfor.t + t/20-unit/Type-Coercion-FromMoose/basic.t + t/20-unit/Type-Coercion-FromMoose/errors.t t/20-unit/Type-Coercion/esoteric.t + t/20-unit/Type-Coercion/smartmatch.t + t/20-unit/Type-Coercion/typetiny-constructor.t + t/20-unit/Type-Registry/automagic.t t/20-unit/Type-Registry/methods.t + t/20-unit/Type-Tiny-Duck/errors.t t/20-unit/Type-Tiny-Enum/errors.t + t/20-unit/Type-Tiny-Intersection/errors.t t/20-unit/Type-Tiny-Union/errors.t + t/20-unit/Type-Tiny/esoteric.t t/20-unit/Type-Tiny/my-methods.t + t/20-unit/Type-Tiny/shortcuts.t t/20-unit/Type-Tiny/smartmatch.t + t/20-unit/Type-Tiny/to-moose.t t/20-unit/Type-Tiny/to-mouse.t + t/20-unit/Type-Utils/classifier.t t/20-unit/Type-Utils/dwim-both.t + t/20-unit/Type-Utils/warnings.t t/20-unit/Types-Standard/lockdown.t + t/20-unit/Types-TypeTiny/basic.t t/20-unit/Types-TypeTiny/coercion.t + t/20-unit/Types-TypeTiny/meta.t t/20-unit/Types-TypeTiny/moosemouse.t + t/30-integration/Kavorka/basic.t + t/30-integration/Moo/coercion-inlining-avoidance.t + t/30-integration/Moose/inflate-then-inline.t + t/30-integration/Return-Type/basic.t + t/30-integration/Sub-Quote/unquote-coercions.t + t/30-integration/Sub-Quote/unquote-constraints.t + t/30-integration/Switcheroo/basic.t t/30-integration/Type-Tie/basic.t + t/30-integration/match-simple/basic.t +Copyright: 2014, 2017-2019, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: t/20-unit/Type-Library/deprecation.t + t/20-unit/Type-Params/compile-named-oo.t t/20-unit/Type-Tiny/deprecation.t + t/20-unit/Types-Common-Numeric/ranges.t + t/20-unit/Types-Common-String/strlength.t t/20-unit/Types-Standard/filehandle.t + t/20-unit/Types-TypeTiny/progressiveexporter.t + t/30-integration/Sub-Quote/delayed-quoting.t +Copyright: 2018-2019, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: examples/benchmarking/benchmark-constraints.pl + examples/benchmarking/benchmark-named-param-validation.pl + examples/benchmarking/versus-scalar-validation.pl examples/datetime-coercions.pl + examples/nonempty.pl examples/page-numbers.pl +Copyright: 2017, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: CREDITS Changes LICENSE Makefile.PL README +Copyright: 1970, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: lib/Types/Standard/CycleTuple.pm + t/20-unit/Type-Tiny-_HalfOp/double-union.t + t/20-unit/Type-Tiny/constraint-strings.t t/20-unit/Types-Standard/cycletuple.t + t/40-regression/gh14.t +Copyright: 2017-2019, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: t/40-regression/rt92571-2.t t/40-regression/rt92571.t + t/40-regression/rt92591.t t/40-regression/rt94196.t t/40-regression/rt97684.t +Copyright: 2014, 2017-2019, Diab Jerius +License: GPL-1.0-or-later or Artistic + +Files: META.json META.yml NEWS doap.ttl t/20-unit/Type-Params/defaults.t +Copyright: 2019, Toby Inkster +License: GPL-1.0-or-later or Artistic Files: t/20-unit/Types-Common-Numeric/basic.t - t/20-unit/Types-Common-String/basic.t - t/20-unit/Types-Common-String/coerce.t + t/20-unit/Types-Common-String/basic.t t/20-unit/Types-Common-String/coerce.t t/20-unit/Types-Common-String/unicode.t -Copyright: 2013-2014, Matt S Trout -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Copyright: 2013-2014, 2017-2019, Matt S Trout +License: GPL-1.0-or-later or Artistic -Files: t/40-regression/rt86233.t - t/40-regression/rt86239.t -Copyright: 2013-2014, Vyacheslav Matyukhin -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Files: TODO examples/benchmarking/benchmark-param-validation.pl +Copyright: 2018, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: t/40-regression/rt86233.t t/40-regression/rt86239.t +Copyright: 2013-2014, 2017-2019, Vyacheslav Matyukhin +License: GPL-1.0-or-later or Artistic + +Files: inc/Try/Tiny.pm +Copyright: 2014, Yuval Kogman +License: GPL-1.0-or-later or Artistic +Comment: Mangled convenience copy + +Files: dist.ini +Copyright: 2014, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: t/40-regression/rt98113.t +Copyright: 2014, 2017-2019, Dagfinn Ilmari MannsÃ¥ker +License: GPL-1.0-or-later or Artistic Files: t/30-integration/MooseX-Getopt/coercion.t -Copyright: 2014, Alexander Hartmaier -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Copyright: 2014, 2017-2019, Alexander Hartmaier +License: GPL-1.0-or-later or Artistic -Files: t/99-moose-std-types-test.t -Copyright: 2013-2014, Infinity Interactive, Inc. -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Files: CONTRIBUTING.pod +Copyright: 2018, Toby Inkster +License: GPL-1.0-or-later or Artistic -Files: t/40-regression/ttxs-gh1.t -Copyright: 2014, Jed Lund -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Files: t/99-moose-std-types-test.t +Copyright: 2013-2014, 2017-2019, Infinity Interactive, Inc. +License: GPL-1.0-or-later or Artistic Files: t/40-regression/gh1.t -Copyright: 2013-2014, Richard Simões -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Copyright: 2013-2014, 2017-2019, Richard Simões +License: GPL-1.0-or-later or Artistic -Files: t/40-regression/rt90096.t -Copyright: 2013-2014, Samuel Kaufman -License: Artistic or GPL-1+ -Comment: - License: - . - This is free software; you can redistribute it and/or modify it under - the same terms as the Perl 5 programming language system itself. +Files: t/40-regression/ttxs-gh1.t +Copyright: 2014, 2017-2019, Jed Lund +License: GPL-1.0-or-later or Artistic Files: inc/Test/Fatal.pm -Copyright: Copyright 2013 Ricardo Signes -License: Artistic or GPL-1+ -Comment: - Mangled convenience copy of Test::Fatal. +Copyright: 2014, Ricardo Signes +License: GPL-1.0-or-later or Artistic +Comment: Mangled convenience copy + +Files: t/40-regression/rt125765.t +Copyright: 2018-2019, KB Jørgensen +License: GPL-1.0-or-later or Artistic + +Files: t/40-regression/rt125132.t +Copyright: 2018-2019, Marc Ballarin +License: GPL-1.0-or-later or Artistic Files: inc/Test/Requires.pm -Copyright: Copyright 2013 MATSUNO Tokuhiro -License: Artistic or GPL-1+ -Comment: - Mangled convenience copy of Test::Requires. +Copyright: 2014, MATSUNO Tokuhiro +License: GPL-1.0-or-later or Artistic +Comment: Mangled convenience copy + +Files: examples/benchmarking/benchmark-coercions.pl +Copyright: 2013-2014, 2017, Toby Inkster +License: GPL-1.0-or-later or Artistic -Files: inc/Try/Tiny.pm -Copyright: Copyright 2014 Yuval Kogman -License: Artistic or GPL-1+ -Comment: - Mangled convenience copy of Try::Tiny. - -Files: CONTRIBUTING -Copyright: 2012-2014, Toby Inkster -License: Artistic or GPL-1+ -Comment: - License: - . - 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. - . - Comment: - . - CC-BY-SA_UK-2.0 licensing skipped: Unneeded, and would be 2k chars. +Files: t/30-integration/Class-InsideOut/basic.t +Copyright: 2013-2014, 2017-2019, David Golden + 2013-2014, 2017-2019, Toby Inkster +License: GPL-1.0-or-later or Artistic + +Files: t/40-regression/rt90096.t +Copyright: 2013-2014, 2017-2019, Samuel Kaufman +License: GPL-1.0-or-later or Artistic Files: debian/* -Copyright: 2013-2014, Jonas Smedegaard -License: GPL-3+ +Copyright: 2013-2015, 2017, Jonas Smedegaard + 2018, intrigeri + 2019, Peter J. Mello +License: GPL-3.0-or-later License: Artistic - Comment: + This program is free software; you can redistribute it and/or modify it under + the terms of the Artistic License, which comes with Perl. . - On Debian systems the 'Artistic License' is located in - '/usr/share/common-licenses/Artistic'. + On Debian-based GNU/Linux systems, the complete text of the Artistic License can + be found in the file `/usr/share/common-licenses/Artistic'. -License: GPL-1+ - Comment: - . - On Debian systems the 'GNU General Public License' version 1 is located - in '/usr/share/common-licenses/GPL-1'. - -License: GPL-3+ - 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 3, 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. - . - Comment: - . - On Debian systems the 'GNU General Public License' version 3 is located - in '/usr/share/common-licenses/GPL-3'. +License: GPL-1.0-or-later + 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. + . + On Debian-based GNU/Linux systems, the complete text of the GNU General Public + License, version 1, can be found in the file `/usr/share/common-licenses/GPL-1'. + +License: GPL-3.0-or-later + 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 3, or (at your option) any later version. . - You should have received a copy of the 'GNU General Public License' - along with this program. If not, see . + On Debian-based GNU/Linux systems, the complete text of the GNU General Public + License, version 3, can be found in the file `/usr/share/common-licenses/GPL-3'. diff -Nru libtype-tiny-perl-1.000005/debian/copyright_hints libtype-tiny-perl-1.004004/debian/copyright_hints --- libtype-tiny-perl-1.000005/debian/copyright_hints 2015-02-15 15:03:07.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/copyright_hints 1970-01-01 00:00:00.000000000 +0000 @@ -1,357 +0,0 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: FIXME -Upstream-Contact: FIXME -Source: FIXME -Disclaimer: Autogenerated by CDBS - -Files: README - examples/benchmark-coercions.pl - examples/benchmark-constraints.pl - examples/benchmark-param-validation.pl - examples/datetime-coercions.pl - lib/Devel/TypeTiny/Perl56Compat.pm - lib/Devel/TypeTiny/Perl58Compat.pm - lib/Error/TypeTiny.pm - lib/Error/TypeTiny/Assertion.pm - lib/Error/TypeTiny/Compilation.pm - lib/Error/TypeTiny/WrongNumberOfParameters.pm - lib/Eval/TypeTiny.pm - lib/Reply/Plugin/TypeTiny.pm - lib/Test/TypeTiny.pm - lib/Type/Coercion.pm - lib/Type/Coercion/FromMoose.pm - lib/Type/Coercion/Union.pm - lib/Type/Library.pm - lib/Type/Params.pm - lib/Type/Parser.pm - lib/Type/Registry.pm - lib/Type/Tiny.pm - lib/Type/Tiny/Class.pm - lib/Type/Tiny/Duck.pm - lib/Type/Tiny/Enum.pm - lib/Type/Tiny/Intersection.pm - lib/Type/Tiny/Manual.pod - lib/Type/Tiny/Manual/Coercions.pod - lib/Type/Tiny/Manual/Libraries.pod - lib/Type/Tiny/Manual/Optimization.pod - lib/Type/Tiny/Manual/Params.pod - lib/Type/Tiny/Manual/Policies.pod - lib/Type/Tiny/Manual/UsingWithMoo.pod - lib/Type/Tiny/Manual/UsingWithMoose.pod - lib/Type/Tiny/Manual/UsingWithMouse.pod - lib/Type/Tiny/Manual/UsingWithOther.pod - lib/Type/Tiny/Role.pm - lib/Type/Tiny/Union.pm - lib/Type/Utils.pm - lib/Types/Common/Numeric.pm - lib/Types/Common/String.pm - lib/Types/Standard.pm - lib/Types/Standard/ArrayRef.pm - lib/Types/Standard/Dict.pm - lib/Types/Standard/HashRef.pm - lib/Types/Standard/Map.pm - lib/Types/Standard/ScalarRef.pm - lib/Types/Standard/Tuple.pm - lib/Types/TypeTiny.pm - t/00-begin.t - t/01-compile.t - t/02-api.t - t/03-leak.t - t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t - t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t - t/20-unit/Error-TypeTiny-Assertion/basic.t - t/20-unit/Error-TypeTiny-Compilation/basic.t - t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t - t/20-unit/Error-TypeTiny/basic.t - t/20-unit/Error-TypeTiny/stacktrace.t - t/20-unit/Eval-TypeTiny/basic.t - t/20-unit/Eval-TypeTiny/fallback-aliases.t - t/20-unit/Eval-TypeTiny/lexical-subs.t - t/20-unit/Test-TypeTiny/basic.t - t/20-unit/Test-TypeTiny/extended.t - t/20-unit/Test-TypeTiny/matchfor.t - t/20-unit/Type-Coercion-FromMoose/basic.t - t/20-unit/Type-Coercion-FromMoose/errors.t - t/20-unit/Type-Coercion-Union/basic.t - t/20-unit/Type-Coercion/basic.t - t/20-unit/Type-Coercion/esoteric.t - t/20-unit/Type-Coercion/frozen.t - t/20-unit/Type-Coercion/inlining.t - t/20-unit/Type-Coercion/smartmatch.t - t/20-unit/Type-Coercion/typetiny-constructor.t - t/20-unit/Type-Library/assert.t - t/20-unit/Type-Library/errors.t - t/20-unit/Type-Library/is.t - t/20-unit/Type-Library/to.t - t/20-unit/Type-Library/types.t - t/20-unit/Type-Params/badsigs.t - t/20-unit/Type-Params/carping.t - t/20-unit/Type-Params/coerce.t - t/20-unit/Type-Params/methods.t - t/20-unit/Type-Params/mixednamed.t - t/20-unit/Type-Params/multisig.t - t/20-unit/Type-Params/named.t - t/20-unit/Type-Params/noninline.t - t/20-unit/Type-Params/optional.t - t/20-unit/Type-Params/positional.t - t/20-unit/Type-Params/slurpy.t - t/20-unit/Type-Parser/basic.t - t/20-unit/Type-Parser/moosextypes.t - t/20-unit/Type-Registry/automagic.t - t/20-unit/Type-Registry/basic.t - t/20-unit/Type-Registry/methods.t - t/20-unit/Type-Registry/moosextypes.t - t/20-unit/Type-Registry/mousextypes.t - t/20-unit/Type-Tiny-Class/basic.t - t/20-unit/Type-Tiny-Class/errors.t - t/20-unit/Type-Tiny-Class/plus-constructors.t - t/20-unit/Type-Tiny-Duck/basic.t - t/20-unit/Type-Tiny-Duck/errors.t - t/20-unit/Type-Tiny-Enum/basic.t - t/20-unit/Type-Tiny-Enum/errors.t - t/20-unit/Type-Tiny-Intersection/basic.t - t/20-unit/Type-Tiny-Intersection/errors.t - t/20-unit/Type-Tiny-Role/basic.t - t/20-unit/Type-Tiny-Role/errors.t - t/20-unit/Type-Tiny-Union/basic.t - t/20-unit/Type-Tiny-Union/errors.t - t/20-unit/Type-Tiny/arithmetic.t - t/20-unit/Type-Tiny/basic.t - t/20-unit/Type-Tiny/coercion-modifiers.t - t/20-unit/Type-Tiny/esoteric.t - t/20-unit/Type-Tiny/my-methods.t - t/20-unit/Type-Tiny/parameterization.t - t/20-unit/Type-Tiny/shortcuts.t - t/20-unit/Type-Tiny/smartmatch.t - t/20-unit/Type-Tiny/syntax.t - t/20-unit/Type-Tiny/to-moose.t - t/20-unit/Type-Tiny/to-mouse.t - t/20-unit/Type-Utils/classifier.t - t/20-unit/Type-Utils/dwim-both.t - t/20-unit/Type-Utils/dwim-moose.t - t/20-unit/Type-Utils/dwim-mouse.t - t/20-unit/Type-Utils/match-on-type.t - t/20-unit/Type-Utils/warnings.t - t/20-unit/Types-Standard/basic.t - t/20-unit/Types-Standard/deep-coercions.t - t/20-unit/Types-Standard/lockdown.t - t/20-unit/Types-Standard/mxtmlb-alike.t - t/20-unit/Types-Standard/optlist.t - t/20-unit/Types-Standard/overload.t - t/20-unit/Types-Standard/strmatch.t - t/20-unit/Types-Standard/structured.t - t/20-unit/Types-Standard/tied.t - t/20-unit/Types-TypeTiny/basic.t - t/20-unit/Types-TypeTiny/coercion.t - t/20-unit/Types-TypeTiny/meta.t - t/30-integration/Exporter-Tiny/basic.t - t/30-integration/Exporter-Tiny/installer.t - t/30-integration/Exporter-Tiny/role-conflict.t - t/30-integration/Function-Parameters/basic.t - t/30-integration/Kavorka/basic.t - t/30-integration/Moo/basic.t - t/30-integration/Moo/coercion-inlining-avoidance.t - t/30-integration/Moo/coercion.t - t/30-integration/Moo/exceptions.t - t/30-integration/Moo/inflation.t - t/30-integration/Moo/inflation2.t - t/30-integration/Moops/basic.t - t/30-integration/Moops/library-keyword.t - t/30-integration/Moose/accept-moose-types.t - t/30-integration/Moose/basic.t - t/30-integration/Moose/coercion.t - t/30-integration/Moose/inflate-then-inline.t - t/30-integration/Moose/native-attribute-traits.t - t/30-integration/MooseX-Types/basic.t - t/30-integration/MooseX-Types/extending.t - t/30-integration/MooseX-Types/more.t - t/30-integration/Mouse/basic.t - t/30-integration/Mouse/coercion.t - t/30-integration/MouseX-Types/basic.t - t/30-integration/MouseX-Types/extending.t - t/30-integration/Object-Accessor/basic.t - t/30-integration/Return-Type/basic.t - t/30-integration/Sub-Quote/basic.t - t/30-integration/Sub-Quote/unquote-coercions.t - t/30-integration/Sub-Quote/unquote-constraints.t - t/30-integration/Switcheroo/basic.t - t/30-integration/Type-Tie/basic.t - t/30-integration/Validation-Class-Simple/archaic.t - t/30-integration/Validation-Class-Simple/basic.t - t/30-integration/match-simple/basic.t - t/lib/BiggerLib.pm - t/lib/DemoLib.pm -Copyright: 2013, Toby Inkster - 2013-2014, Toby Inkster - 2014, Toby Inkster -License: UNKNOWN - FIXME - -Files: CREDITS - INSTALL - MANIFEST - META.json - META.yml - Makefile.PL - NEWS - SIGNATURE - TODO - debian/README.source - debian/compat - debian/control - debian/control.in - debian/gbp.conf - debian/source/format - debian/watch - dist.ini - examples/versus-scalar-validation.pl - inc/Test/Fatal.pm - inc/Test/Requires.pm - t/README - t/TODO - t/mk-test-manifest.pl - t/not-covered.pl -Copyright: *No copyright* -License: UNKNOWN - FIXME - -Files: t/40-regression/rt85911.t - t/40-regression/rt86004.t - t/40-regression/rt90096-2.t - t/40-regression/rt92571-2.t - t/40-regression/rt92571.t - t/40-regression/rt92591.t - t/40-regression/rt94196.t - t/40-regression/rt97684.t -Copyright: 2013-2014, Diab Jerius - 2014, Diab Jerius -License: UNKNOWN - FIXME - -Files: lib/Type/Tiny/_HalfOp.pm - t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t - t/40-regression/73f51e2d.pl - t/40-regression/73f51e2d.t -Copyright: 2014, Graham Knop -License: UNKNOWN - FIXME - -Files: t/20-unit/Types-Common-Numeric/basic.t - t/20-unit/Types-Common-String/basic.t - t/20-unit/Types-Common-String/coerce.t - t/20-unit/Types-Common-String/unicode.t -Copyright: 2013-2014, Matt S Trout - mst (at) shadowcatsystems.co.uk (L) -License: UNKNOWN - FIXME - -Files: t/40-regression/rt86233.t - t/40-regression/rt86239.t -Copyright: 2013-2014, Vyacheslav Matyukhin -License: UNKNOWN - FIXME - -Files: debian/rules -Copyright: 2013-2014, Jonas Smedegaard -License: GPL-3+ - FIXME - -Files: LICENSE -Copyright: 1989, Free Software Foundation, Inc - 19xx name of author - 19yy - 2014, Toby Inkster - disclaimer" for the program, if - interest in the - the software, and -License: GPL-ever - FIXME - -Files: Changes -Copyright: 2014 -License: UNKNOWN - FIXME - -Files: doap.ttl -Copyright: 2014."; -License: UNKNOWN - FIXME - -Files: t/30-integration/MooseX-Getopt/coercion.t -Copyright: 2014, Alexander Hartmaier -License: UNKNOWN - FIXME - -Files: t/40-regression/rt98113.t -Copyright: 2014, Dagfinn Ilmari Mannsåker -License: UNKNOWN - FIXME - -Files: t/30-integration/Class-InsideOut/basic.t -Copyright: 2013-2014, David Golden, Toby Inkster -License: UNKNOWN - FIXME - -Files: t/99-moose-std-types-test.t -Copyright: 2013-2014, Infinity Interactive, Inc. -License: UNKNOWN - FIXME - -Files: t/40-regression/ttxs-gh1.t -Copyright: 2014, Jed Lund -License: UNKNOWN - FIXME - -Files: COPYRIGHT -Copyright: 1970, Toby Inkster - 2014, MATSUNO Tokuhiro - 2014, Ricardo Signes - 2014, Toby Inkster - 2014, Yuval Kogman - 2014, the holder(s) - None - This software is 2013, by Toby Inkster - This software is 2013-2014, by David Golden, Toby Inkster - This software is 2013-2014, by Diab Jerius - This software is 2013-2014, by Infinity Interactive, Inc. - This software is 2013-2014, by Matt S Trout - mst (at) shadowcatsystems.co.uk (L) - This software is 2013-2014, by Richard Simões - This software is 2013-2014, by Samuel Kaufman - This software is 2013-2014, by Toby Inkster - This software is 2013-2014, by Vyacheslav Matyukhin - This software is 2014, by Alexander Hartmaier - This software is 2014, by Dagfinn Ilmari MannsÃ¥ker - This software is 2014, by Diab Jerius - This software is 2014, by Graham Knop - This software is 2014, by Jed Lund - This software is 2014, by Toby Inkster - Unknown -License: UNKNOWN - FIXME - -Files: t/20-unit/Type-Coercion/parameterized.t -Copyright: Paris", "Garçon" - Paris|Garçon"; -License: UNKNOWN - FIXME - -Files: t/20-unit/Type-Library/inheritance.t -Copyright: 2013-2014, Toby Inkster - Paris", "Garçon" -License: UNKNOWN - FIXME - -Files: t/40-regression/gh1.t -Copyright: 2013-2014, Richard Simões -License: UNKNOWN - FIXME - -Files: t/40-regression/rt90096.t -Copyright: 2013-2014, Samuel Kaufman -License: UNKNOWN - FIXME - -Files: inc/Try/Tiny.pm -Copyright: 2014, Yuval Kogman -License: UNKNOWN - FIXME - diff -Nru libtype-tiny-perl-1.000005/debian/gbp.conf libtype-tiny-perl-1.004004/debian/gbp.conf --- libtype-tiny-perl-1.000005/debian/gbp.conf 2014-04-30 00:41:08.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/gbp.conf 2019-01-11 19:46:19.000000000 +0000 @@ -3,6 +3,4 @@ [DEFAULT] pristine-tar = True sign-tags = True - -[git-import-orig] -filter = .gitignore +filter = */.git* diff -Nru libtype-tiny-perl-1.000005/debian/libtype-tiny-perl.docs libtype-tiny-perl-1.004004/debian/libtype-tiny-perl.docs --- libtype-tiny-perl-1.000005/debian/libtype-tiny-perl.docs 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/libtype-tiny-perl.docs 2019-01-11 19:46:19.000000000 +0000 @@ -0,0 +1,4 @@ +CREDITS +NEWS +TODO +CONTRIBUTING.pod diff -Nru libtype-tiny-perl-1.000005/debian/libtype-tiny-perl.examples libtype-tiny-perl-1.004004/debian/libtype-tiny-perl.examples --- libtype-tiny-perl-1.000005/debian/libtype-tiny-perl.examples 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/libtype-tiny-perl.examples 2019-01-11 19:46:19.000000000 +0000 @@ -0,0 +1 @@ +examples/* diff -Nru libtype-tiny-perl-1.000005/debian/README.source libtype-tiny-perl-1.004004/debian/README.source --- libtype-tiny-perl-1.000005/debian/README.source 2014-04-30 00:41:08.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/README.source 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -CDBS+git-buildpackage ---------------------- - -This source package uses CDBS and git-buildpackage. NMUs need not (but -are encouraged to) make special use of these tools. In particular, the -debian/control.in file can be completely ignored. - -More info here: http://wiki.debian.org/CDBS+git-buildpackage - - - -- Jonas Smedegaard Mon, 18 Feb 2013 12:55:37 +0100 diff -Nru libtype-tiny-perl-1.000005/debian/rules libtype-tiny-perl-1.004004/debian/rules --- libtype-tiny-perl-1.000005/debian/rules 2014-10-29 19:35:50.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/rules 2019-07-23 13:52:46.000000000 +0000 @@ -1,59 +1,8 @@ #!/usr/bin/make -f -# -*- mode: makefile; coding: utf-8 -*- -# Copyright © 2013-2014 Jonas Smedegaard -# Description: Main Debian packaging script for Type::Tiny -# -# 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 3, 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, see . -include /usr/share/cdbs/1/rules/upstream-tarball.mk -include /usr/share/cdbs/1/rules/utils.mk -include /usr/share/cdbs/1/class/perl-makemaker.mk -include /usr/share/cdbs/1/rules/debhelper.mk +%: + dh $@ -pkg = $(DEB_SOURCE_PACKAGE) - -DEB_UPSTREAM_PACKAGE = Type-Tiny -DEB_UPSTREAM_URL = http://www.cpan.org/authors/id/T/TO/TOBYINK - -# Needed by upstream testsuite -# TODO: add Sub::Exporter::Lexical and Function::Parameters when in Debian -perl-deps-test = moose mouse class-insideout -perl-deps-test += moosex-types mousex-types test-fatal test-tester -perl-deps-test += moosex-types-common test-warnings match-simple -perl-deps-test += moosex-getopt devel-hide -deps-test = $(patsubst %,$(comma) lib%-perl,$(perl-deps-test)) -deps-test +=, perl (>= 5.13.4) | libtest-simple-perl (>= 0.96) -deps-test +=, libmoo-perl (>= 1.001000) -deps-test +=, perl (>= 5.13.11) | libjson-pp-perl (>= 2.27105) -deps-test +=, libvalidation-class-perl (>= 7.900017) -deps-test +=, libobject-accessor-perl | perl (<= 5.18.2) - -# Needed by upstream testsuite and (always/seldom) at runtime -depends-test = libexporter-tiny-perl -suggests-test = libdevel-stacktrace-perl - -# Needed (often) at runtime -recommends = libdevel-lexalias-perl, libsub-name-perl, libtype-tiny-xs-perl - -# Improves other packages -# TODO: get libtype-tie-perl in Debian -enhances = libtype-tie-perl, libreply-perl - -CDBS_BUILD_DEPENDS +=, $(deps), $(deps-test), $(depends-test), $(suggests-test) -CDBS_DEPENDS_$(pkg) = $(deps), $(depends-test) -CDBS_RECOMMENDS_$(pkg) = $(recommends) -CDBS_SUGGESTS_$(pkg) = $(suggests-test) -CDBS_ENHANCES_$(pkg) = $(enhances) - -DEB_INSTALL_EXAMPLES_$(pkg) = examples/* +override_dh_auto_install: + dh_auto_install + rm --verbose debian/*/usr/share/perl5/Type/CONTRIBUTING.pod diff -Nru libtype-tiny-perl-1.000005/debian/source/lintian-overrides libtype-tiny-perl-1.004004/debian/source/lintian-overrides --- libtype-tiny-perl-1.000005/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/source/lintian-overrides 2019-07-23 13:52:46.000000000 +0000 @@ -0,0 +1,2 @@ +# Upstream release tarballs are not signed +libtype-tiny-perl source: debian-watch-does-not-check-gpg-signature diff -Nru libtype-tiny-perl-1.000005/debian/upstream/metadata libtype-tiny-perl-1.004004/debian/upstream/metadata --- libtype-tiny-perl-1.000005/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/upstream/metadata 2019-07-23 13:52:46.000000000 +0000 @@ -0,0 +1,8 @@ +--- +Archive: CPAN +Bug-Database: https://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny +Contact: Toby Inkster (TOBYINK) +Name: Type-Tiny +Repository: https://github.com/tobyink/p5-type-tiny.git +Repository-Browse: https://github.com/tobyink/p5-type-tiny +... diff -Nru libtype-tiny-perl-1.000005/debian/watch libtype-tiny-perl-1.004004/debian/watch --- libtype-tiny-perl-1.000005/debian/watch 2014-06-09 20:54:58.000000000 +0000 +++ libtype-tiny-perl-1.004004/debian/watch 2019-01-11 19:46:19.000000000 +0000 @@ -1,4 +1,2 @@ -# Run the "uscan" command to check for upstream updates and more. -version=3 -https://metacpan.org/release/Type-Tiny .*/Type-Tiny-([\d.]+)\.tar\.gz -http://www.cpan.org/authors/id/T/TO/TOBYINK/Type-Tiny-([\d.]+)\.tar\.gz +version=4 +https://metacpan.org/release/Type-Tiny .*/Type-Tiny@ANY_VERSION@@ARCHIVE_EXT@ diff -Nru libtype-tiny-perl-1.000005/doap.ttl libtype-tiny-perl-1.004004/doap.ttl --- libtype-tiny-perl-1.000005/doap.ttl 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/doap.ttl 2019-01-08 18:27:21.000000000 +0000 @@ -13,10 +13,26 @@ dc:title "the same terms as the perl 5 programming language system itself". + + a doap:Project; + doap:developer ; + doap:download-page ; + doap:homepage ; + doap:name "Acme-Types-NonStandard"; + doap:programming-language "Perl". + + + a doap:Project; + doap:developer ; + doap:download-page ; + doap:homepage ; + doap:name "List-Objects-Types"; + doap:programming-language "Perl". + a doap:Project; + cpan-uri:x_IRC ; dc:contributor ; - doap-bugs:issue , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ; doap-deps:develop-suggestion [ doap-deps:on "Dist::Inkt::Profile::TOBYINK"^^doap-deps:CpanId; rdfs:comment "This is used for building the release tarball."@en; @@ -32,34 +48,40 @@ doap-deps:on "perl 5.010001"^^doap-deps:CpanId; rdfs:comment "For smartmatch operator overloading; and to avoid some pre-5.10 hacks."@en; ], [ + doap-deps:on "Type::Tie"^^doap-deps:CpanId; + rdfs:comment "Type::Tie is needed if you want to constrain the type of a scalar, array or hash variable."@en; + ], [ + doap-deps:on "Devel::StackTrace"^^doap-deps:CpanId; + rdfs:comment "Type::Exception can use Devel::StackTrace for stack traces."@en; + ], [ doap-deps:on "Devel::LexAlias 0.05"^^doap-deps:CpanId; rdfs:comment "Devel::LexAlias is useful for some Eval::TypeTiny features."@en; ], [ - doap-deps:on "Type::Tiny::XS 0.010"^^doap-deps:CpanId; - rdfs:comment "Make stuff faster (I think)."@en; + doap-deps:on "Type::Tiny::XS 0.011"^^doap-deps:CpanId; + rdfs:comment "Makes a lot of stuff faster."@en; ], [ - doap-deps:on "Sub::Name"^^doap-deps:CpanId; - rdfs:comment "This allows Type::Library to name subs nicely."@en; + doap-deps:on "Ref::Util::XS 0.100"^^doap-deps:CpanId; + rdfs:comment "Makes some stuff faster."@en; ], [ - doap-deps:on "Type::Tie"^^doap-deps:CpanId; - rdfs:comment "Type::Tie is needed if you want to constrain the type of a scalar, array or hash variable."@en; + doap-deps:on "Regexp::Util 0.003"^^doap-deps:CpanId; + rdfs:comment "Saner serialization of StrMatch type constraints."@en; ], [ - doap-deps:on "Devel::StackTrace"^^doap-deps:CpanId; - rdfs:comment "Type::Exception can use Devel::StackTrace for stack traces."@en; + doap-deps:on "Sub::Util"^^doap-deps:CpanId; + rdfs:comment "This allows Type::Library to name subs nicely."@en; ]; doap-deps:runtime-requirement [ doap-deps:on "perl 5.006001"^^doap-deps:CpanId ], [ - doap-deps:on "Exporter::Tiny 0.026"^^doap-deps:CpanId; + doap-deps:on "Exporter::Tiny 0.040"^^doap-deps:CpanId; rdfs:comment "This module was spun off from the Type-Tiny distribution."@en; ]; doap-deps:runtime-suggestion [ - doap-deps:on "Moose 2.0400"^^doap-deps:CpanId; + doap-deps:on "Moose 2.0000"^^doap-deps:CpanId; rdfs:comment "Type::Tiny works nicely with Moose."@en; ], [ doap-deps:on "Mouse 1.00"^^doap-deps:CpanId; rdfs:comment "Type::Tiny works nicely with Mouse."@en; ], [ - doap-deps:on "Moo 1.000000"^^doap-deps:CpanId; - rdfs:comment "Type::Tiny works nicely with Moo."@en; + doap-deps:on "Moo 1.006000"^^doap-deps:CpanId; + rdfs:comment "Type::Tiny works nicely with Moo. Use Moo 1.006000 or above for best results."@en; ], [ doap-deps:on "Reply"^^doap-deps:CpanId; rdfs:comment "Type::Tiny bundles a plugin for Reply."@en; @@ -85,12 +107,13 @@ doap:maintainer ; doap:name "Type-Tiny"; doap:programming-language "Perl"; - doap:release , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ; + doap:release , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ; doap:repository [ a doap:GitRepository; doap:browse ; ]; - doap:shortdesc "tiny, yet Moo(se)-compatible type constraint". + doap:shortdesc "tiny, yet Moo(se)-compatible type constraint"; + doap:tester . a cpan-uri:DeveloperRelease, doap:Version; @@ -518,14 +541,14 @@ dc:issued "2013-04-17"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ + a doap-changeset:Addition; + rdfs:label "Add OptList data type to Types::Standard, plus MkOpt coercion."; + ], [ a doap-changeset:Change; rdfs:label "When inflating Moo type constraints to Moose, don't unnecessarily call 'moose_type' method."; ], [ a doap-changeset:Change; rdfs:label "Make Type::Tiny's has_coercion method more DWIM."; - ], [ - a doap-changeset:Addition; - rdfs:label "Add OptList data type to Types::Standard, plus MkOpt coercion."; ]; doap-changeset:versus ; ]; @@ -3925,117 +3948,964 @@ doap:file-release ; doap:revision "1.000005"^^xsd:string. - - a foaf:Agent; - foaf:mbox . - - - a foaf:Agent; - foaf:mbox . - - - a foaf:Agent; - foaf:mbox . - - - a foaf:Agent; - foaf:mbox . - - - a foaf:Agent; - foaf:mbox . - - - a foaf:Agent; - foaf:mbox . - - - a foaf:Agent; - foaf:mbox . - - - a foaf:Person; - foaf:name "Alexander Hartmaier"; - foaf:nick "ABRAXXA"; - foaf:page . + + a doap:Version; + dc:identifier "Type-Tiny-1.000006"^^xsd:string; + dc:issued "2017-01-30"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix, doap-changeset:Tests, doap-changeset:Update; + rdfs:label "Fix escaping within q{...} in a test case."; + doap-changeset:blame ; + doap-changeset:fixes ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.000006"^^xsd:string. - - a foaf:Person; - foaf:name "Brendan Byrd"; - foaf:nick "BBYRD"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_000"^^xsd:string; + dc:issued "2014-09-07"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Documentation; + rdfs:label "Updated NEWS file."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Updated TODO file."; + ], [ + a doap-changeset:Update; + rdfs:label "Want Type::Tiny::XS 0.011."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Fix issues with coercions and native attribute traits with some oldish versions of Moose on oldish versions of Perl."; + doap-changeset:fixes ; + doap-changeset:thanks ; + ], [ + a doap-changeset:Tests; + rdfs:label "Make some of the test case skip_all bits more ambitious; test older versions of Moose and Moo than we were testing before."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Fix for Type::Registry::DWIM."; + doap-changeset:fixes ; + doap-changeset:thanks ; + ], [ + a doap-changeset:Update; + rdfs:label "If Sub::Name is unavailable, but the shiny new core Sub::Util is available, then use it instead."; + ], [ + a doap-changeset:Addition; + rdfs:label "Type::Params now provides `compile_named` and `validate_named` functions which do the same thing as `compile` and `validate` but are better for named arguments."; + rdfs:comment "Several people have requested this."; + ], [ + a doap-changeset:Change; + rdfs:label "`Type::Utils::dwim_type` now allows more control over fallback behaviours."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Updates to Type::Tiny::Manual::UsingWithMoose, Type::Tiny::Manual::UsingWithMoo, and Type::Tiny::Manual::UsingWithMouse."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_000"^^xsd:string. - - a foaf:Person; - foaf:name "Kevin Dawson"; - foaf:nick "BOWTIE"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_001"^^xsd:string; + dc:issued "2014-09-19"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Update; + rdfs:label "Prefer Sub::Util over Sub::Name. (The former is smaller.)"; + ], [ + a doap-changeset:Change; + rdfs:label "Lazy-load Text::Balanced in Type::Parser. (Many parses don't even need it.)"; + ], [ + a doap-changeset:Change; + rdfs:label "Lazy-load Type::Tiny::Union in Type::Params."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_001"^^xsd:string. - - a foaf:Person; - foaf:name "David Golden"; - foaf:nick "DAGOLDEN"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_002"^^xsd:string; + dc:issued "2014-10-25"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix; + rdfs:label "Fix short-circuiting optimizations for parameterized HashRef, ArrayRef, ScalarRef, and Map type constraints."; + doap-changeset:fixes ; + doap-changeset:thanks ; + ], [ + a doap-changeset:Tests; + rdfs:label "Fix annoying warning message in test suite with recent versions of Exporter::Tiny."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Inlined version of Types::Standard::Int should check that the value is not a reference."; + ], [ + a doap-changeset:Change; + rdfs:label "Make equals/is_a_type_of/is_subtype_of/is_supertype_of in Type::Tiny::Union work more like Moose::Meta::TypeConstraint::Union."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_002"^^xsd:string. - - a foaf:Person; - foaf:name "Gianni Ceccarelli"; - foaf:nick "DAKKAR"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_003"^^xsd:string; + dc:issued "2017-02-02"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Update; + rdfs:label "Merge fixes from stable Type-Tiny 1.000006."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_003"^^xsd:string. - - a foaf:Agent, foaf:Person; - foaf:mbox ; - foaf:name "Diab Jerius"; - foaf:nick "DJERIUS"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_004"^^xsd:string; + dc:issued "2017-02-06"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Change; + rdfs:label "Attempting ArrayRef[Int, Int] or similar now throws an exception."; + doap-changeset:blame ; + doap-changeset:fixes ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_004"^^xsd:string. - - a foaf:Person; - foaf:name "Graham Knop"; - foaf:nick "HAARG"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_005"^^xsd:string; + dc:issued "2017-04-19"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "Bundle a test case for GH issue 14."; + rdfs:seeAlso ; + ], [ + a doap-changeset:Change; + rdfs:label "Improved error location reporting for Moo"; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Bugfix, doap-changeset:Tests; + rdfs:label "02-api.t should check version of Moose available."; + rdfs:seeAlso ; + ], [ + a doap-changeset:Bugfix, doap-changeset:Documentation; + rdfs:label "Fix minor typos in documentation for Types::Standard."; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Update; + rdfs:label "NumericCode now coerces from strings with whitespace in them, like MooseX::Types::Common::Numeric."; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Bugfix, doap-changeset:Documentation; + rdfs:label "Fix variable name typo in documentation for Type::Params."; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Bugfix, doap-changeset:Tests; + rdfs:label "20-unit/Type-Utils/warnings.t should check version of Test::Warnings."; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Include projected release date for Type::Tiny 1.002000 in NEWS."; + rdfs:comment "It's my birthday!"; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_005"^^xsd:string. - - a foaf:Person; - foaf:name "Dagfinn Ilmari Mannsker"; - foaf:nick "ILMARI"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_006"^^xsd:string; + dc:issued "2017-04-30"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Change; + rdfs:label "Localize $SIG{__DIE__} in Type::Registry."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Change; + rdfs:label "Allow Type::Tiny's `constraint` parameter to be a string of Perl code."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_006"^^xsd:string. - - a foaf:Person; - foaf:name "Ingy dt Net"; - foaf:nick "INGY"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + rdfs:label "May the fourth be with you"; + dc:identifier "Type-Tiny-1.001_007"^^xsd:string; + dc:issued "2017-05-04"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Change; + rdfs:label "Optimizations for Tuple and StrMatch type constraints from Types::Standard."; + ], [ + a doap-changeset:Change; + rdfs:label "Optimization of Type::Params positional parameter checking for simple cases with no slurpy parameter and no coercions."; + ], [ + a doap-changeset:Addition; + rdfs:label "Type::Params' `multisig` function now sets a variable `${^TYPE_PARAMS_MULTISIG}` to indicate which signature succeeded."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Comparison of Type::Params with new(ish) CPAN module Params::ValidationCompiler."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Show example of how to set defaults for parameters with Type::Params."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_007"^^xsd:string. - - a foaf:Person; - foaf:name "Jason R Mash"; - foaf:nick "JRMASH"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_008"^^xsd:string; + dc:issued "2017-05-10"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Documentation; + rdfs:label "Rearrange the examples directory in the distribution."; + ], [ + a doap-changeset:Addition; + rdfs:label "Named parameter validation benchmarking script."; + ], [ + a doap-changeset:Addition; + rdfs:label "Reduce scope of local $SIG{__DIE__} in Type::Registry."; + doap-changeset:thanks ; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Type::Params should make sure Type::Utils is loaded before calling english_list()."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_008"^^xsd:string. - - a foaf:Person; - foaf:name "Peter Karman"; - foaf:nick "KARMAN"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_009"^^xsd:string; + dc:issued "2017-05-13"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Change; + rdfs:label "Use Ref::Util::XS (if it's installed) to speed up certain type checks."; + ], [ + a doap-changeset:Change; + rdfs:label "Rewrite some benchmarking scripts to use Benchmark::Featureset::ParamCheck."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_009"^^xsd:string. - - a foaf:Person; - foaf:name "Mark Stosberg"; - foaf:nick "MARKSTOS"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + rdfs:label "Puppiversary"; + dc:identifier "Type-Tiny-1.001_010"^^xsd:string; + dc:issued "2017-05-16"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "t/00-begin.t will now work around ANDK's apparently broken XS testing environment."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_010"^^xsd:string. - - a foaf:Person; - foaf:name "Marcel Timmerman"; - foaf:nick "MARTIMM"; - foaf:page . + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_011"^^xsd:string; + dc:issued "2017-05-17"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix; + rdfs:label "Type constraints like Tuple[Int] shouldn't report they have a coercion if Int doesn't have a coercion."; + ], [ + a doap-changeset:Addition; + rdfs:label "Types::Standard now has a CycleTuple type."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_011"^^xsd:string. - - a foaf:Person; - foaf:name "Matt Phillips"; - foaf:nick "MATTP"; + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_012"^^xsd:string; + dc:issued "2017-05-17"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:BackCompat, doap-changeset:Change; + rdfs:label "RegexpRef now accepts blessed objects if $object->isa('Regexp') returns true."; + rdfs:comment "For compatibility with re::engine::RE2 and similar modules."; + ], [ + a doap-changeset:Change; + rdfs:label "StrMatch will use Regexp::Util (if available) to inline regular expressions more sensibly."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_012"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + rdfs:label "Kittiversary"; + dc:identifier "Type-Tiny-1.001_013"^^xsd:string; + dc:issued "2017-05-18"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix; + rdfs:label "StrMatch changes in previous release broke the ability to check type equality between two parameterized StrMatch types under some circumstances. Changed how the hash key for stashing regexp references gets built — is now closer to the old way. This doesn't revert the change in 1.001_012 where regexp checks can be inlined better, but only applies to those regexp references that can't easily be inlined."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Fixed crazy amount of UTF-8 warnings from Type::Params on Perl 5.6.x and Perl 5.8.x."; + doap-changeset:fixes ; + doap-changeset:thanks ; + rdfs:seeAlso ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_013"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_014"^^xsd:string; + dc:issued "2017-05-19"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Change; + rdfs:label "Include trailing line break at the end of stringified version of some exceptions."; + doap-changeset:thanks ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_014"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_015"^^xsd:string; + dc:issued "2017-05-20"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix; + rdfs:label "Fix HashRef[Str]|Undef|Str parsing on Perl < 5.14."; + doap-changeset:fixes ; + doap-changeset:thanks , ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_015"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.001_016"^^xsd:string; + dc:issued "2017-05-30"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Documentation; + rdfs:label "Include page-numbers.pl example"; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.001_016"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.002000"^^xsd:string; + dc:issued "2017-06-01"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Packaging; + rdfs:label "Stable version number."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.002000"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.002001"^^xsd:string; + dc:issued "2017-06-08"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Packaging; + rdfs:label "Ref::Util::XS 0.100 should be recommended, not 0.200 (which doesn't exist yet)."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Tests; + rdfs:label "Skip t/30-integration/Moose/native-attribute-traits.t on older Moose because Test::Moose is broken."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.002001"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_000"^^xsd:string; + dc:issued "2018-05-20"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Packaging; + rdfs:label "Ref::Util::XS 0.100 should be recommended, not 0.200 (which doesn't exist yet)."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Tests; + rdfs:label "Skip t/30-integration/Moose/native-attribute-traits.t on older Moose because Test::Moose is broken."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Compatibility with constants and with CV-in-stash optimisation."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Addition; + rdfs:label "Type::Params now exports a compile_named_oo function which returns a parameters object."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Improvements to Type::Params documentation."; + ], [ + a doap-changeset:Addition; + rdfs:label "Type::Params now supports parameter defaults."; + ], [ + a doap-changeset:Addition; + rdfs:label "Type::Params compile_named now supports bless/class/constructor options."; + ], [ + a doap-changeset:Change; + rdfs:label "Don't use Type::Tiny::XS's implementation of PositiveInt in Types::Common::Numeric unless Type::Tiny::XS >= 0.013."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Document Type::Library's :coercion export tag."; + doap-changeset:blame ; + ], [ + a doap-changeset:Addition; + rdfs:label "Allow Type::Coercion's add_type_coercion to accept a Type::Coercion object, which was already documented as working."; + doap-changeset:blame ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Fix typo."; + doap-changeset:blame ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Add a new CONTRIBUTING.pod file."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_000"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_001"^^xsd:string; + dc:issued "2018-05-22"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Change; + rdfs:label "Don't use Type::Tiny::XS's implementation of Bool in Types::Standard unless Type::Tiny::XS >= 0.014."; + ], [ + a doap-changeset:Change; + rdfs:label "Looser definition of FileHandle in Types::Standard."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Tests; + rdfs:label "Tests for coercions to CycleTuple from Types::Standard with non-inlineable type constraints."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_001"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_002"^^xsd:string; + dc:issued "2018-05-28"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Addition; + rdfs:label "Types::Common::Numeric now has NumRange and IntRange types."; + ], [ + a doap-changeset:Addition; + rdfs:label "Types::Common::String now has a StrLength type."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_002"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_003"^^xsd:string; + dc:issued "2018-06-10"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:BackCompat, doap-changeset:Change; + rdfs:label "Bool (Types::Standard) is stricter, no longer allowing blessed objects that overload stringification because that's weird."; + ], [ + a doap-changeset:Addition; + rdfs:label "Bool now allows coercion from Any."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_003"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_004"^^xsd:string; + dc:issued "2018-06-12"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix, doap-changeset:Tests; + rdfs:label "Load modules with `use` instead of `require` in 00-begin.t."; + doap-changeset:fixes ; + doap-changeset:thanks , ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_004"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_005"^^xsd:string; + dc:issued "2018-07-05"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Addition; + rdfs:label "Allow type libraries to mark certain type constraints as deprecated."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Type::Tiny::Manual::Coercions improvements."; + doap-changeset:fixes ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_005"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_006"^^xsd:string; + dc:issued "2018-07-08"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "Improve coverage."; + ], [ + a doap-changeset:Addition; + rdfs:label "Type::Params compile/compile_named now have subname and description options."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Type::Params caller_level option is now documented."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Workaround for Regexp-based check for Int clobbering $1 sometimes (this will sometimes slow down Int checks a little, but is needed for correctness)."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Fix issues with arrayref and hashref defaults in Type::Params."; + ], [ + a doap-changeset:Addition; + rdfs:label "PERL_TYPE_PARAMS_XS environment variable."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Better documentation of environment variables."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_006"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_007"^^xsd:string; + dc:issued "2018-07-12"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "Improve coverage."; + ], [ + a doap-changeset:Tests; + rdfs:label "Add tests for deep coercions in Tuples."; + ], [ + a doap-changeset:Tests; + rdfs:label "Restructure Types::TypeTiny test cases so more of them run when Moose and Mouse aren't available."; + ], [ + a doap-changeset:Change; + rdfs:label "Improve progressive exporter in Types::TypeTiny to avoid loading Exporter::TypeTiny more often."; + ], [ + a doap-changeset:Change; + rdfs:label "Types::Standard does better at checking the parameters of parameterized types are valid."; + ], [ + a doap-changeset:Tests; + rdfs:label "Better tests for Eval::TypeTiny's implementations of alias=>1."; + ], [ + a doap-changeset:Update; + rdfs:label "Eval::TypeTiny now supports Perl 5.22 refaliasing as the preferred implementation of alias => 1."; + ], [ + a doap-changeset:Addition; + rdfs:label "Eval::TypeTiny now supports PadWalker as a fallback implementation of alias => 1."; + ], [ + a doap-changeset:Change; + rdfs:label "Eval::TypeTiny will now throw errors when it detects a mismatch between sigils and reference types in the environment hashref but only if EXTENDED_TESTING environment variable is true. Perl will probably give you its own error message for this later on anyway."; + ], [ + a doap-changeset:Removal; + rdfs:label "Eval::TypeTiny::HAS_LEXICAL_VARS constant is no longer documented and will be removed at a later date."; + ], [ + a doap-changeset:Addition; + rdfs:label "Eval::TypeTiny provides a collection of constants to indicate the current implementation of alias => 1."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_007"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_008"^^xsd:string; + dc:issued "2018-07-16"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "Improve test coverage."; + ], [ + a doap-changeset:Regression, doap-changeset:Update; + rdfs:label "Make Error::TypeTiny aware of some newer internal modules."; + ], [ + rdfs:label "Improve processing of parameters to Types::Standard's parameterized type constraints"; + ], [ + a doap-changeset:Change; + rdfs:label "Types::Common::Numeric's IntRange and NumRange do better checking of parameters."; + ], [ + a doap-changeset:Change; + rdfs:label "Types::Common::String's StrLength does better checking of parameters."; + ], [ + a doap-changeset:Tests; + rdfs:label "Test Type::Utils' match_on_type's support for wantarray on strings of code."; + ], [ + a doap-changeset:Change; + rdfs:label "Simplify how Type::Registry generates the `t()` function."; + ], [ + a doap-changeset:Change; + rdfs:label "Split out some code from Types::Standard into autoloaded modules to speed up loading."; + ], [ + a doap-changeset:Bugfix; + rdfs:label "Fix error messages generating deep explanations of some parameterized types."; + doap-changeset:fixes ; + doap-changeset:thanks ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_008"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_009"^^xsd:string; + dc:issued "2018-07-24"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "Improve testing of Test::TypeTiny itself; the matchfor() function in particular."; + ], [ + a doap-changeset:Tests; + rdfs:label "Test bad parameters to NumRange and IntRange."; + ], [ + a doap-changeset:Tests; + rdfs:label "Test late loading of Sub::Quote."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Better documentation of parameterization API."; + ], [ + a doap-changeset:Change; + rdfs:label "Types::Standard::Defined->complementary_type will now return Types::Standard::Undef, and vice versa."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_009"^^xsd:string. + + + a cpan-uri:DeveloperRelease, doap:Version; + dc:identifier "Type-Tiny-1.003_010"^^xsd:string; + dc:issued "2018-07-25"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Tests; + rdfs:label "Improve test coverage for Type::Utils, Type::Coercion, Types::Standard::Tuple, Eval::TypeTiny, Type::Registry, Type::Tiny::Class, and Types::Standard::Tied."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.003_010"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.004000"^^xsd:string; + dc:issued "2018-07-27"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Packaging; + rdfs:label "Repackage as a stable release. No functional changes since 1.003_010."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Update TODO."; + ], [ + a doap-changeset:Documentation; + rdfs:label "Update NEWS."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.004000"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.004001"^^xsd:string; + dc:issued "2018-07-28"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix; + rdfs:label "Add Eval::TypeTiny::Sandbox to the list of packages which should be skipped as internal by Error::TypeTiny, as it was mistakenly removed in 1.003_008."; + doap-changeset:fixes ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Correct release date of 1.004000 in change log."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.004001"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.004002"^^xsd:string; + dc:issued "2018-07-29"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix, doap-changeset:Tests; + rdfs:label "Skip one particular test on old versions of Moo because it relies on a feature introduced in Moo 1.004000."; + doap-changeset:fixes ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.004002"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.004003"^^xsd:string; + dc:issued "2019-01-08"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix; + rdfs:label "Fix spelling in error message for Types::Common::String LowerCaseSimpleStr."; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Fix Types::Standard documentation error: incorrect third-party module name."; + doap-changeset:blame ; + rdfs:seeAlso ; + ], [ + a doap-changeset:Documentation; + rdfs:label "Fix Type::Params documentation error."; + doap-changeset:blame ; + rdfs:seeAlso ; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.004003"^^xsd:string. + + + a doap:Version; + dc:identifier "Type-Tiny-1.004004"^^xsd:string; + dc:issued "2019-01-08"^^xsd:date; + doap-changeset:changeset [ + doap-changeset:item [ + a doap-changeset:Bugfix, doap-changeset:Packaging; + rdfs:label "Depend on Exporter::Tiny 0.040; older versions don't provide all the functions Type::Library needs."; + ]; + doap-changeset:versus ; + ]; + doap-changeset:released-by ; + doap:file-release ; + doap:revision "1.004004"^^xsd:string. + + + a foaf:Person; + foaf:name "Alexander Hartmaier"; + foaf:nick "ABRAXXA"; + foaf:page . + + + a foaf:Person; + foaf:name "Andreas J König"; + foaf:nick "ANDK"; + foaf:page . + + + a foaf:Person; + foaf:name "Jon Portnoy"; + foaf:nick "AVENJ"; + foaf:page . + + + a foaf:Person; + foaf:name "Brendan Byrd"; + foaf:nick "BBYRD"; + foaf:page . + + + a foaf:Person; + foaf:name "Aran Clary Deltac"; + foaf:nick "BLUEFEET"; + foaf:page . + + + a foaf:Person; + foaf:name "Philippe Bruhat"; + foaf:nick "BOOK"; + foaf:page . + + + a foaf:Person; + foaf:name "Kevin Dawson"; + foaf:nick "BOWTIE"; + foaf:page . + + + a foaf:Person; + foaf:name "David Golden"; + foaf:nick "DAGOLDEN"; + foaf:page . + + + a foaf:Person; + foaf:name "Gianni Ceccarelli"; + foaf:nick "DAKKAR"; + foaf:page . + + + a foaf:Person; + foaf:name "Diab Jerius"; + foaf:nick "DJERIUS"; + foaf:page . + + + a foaf:Person; + foaf:name "Karen Etheridge"; + foaf:nick "ETHER"; + foaf:page . + + + a foaf:Person; + foaf:name "Graham Knop"; + foaf:nick "HAARG"; + foaf:page . + + + a foaf:Person; + foaf:name "Dagfinn Ilmari Mannsåker"; + foaf:nick "ILMARI"; + foaf:page . + + + a foaf:Person; + foaf:name "Ingy döt Net"; + foaf:nick "INGY"; + foaf:page . + + + a foaf:Person; + foaf:name "Jason R Mash"; + foaf:nick "JRMASH"; + foaf:page . + + + a foaf:Person; + foaf:name "Peter Karman"; + foaf:nick "KARMAN"; + foaf:page . + + + a foaf:Person; + foaf:name "Mark Stosberg"; + foaf:nick "MARKSTOS"; + foaf:page . + + + a foaf:Person; + foaf:name "Marcel Timmerman"; + foaf:nick "MARTIMM"; + foaf:page . + + + a foaf:Person; + foaf:name "Matt Phillips"; + foaf:nick "MATTP"; foaf:page . @@ -4045,8 +4915,7 @@ foaf:page . - a foaf:Agent, foaf:Person; - foaf:mbox ; + a foaf:Person; foaf:name "Michael G Schwern"; foaf:nick "MSCHWERN"; foaf:page . @@ -4081,9 +4950,15 @@ foaf:nick "RJBS"; foaf:page . + + a foaf:Person; + foaf:name "Robert Rothenberg"; + foaf:nick "RRWO"; + foaf:page , . + a foaf:Person; - foaf:name "Richard Simes"; + foaf:name "Richard Simões"; foaf:nick "RSIMOES"; foaf:page . @@ -4105,6 +4980,12 @@ foaf:nick "SPICEMAN"; foaf:page . + + a foaf:Person; + foaf:name "Slaven Rezić"; + foaf:nick "SREZIC"; + foaf:page . + a foaf:Person; foaf:name "Steven Lee"; @@ -4130,65 +5011,118 @@ foaf:nick "TOKUHIROM"; foaf:page . + + a foaf:Person; + foaf:name "Thomas Sibley"; + foaf:nick "TSIBLEY"; + foaf:page , . + a foaf:Person; foaf:name "Caleb Cushing"; foaf:nick "XENO"; foaf:page . - + + a doap-bugs:Issue; + doap-bugs:id "100780"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "101582"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "105299"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "114386"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "121762"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "121764"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "121981"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "122305"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "123408"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "124067"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "124728"^^xsd:string; + doap-bugs:page . + + + a doap-bugs:Issue; + doap-bugs:id "125132"^^xsd:string; + doap-bugs:page ; + doap-tests:regression_test [ + a doap-tests:RegressionTest; + doap-tests:purpose "Test inlined Int type check clobbering '$1'."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/40-regression/rt125132.t"; + ]; + ]. + + + a doap-bugs:Issue; + doap-bugs:id "125765"^^xsd:string; + doap-bugs:page ; + doap-tests:regression_test [ + a doap-tests:RegressionTest; + doap-tests:purpose "Check weird error doesn't happen with deep explain."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/40-regression/rt125765.t"; + ]; + ]. + + + a doap-bugs:Issue; + doap-bugs:id "125942"^^xsd:string; + doap-bugs:page . + + a doap-bugs:Issue; - rdfs:label "Confusing error message if required slurpy Dict not present in parameter list"; - dc:created "2013-05-05T03:35:42+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "85054"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "exception objects"; - dc:created "2013-05-09T04:52:37+01:00"^^xsd:dateTime; - dc:reporter _:B1; - doap-bugs:id "85149"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Type::Library has wrong VERSION variable"; - dc:created "2013-05-30T03:53:03+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "85720"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "support for optional arguments"; - dc:created "2013-05-30T14:11:03+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "85732"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "125948"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Type comparison not working on 5.8"; - dc:created "2013-06-05T18:39:56+01:00"^^xsd:dateTime; - dc:reporter [ a foaf:Agent; foaf:mbox ]; - doap-bugs:id "85895", "85895"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "85895"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "\"coercion cannot be inlined\" error w/ Type::Params::compile & Dict"; - dc:created "2013-06-06T04:00:30+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "85911", "85911"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "85911"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Test Type::Params with deep Dict coercion."; @@ -4205,12 +5139,8 @@ a doap-bugs:Issue; - rdfs:label "type constraint fails after coercion if too many elements in Dict"; - dc:created "2013-06-08T23:03:45+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "86004", "86004"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "86004"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Test Type::Params with more complex Dict coercion."; @@ -4222,21 +5152,13 @@ a doap-bugs:Issue; - rdfs:label "Missing coercion with Moose and Type::Tiny"; - dc:created "2013-06-15T22:30:28+01:00"^^xsd:dateTime; - dc:reporter _:B2; - doap-bugs:id "86172", "86172"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "86172"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "\"Cannot inline type constraint check\" erro with compile and Dict"; - dc:created "2013-06-18T15:23:52+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "86233", "86233"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "86233"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Fix: \"Cannot inline type constraint check\" error with compile and Dict."; @@ -4248,12 +5170,8 @@ a doap-bugs:Issue; - rdfs:label "Optional constraints ignored if wrapped in Dict"; - dc:created "2013-06-18T16:34:37+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "86239", "86239"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "86239"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Fix: Optional constraints ignored if wrapped in Dict."; @@ -4270,264 +5188,108 @@ a doap-bugs:Issue; - rdfs:label "Can't locate object method \"NAME\" via package \"B::SPECIAL\""; - dc:created "2013-06-24T14:48:37+01:00"^^xsd:dateTime; - dc:reporter _:B2; - doap-bugs:id "86383", "86383"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "86383"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "'extends' is not declared"; - dc:created "2013-07-09T18:53:01+01:00"^^xsd:dateTime; - dc:reporter [ a foaf:Agent; foaf:mbox ]; - doap-bugs:id "86813", "86813"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "86813"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Reduce boilerplate for inline_as"; - dc:created "2013-07-12T14:29:19+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "86891", "86891"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "86891"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Reduce boilerplate for message"; - dc:created "2013-07-12T14:45:49+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "86892", "86892"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "86892"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Clarify \"may\" in the docs in relation to using constraint => quote_sub q{...}"; - dc:created "2013-07-12T15:08:16+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "86893", "86893"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "I was bitten by equals() being looser than expected (ie structural) which impacts is_subtype_of()"; - dc:created "2013-07-24T18:20:27+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "87264"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "PackageName type"; - dc:created "2013-07-26T23:18:08+01:00"^^xsd:dateTime; - dc:reporter _:B1; - doap-bugs:id "87366"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "86893"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Dict type doesn't notice missing Bool elements"; - dc:created "2013-07-30T15:09:13+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "87443", "87443"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "87443"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "slurpy Dict[ foo => InstanceOf[\"bar\"] ] fails (due to unescaped quotes in throw?)"; - dc:created "2013-08-14T11:59:43+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "87846", "87846"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "87846"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Make constraint failure errors look less like data dumps"; - dc:created "2013-08-21T13:22:54+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "87999", "87999"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "87999"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Several subclasses of Type::Tiny don't accept a hashref to the constructor"; - dc:created "2013-08-23T17:00:11+01:00"^^xsd:dateTime; - dc:reporter _:B3; - doap-bugs:id "88064", "88064"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "88064"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Tuple validation unexpectedly successful"; - dc:created "2013-08-29T19:42:31+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "88277", "88277"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "88277"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Grouped alternatives"; - dc:created "2013-08-30T18:33:23+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "88291", "88291"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "88291"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Coercion Hierarchies"; - dc:created "2013-09-06T00:09:56+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "88452", "88452"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Type::Tiny::Union could better mock Moose::Meta::TypeConstraint::Union"; - dc:created "2013-09-13T09:21:08+01:00"^^xsd:dateTime; - dc:reporter _:B3; - doap-bugs:id "88648"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "88452"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Better messsages for type constraint failures"; - dc:created "2013-09-13T13:52:03+01:00"^^xsd:dateTime; - dc:reporter _:B3; - doap-bugs:id "88655", "88655"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "88655"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Typo in Type::Utils documentation"; - dc:created "2013-09-19T03:52:25+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "88798", "88798"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Union and Intersection should still allow constraint/inlined attributes"; - dc:created "2013-09-25T01:13:06+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "88951"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Fwd: Union?"; - dc:created "2013-09-30T17:42:42+01:00"^^xsd:dateTime; - dc:reporter _:B1; - doap-bugs:id "89073"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "88798"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Moo attribute information not included in exception messages"; - dc:created "2013-10-03T17:09:02+01:00"^^xsd:dateTime; - dc:reporter [ a foaf:Agent; foaf:mbox ]; - doap-bugs:id "89234", "89234"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "89234"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Make truncation length in Type::Tiny::_dd (currently 72) configurable"; - dc:created "2013-10-04T12:41:25+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "89251", "89251"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "89251"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "validate_explain and Intersections"; - dc:created "2013-10-06T16:21:31+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "89279", "89279"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "89279"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Types::Exception not being indexed properly"; - dc:created "2013-10-06T16:24:38+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "89280", "89280"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Item should be a subtype of Any"; - dc:created "2013-10-08T01:51:05+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "89317"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Gazetteer type constraint"; - dc:created "2013-10-08T21:20:35+01:00"^^xsd:dateTime; - dc:reporter _:B3; - doap-bugs:id "89352"; - doap-bugs:page ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Types::Standard: please add StrLen (string with length) type"; - dc:created "2013-10-22T11:42:15+01:00"^^xsd:dateTime; - dc:reporter _:B4; - doap-bugs:id "89691"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "89280"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Types::Standard: is it possible to check for an empty ArrayRef/HashRef?"; - dc:created "2013-10-22T13:22:36+01:00"^^xsd:dateTime; - dc:reporter _:B4; - doap-bugs:id "89696", "89696"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "89696"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Maybe[Foo] should better emulate Foo|Undef for constraints"; - dc:created "2013-11-01T00:43:36Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "89936", "89936"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "89936"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Modification of a read-only value attempted at parameter validation for '__ANON__'"; - dc:created "2013-11-06T15:24:29Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "90096", "90096"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "90096"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Additional tests related to RT#90096. Make sure that Type::Params localizes '$_'."; @@ -4546,63 +5308,28 @@ a doap-bugs:Issue; - rdfs:label "Type::Params::multisig fails to validate when presented with a slurpy Dict"; - dc:created "2013-11-28T00:53:07Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "90865", "90865"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "90865"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "possible documentation error in Error::TypeTiny::Assertion"; - dc:created "2013-11-28T02:25:01Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "90867", "90867"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "90867"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Type::Utils::extends does not handle named type coercions"; - dc:created "2013-12-03T17:44:14Z"^^xsd:dateTime; - dc:reporter [ - a foaf:Agent; - foaf:mbox ; - ]; - doap-bugs:id "91153", "91153"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "91153"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "test failure"; - dc:created "2013-12-17T12:39:50Z"^^xsd:dateTime; - dc:reporter [ - a foaf:Agent; - foaf:mbox ; - ]; - doap-bugs:id "91468", "91468"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "Types::Standard: please add $class->DOES(...), $class->isa(...) and $class =~ /$valid_class_re/ constraints."; - dc:created "2014-01-02T19:49:31Z"^^xsd:dateTime; - dc:reporter _:B4; - doap-bugs:id "91802"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "91468"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "unexpected error from on-the-fly type union coercions, e.g. ( Str | Str )->coercion"; - dc:created "2014-01-30T05:56:04Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "92571", "92571"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "92571"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Make sure that the weakening of the reference from a Type::Coercion::Union object back to its \"owner\" type constraint does not break functionality."; @@ -4621,12 +5348,8 @@ a doap-bugs:Issue; - rdfs:label "anonymous coercions (via declare_coercion) ignore passed coercion maps if not in a Type::Library"; - dc:created "2014-01-30T22:24:22Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "92591", "92591"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "92591"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Make sure that 'declare_coercion' works outside type libraries."; @@ -4638,21 +5361,13 @@ a doap-bugs:Issue; - rdfs:label "Inlining/compiling of coercions which haven't been frozen"; - dc:created "2014-02-25T14:13:36Z"^^xsd:dateTime; - dc:reporter _:B3; - doap-bugs:id "93345", "93345"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "93345"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "Type::Params; slurpy Dict breaks HasMethods"; - dc:created "2014-03-26T04:18:03Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "94196", "94196"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status ; + doap-bugs:id "94196"^^xsd:string; + doap-bugs:page ; doap-tests:regression_test [ a doap-tests:RegressionTest; doap-tests:purpose "Problematic inlining using '$_'."; @@ -4662,51 +5377,41 @@ ]; ]. - - a doap-bugs:Issue; - rdfs:label "Type::Tiny and when()"; - dc:created "2014-03-28T15:35:36Z"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "94286"; - doap-bugs:page ; - doap-bugs:status . - a doap-bugs:Issue; - rdfs:label "documentation error in Types::Standard vis--vis coercions"; - dc:created "2014-06-11T17:20:17+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "96379", "96379"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . - - - a doap-bugs:Issue; - rdfs:label "5.20+ fails compile( Optional ) if passing explicit undef"; - dc:created "2014-06-19T04:42:06+01:00"^^xsd:dateTime; - dc:reporter _:B1; - doap-bugs:id "96545"; - doap-bugs:page ; - doap-bugs:status . + doap-bugs:id "96379"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; - rdfs:label "InstanceOf[Class::Name] is not cached, makes declaring coercion inconsistent"; - dc:created "2014-07-25T23:50:47+01:00"^^xsd:dateTime; - dc:reporter ; - doap-bugs:id "97516", "97516"^^xsd:string; - doap-bugs:page , ; - doap-bugs:status . + doap-bugs:id "97516"^^xsd:string; + doap-bugs:page . a doap-bugs:Issue; doap-bugs:id "97684"^^xsd:string; - doap-bugs:page . + doap-bugs:page ; + doap-tests:regression_test [ + a doap-tests:RegressionTest; + doap-tests:purpose "The \"too few arguments for type constraint check functions\" error."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/40-regression/rt97684.t"; + ]; + ]. a doap-bugs:Issue; doap-bugs:id "98113"^^xsd:string; - doap-bugs:page . + doap-bugs:page ; + doap-tests:regression_test [ + a doap-tests:RegressionTest; + doap-tests:purpose "Test overload fallback"; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/40-regression/rt98113.t"; + ]; + ]. a doap-bugs:Issue; @@ -4728,1391 +5433,1652 @@ doap-bugs:id "99312"^^xsd:string; doap-bugs:page . - - foaf:mbox ; - foaf:name "David Steinbrunner". + + foaf:mbox ; + foaf:name "David Steinbrunner". + + + foaf:name "Pierre Masci"; + foaf:page . + + + foaf:mbox ; + foaf:name "Benct Philip Jonsson". + + + foaf:mbox ; + foaf:name "Peter Valdemar Mørch". + + + foaf:homepage ; + foaf:name "André Walker"; + foaf:page . + + + foaf:mbox ; + foaf:name "Alexandr Ciornii"; + foaf:page . + + + foaf:mbox ; + foaf:name "Zoffix Znet". + + + foaf:mbox ; + foaf:name "Denis Ibaev"; + foaf:page . + + + foaf:name "Nelo Onyiah"; + foaf:page . + + + foaf:mbox ; + foaf:name "Lucas Buchala"; + foaf:page . + + + foaf:name "KB Jørgensen". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "CONTRIBUTING". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "CREDITS". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/benchmarking/benchmark-coercion.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/benchmarking/benchmark-constraints.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/benchmarking/benchmark-param-validation.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/benchmarking/benchmark-named-param-validation.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/benchmarking/versus-scalar-validation.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/nonempty.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/page-numbers.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "examples/datetime-coercions.pl"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "meta/changes.pret". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "meta/doap.pret". + +[] + a nfo:FileDataObject, nfo:TextDocument; + dc:license ; + dc:rightsHolder ; + nfo:fileName "Changes". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "meta/makefile.pret". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "meta/people.pret". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "meta/rights.pret". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "inc/Test/Fatal.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "inc/Test/Requires.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "inc/Try/Tiny.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "MANIFEST.SKIP". + +[] + a nfo:FileDataObject, nfo:TextDocument; + dc:license ; + dc:rightsHolder ; + nfo:fileName "LICENSE". + +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "META.ttl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + dc:license ; + dc:rightsHolder ; + nfo:fileName "Makefile.PL"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:TextDocument; + dc:license ; + dc:rightsHolder ; + nfo:fileName "NEWS". + +[] + a nfo:FileDataObject, nfo:TextDocument; + dc:license ; + dc:rightsHolder ; + nfo:fileName "README". - - foaf:name "Pierre Masci"; - foaf:page . +[] + a nfo:FileDataObject, nfo:TextDocument; + dc:license ; + dc:rightsHolder ; + nfo:fileName "TODO". - - foaf:mbox ; - foaf:name "Benct Philip Jonsson". +[] + a nfo:FileDataObject; + dc:license ; + dc:rightsHolder ; + nfo:fileName "TODO.mm". _:B1 - a foaf:Agent; - foaf:mbox . + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/00-begin.t". _:B2 - a foaf:Agent; - foaf:mbox . + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/01-compile.t". _:B3 - a foaf:Agent; - foaf:mbox . + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/02-api.t". _:B4 - a foaf:Agent; - foaf:mbox . + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/03-leak.t". _:B5 a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/00-begin.t". + nfo:fileName "t/99-moose-std-types-test.t". -_:B6 +[] a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/01-compile.t". + rdfs:label "Devel::TypeTiny::Perl56Compat"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks 'B::perlstring()' works."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t"; + ]; + ]; + nfo:fileName "lib/Devel/TypeTiny/Perl56Compat.pm"; + nfo:programmingLanguage "Perl". -_:B7 +[] a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Error-TypeTiny/basic.t". + rdfs:label "Devel::TypeTiny::Perl58Compat"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks 're::is_regexp()' works."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t"; + ]; + ]; + nfo:fileName "lib/Devel/TypeTiny/Perl58Compat.pm"; + nfo:programmingLanguage "Perl". -_:B8 +[] a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Utils/dwim-moose.t". + rdfs:label "Error::TypeTiny"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests for basic Error::TypeTiny functionality."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Error-TypeTiny/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests that Error::TypeTiny is capable of providing stack traces."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Error-TypeTiny/stacktrace.t"; + ]; + ]; + nfo:fileName "lib/Error/TypeTiny.pm"; + nfo:programmingLanguage "Perl". -_:B9 +[] a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Utils/dwim-mouse.t". + rdfs:label "Error::TypeTiny::Assertion"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests Error::TypeTiny::Assertion."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Error-TypeTiny-Assertion/basic.t"; + ]; + ]; + nfo:fileName "lib/Error/TypeTiny/Assertion.pm"; + nfo:programmingLanguage "Perl". -_:B10 +[] a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Utils/match-on-type.t". + rdfs:label "Error::TypeTiny::Compilation"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests for Error::TypeTiny::Compilation, mostly by triggering compilation errors using Eval::TypeTiny."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Error-TypeTiny-Compilation/basic.t"; + ]; + ]; + nfo:fileName "lib/Error/TypeTiny/Compilation.pm"; + nfo:programmingLanguage "Perl". -_:B11 +[] a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Utils/warnings.t". + rdfs:label "Error::TypeTiny::WrongNumberOfParameters"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Test Error::TypeTiny::WrongNumberOfParameters."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t"; + ]; + ]; + nfo:fileName "lib/Error/TypeTiny/WrongNumberOfParameters.pm"; + nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Types::Common::Numeric"; + rdfs:label "Eval::TypeTiny"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Tests constraints for Types::Common::Numeric. These tests are based on tests from MooseX::Types::Common."; + doap-tests:purpose "Tests Eval::TypeTiny supports alias=>1 using Devel::LexAlias implementation."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Common-Numeric/basic.t"; + nfo:fileName "t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests Eval::TypeTiny supports alias=>1 using Perl refaliasing."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Eval-TypeTiny/aliases-native.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests Eval::TypeTiny supports alias=>1 using PadWalker implementation."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Eval-TypeTiny/aliases-padwalker.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests Eval::TypeTiny supports alias=>1 using 'tie()' implementation."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Eval-TypeTiny/aliases-tie.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests Eval::TypeTiny."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Eval-TypeTiny/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests Eval::TypeTiny with experimental lexical subs."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Eval-TypeTiny/lexical-subs.t"; ]; ]; - nfo:fileName "lib/Types/Common/Numeric.pm"; + nfo:fileName "lib/Eval/TypeTiny.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Types::Common::String"; + rdfs:label "Test::TypeTiny"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Tests constraints for Types::Common::String. These tests are based on tests from MooseX::Types::Common."; + doap-tests:purpose "Tests Test::TypeTiny (which is somewhat important because Test::TypeTiny is itself used for the majority of the type constraint tests). In particular, this tests that everything works when the '$EXTENDED_TESTING' environment variable is false."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Common-String/basic.t"; + nfo:fileName "t/20-unit/Test-TypeTiny/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests coercions for Types::Common::String. These tests are based on tests from MooseX::Types::Common."; + doap-tests:purpose "Tests Test::TypeTiny works when the '$EXTENDED_TESTING' environment variable is true. Note that Test::Tester appears to have issues with subtests, so currently 'should_pass' and 'should_fail' are not tested."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Common-String/coerce.t"; + nfo:fileName "t/20-unit/Test-TypeTiny/extended.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Unicode support for Types::Common::String. These tests are based on tests from MooseX::Types::Common."; + doap-tests:purpose "Tests Test::TypeTiny (which is somewhat important because Test::TypeTiny is itself used for the majority of the type constraint tests). In particular, this tests that everything works when the '$EXTENDED_TESTING' environment variable is false."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Test-TypeTiny/matchfor.t"; + ]; + ]; + nfo:fileName "lib/Test/TypeTiny.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Coercion"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks Type::Coercion works."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks various undocumented Type::Coercion methods. The fact that these are tested here should not be construed to mean tht they are any any way a stable, supported part of the Type::Coercion API."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/esoteric.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Type::Coercion objects are mutable, unlike Type::Tiny objects. However, they can be frozen, making them immutable. (And Type::Tiny will freeze them occasionally, if it feels it has to.)"; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/frozen.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks Type::Coercion can be inlined."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/inlining.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks the 'Split' and 'Join' parameterized coercions from Types::Standard."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/parameterized.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks Type::Coercion overload of '~~'."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/smartmatch.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks proper Type::Coercion objects are automatically created by the Type::Tiny constructor."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion/typetiny-constructor.t"; + ]; + ]; + nfo:fileName "lib/Type/Coercion.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Coercion::FromMoose"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks the types adopted from Moose still have a coercion which works."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion-FromMoose/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks crazy Type::Coercion::FromMoose errors."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Coercion-FromMoose/errors.t"; + ]; + ]; + nfo:fileName "lib/Type/Coercion/FromMoose.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Coercion::Union"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks Type::Coercion::Union works."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Common-String/unicode.t"; + nfo:fileName "t/20-unit/Type-Coercion-Union/basic.t"; ]; ]; - nfo:fileName "lib/Types/Common/String.pm"; + nfo:fileName "lib/Type/Coercion/Union.pm"; nfo:programmingLanguage "Perl". -_:B12 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Error-TypeTiny/stacktrace.t". - [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Types::Standard"; + rdfs:label "Type::Library"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various values against the type constraints from Types::Standard."; - doap-tests:test_script [ - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/basic.t"; - ]; - ], [ - a doap-tests:UnitTest; - doap-tests:purpose "If a coercion exists for type 'Foo', then Type::Tiny should be able to auto-generate a coercion for type 'ArrayRef[Foo]', etc."; + doap-tests:purpose "Checks that the assertion functions exported by a type library work as expected."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/deep-coercions.t"; + nfo:fileName "t/20-unit/Type-Library/assert.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test the following types from Types::Standard which were inspired by MooX::Types::MooseLike::Base. * 'InstanceOf' * 'ConsumerOf' * 'HasMethods' * 'Enum' Rather than checking they work directy, we check they are equivalent to known (and well-tested) type constraints generated using Type::Utils."; + doap-tests:purpose "Checks Type::Library warns about deprecated types."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/mxtmlb-alike.t"; + nfo:fileName "t/20-unit/Type-Library/deprecation.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various values against 'OptList' from Types::Standard. Checks the standalone 'MkOpt' coercion."; + doap-tests:purpose "Tests errors thrown by Type::Library."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/optlist.t"; + nfo:fileName "t/20-unit/Type-Library/errors.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various values against 'Overload' from Types::Standard."; + doap-tests:purpose "Checks that it's possible to extend existing type libraries."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/overload.t"; + nfo:fileName "t/20-unit/Type-Library/inheritance.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various values against 'StrMatch' from Types::Standard."; + doap-tests:purpose "Checks that the check functions exported by a type library work as expected."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/strmatch.t"; + nfo:fileName "t/20-unit/Type-Library/is.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various values against structured types from Types::Standard."; + doap-tests:purpose "Checks that the coercion functions exported by a type library work as expected."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/structured.t"; + nfo:fileName "t/20-unit/Type-Library/to.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various values against 'Tied' from Types::Standard."; + doap-tests:purpose "Checks that the type functions exported by a type library work as expected."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-Standard/tied.t"; + nfo:fileName "t/20-unit/Type-Library/types.t"; ]; ]; - nfo:fileName "lib/Types/Standard.pm"; + nfo:fileName "lib/Type/Library.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Types::TypeTiny"; + rdfs:label "Type::Params"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Test the Types::TypeTiny bootstrap library. (That is, type constraints used by Type::Tiny internally.)"; + doap-tests:purpose "Check that people doing silly things with Test::Params get"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-TypeTiny/basic.t"; + nfo:fileName "t/20-unit/Type-Params/badsigs.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Types::TypeTiny::to_TypeTiny pseudo-coercion."; + doap-tests:purpose "Test Type::Params' interaction with Carp: use Type::Params compile => { confess => 1 };"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-TypeTiny/coercion.t"; + nfo:fileName "t/20-unit/Type-Params/carping.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test the Types::TypeTiny introspection methods. Types::TypeTiny doesn't inherit from Type::Library (because bootstrapping), so provides independent re-implementations of the most important introspection stuff."; + doap-tests:purpose "Test Type::Params usage of types with coercions."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Types-TypeTiny/meta.t"; + nfo:fileName "t/20-unit/Type-Params/coerce.t"; ]; - ]; - nfo:fileName "lib/Types/TypeTiny.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Error::TypeTiny::Assertion"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Error::TypeTiny::Assertion."; + doap-tests:purpose "Test Type::Params' brand spanking new 'compile_named' function."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Error-TypeTiny-Assertion/basic.t"; + nfo:fileName "t/20-unit/Type-Params/compile-named-bless.t"; ]; - ]; - nfo:fileName "lib/Error/TypeTiny/Assertion.pm"; - nfo:programmingLanguage "Perl". - -_:B13 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Class-InsideOut/basic.t". - -_:B14 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Exporter-Tiny/basic.t". - -_:B15 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Exporter-Tiny/installer.t". - -_:B16 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Exporter-Tiny/role-conflict.t". - -_:B17 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Function-Parameters/basic.t". - -_:B18 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Kavorka/basic.t". - -_:B19 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moo/basic.t". - -_:B20 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moo/coercion.t". - -_:B21 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moo/exceptions.t". - -_:B22 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moo/inflation.t". - -_:B23 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moo/inflation2.t". - -_:B24 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moops/basic.t". - -_:B25 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moops/library-keyword.t". - -_:B26 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moose/accept-moose-types.t". - -_:B27 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moose/basic.t". - -_:B28 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moose/coercion.t". - -_:B29 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/30-integration/Moose/inflate-then-inline.t". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Error::TypeTiny::Compilation"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests for Error::TypeTiny::Compilation, mostly by triggering compilation errors using Eval::TypeTiny."; + doap-tests:purpose "Test Type::Params 'compile_named_oo' function."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Error-TypeTiny-Compilation/basic.t"; + nfo:fileName "t/20-unit/Type-Params/compile-named-oo.t"; ]; - ]; - nfo:fileName "lib/Error/TypeTiny/Compilation.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Error::TypeTiny::WrongNumberOfParameters"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Error::TypeTiny::WrongNumberOfParameters."; + doap-tests:purpose "Test Type::Params' brand spanking new 'compile_named' function."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t"; + nfo:fileName "t/20-unit/Type-Params/compile-named.t"; ]; - ]; - nfo:fileName "lib/Error/TypeTiny/WrongNumberOfParameters.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Eval::TypeTiny"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Eval::TypeTiny."; + doap-tests:purpose "(Unknown.)"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Eval-TypeTiny/basic.t"; + nfo:fileName "t/20-unit/Type-Params/defaults.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Eval::TypeTiny supports alias=>1 even when Devel::LexAlias is unavailable."; + doap-tests:purpose "Test Type::Params' brand spanking new 'compile_named' function."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Eval-TypeTiny/fallback-aliases.t"; + nfo:fileName "t/20-unit/Type-Params/hashorder.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Eval::TypeTiny with experimental lexical subs."; + doap-tests:purpose "Test Type::Params usage for method calls."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Eval-TypeTiny/lexical-subs.t"; + nfo:fileName "t/20-unit/Type-Params/methods.t"; ]; - ]; - nfo:fileName "lib/Eval/TypeTiny.pm"; - nfo:programmingLanguage "Perl". - -_:B30 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/02-api.t". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Test::TypeTiny"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Test::TypeTiny (which is somewhat important because Test::TypeTiny is itself used for the majority of the type constraint tests). In particular, this tests that everything works when the '$EXTENDED_TESTING' environment variable is false."; + doap-tests:purpose "Test Type::Params usage with mix of positional and named parameters."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Test-TypeTiny/basic.t"; + nfo:fileName "t/20-unit/Type-Params/mixednamed.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Test::TypeTiny works when the '$EXTENDED_TESTING' environment variable is true. Note that Test::Tester appears to have issues with subtests, so currently 'should_pass' and 'should_fail' are not tested."; + doap-tests:purpose "Test Type::Params 'multisig' function."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Test-TypeTiny/extended.t"; + nfo:fileName "t/20-unit/Type-Params/multisig.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests Test::TypeTiny (which is somewhat important because Test::TypeTiny is itself used for the majority of the type constraint tests). In particular, this tests that everything works when the '$EXTENDED_TESTING' environment variable is false."; + doap-tests:purpose "Test Type::Params usage with named parameters."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Test-TypeTiny/matchfor.t"; + nfo:fileName "t/20-unit/Type-Params/named.t"; ]; - ]; - nfo:fileName "lib/Test/TypeTiny.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Coercion"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Coercion works."; + doap-tests:purpose "Test Type::Params with type constraints that cannot be inlined."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/basic.t"; + nfo:fileName "t/20-unit/Type-Params/noninline.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various undocumented Type::Coercion methods. The fact that these are tested here should not be construed to mean tht they are any any way a stable, supported part of the Type::Coercion API."; + doap-tests:purpose "Test Type::Params usage with optional parameters."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/esoteric.t"; + nfo:fileName "t/20-unit/Type-Params/optional.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Type::Coercion objects are mutable, unlike Type::Tiny objects. However, they can be frozen, making them immutable. (And Type::Tiny will freeze them occasionally, if it feels it has to.)"; + doap-tests:purpose "Test Type::Params positional parameters, a la the example in the documentation: sub nth_root { state $check = compile( Num, Num ); my ($x, $n) = $check->(@_); return $x ** (1 / $n); }"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/frozen.t"; + nfo:fileName "t/20-unit/Type-Params/positional.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Coercion can be inlined."; + doap-tests:purpose "Test Type::Params usage with slurpy parameters."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/inlining.t"; + nfo:fileName "t/20-unit/Type-Params/slurpy.t"; + ]; + ]; + nfo:fileName "lib/Type/Params.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Parser"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks Type::Parser works."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Parser/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks the 'Split' and 'Join' parameterized coercions from Types::Standard."; + doap-tests:purpose "Checks Type::Parser can pick up MooseX::Types type constraints."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/parameterized.t"; + nfo:fileName "t/20-unit/Type-Parser/moosextypes.t"; + ]; + ]; + nfo:fileName "lib/Type/Parser.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Registry"; + doap-tests:unit_test [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks Type::Registry->for_class is automagically populated."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Registry/automagic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Coercion overload of '~~'."; + doap-tests:purpose "Checks Type::Registry works."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/smartmatch.t"; + nfo:fileName "t/20-unit/Type-Registry/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks proper Type::Coercion objects are automatically created by the Type::Tiny constructor."; + doap-tests:purpose "Checks various newish Type::Registry method calls."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion/typetiny-constructor.t"; + nfo:fileName "t/20-unit/Type-Registry/methods.t"; ]; - ]; - nfo:fileName "lib/Type/Coercion.pm"; - nfo:programmingLanguage "Perl". - -_:B31 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/03-leak.t". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Coercion::FromMoose"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks the types adopted from Moose still have a coercion which works."; + doap-tests:purpose "Checks Type::Registry works with MooseX::Types."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion-FromMoose/basic.t"; + nfo:fileName "t/20-unit/Type-Registry/moosextypes.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks crazy Type::Coercion::FromMoose errors."; + doap-tests:purpose "Checks Type::Registry works with MouseX::Types."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion-FromMoose/errors.t"; + nfo:fileName "t/20-unit/Type-Registry/mousextypes.t"; ]; ]; - nfo:fileName "lib/Type/Coercion/FromMoose.pm"; + nfo:fileName "lib/Type/Registry.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Coercion::Union"; + rdfs:label "Type::Tiny"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Coercion::Union works."; + doap-tests:purpose "Tests overloading of bitwise operators and numeric comparison operators for Type::Tiny."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Coercion-Union/basic.t"; + nfo:fileName "t/20-unit/Type-Tiny/arithmetic.t"; ]; - ]; - nfo:fileName "lib/Type/Coercion/Union.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Library"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks that the assertion functions exported by a type library work as expected."; + doap-tests:purpose "Checks Type::Tiny works."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Library/assert.t"; + nfo:fileName "t/20-unit/Type-Tiny/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests errors thrown by Type::Library."; + doap-tests:purpose "Checks 'plus_coercions', 'minus_coercions' and 'no_coercions' methods work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Library/errors.t"; + nfo:fileName "t/20-unit/Type-Tiny/coercion-modifiers.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks that it's possible to extend existing type libraries."; + doap-tests:purpose "Checks Type::Tiny works accepts strings of Perl code as constraints."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Library/inheritance.t"; + nfo:fileName "t/20-unit/Type-Tiny/constraint-strings.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks that the check functions exported by a type library work as expected."; + doap-tests:purpose "Checks Type::Tiny's 'deprecated' attribute works."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Library/is.t"; + nfo:fileName "t/20-unit/Type-Tiny/deprecation.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks that the coercion functions exported by a type library work as expected."; + doap-tests:purpose "Checks various undocumented Type::Tiny methods. The fact that these are tested here should not be construed to mean tht they are any any way a stable, supported part of the Type::Tiny API."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Library/to.t"; + nfo:fileName "t/20-unit/Type-Tiny/esoteric.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks that the type functions exported by a type library work as expected."; + doap-tests:purpose "Checks Type::Tiny's 'my_methods' attribute."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Library/types.t"; + nfo:fileName "t/20-unit/Type-Tiny/my-methods.t"; ]; - ]; - nfo:fileName "lib/Type/Library.pm"; - nfo:programmingLanguage "Perl". - -_:B32 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/99-moose-std-types-test.t". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Params"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Check that people doing silly things with Test::Params get"; + doap-tests:purpose "There are loads of tests for parameterization in 'stdlib.t', 'stdlib-overload.t', 'stdlib-strmatch.t', 'stdlib-structures.t', 'syntax.t', 'stdlib-automatic.t', etc. This file includes a handful of other parameterization-related tests that didn't fit anywhere else."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/badsigs.t"; + nfo:fileName "t/20-unit/Type-Tiny/parameterization.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params' interaction with Carp: use Type::Params compile => { confess => 1 };"; + doap-tests:purpose "Test the '->of' and '->where' shortcut methods."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/carping.t"; + nfo:fileName "t/20-unit/Type-Tiny/shortcuts.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params usage of types with coercions."; + doap-tests:purpose "Checks Type::Tiny works with the smartmatch operator."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/coerce.t"; + nfo:fileName "t/20-unit/Type-Tiny/smartmatch.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params usage for method calls."; + doap-tests:purpose "Checks that all this Type[Param] syntactic sugar works. In particular, the following three type constraints are expected to be equivalent to each other: use Types::Standard qw( ArrayRef Int Num Str ); use Type::Utils qw( union intersection ); my $type1 = ArrayRef[Int] | ArrayRef[Num & ~Int] | ArrayRef[Str & ~Num]; my $type2 = union [ ArrayRef[Int], ArrayRef[Num & ~Int], ArrayRef[Str & ~Num], ]; my $type3 = union([ ArrayRef->parameterize(Int), ArrayRef->parameterize( intersection([ Num, Int->complementary_type, ]), ), ArrayRef->parameterize( intersection([ Str, Num->complementary_type, ]), ), ]);"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/methods.t"; + nfo:fileName "t/20-unit/Type-Tiny/syntax.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params usage with mix of positional and named parameters."; + doap-tests:purpose "Checks Type::Tiny objects can be converted to Moose type constraint objects."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/mixednamed.t"; + nfo:fileName "t/20-unit/Type-Tiny/to-moose.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params 'multisig' function."; + doap-tests:purpose "Checks Type::Tiny objects can be converted to Mouse type constraint objects."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/multisig.t"; + nfo:fileName "t/20-unit/Type-Tiny/to-mouse.t"; ]; - ], [ + ]; + nfo:fileName "lib/Type/Tiny.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Tiny::Class"; + doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params usage with named parameters."; + doap-tests:purpose "Checks class type constraints work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/named.t"; + nfo:fileName "t/20-unit/Type-Tiny-Class/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params with type constraints that cannot be inlined."; + doap-tests:purpose "Checks class type constraints throw sane error messages."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/noninline.t"; + nfo:fileName "t/20-unit/Type-Tiny-Class/errors.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params usage with optional parameters."; + doap-tests:purpose "Checks the 'Type::Tiny::Class''s 'plus_constructors' method."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/optional.t"; + nfo:fileName "t/20-unit/Type-Tiny-Class/plus-constructors.t"; ]; - ], [ + ]; + nfo:fileName "lib/Type/Tiny/Class.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Tiny::Duck"; + doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params positional parameters, a la the example in the documentation: sub nth_root { state $check = compile( Num, Num ); my ($x, $n) = $check->(@_); return $x ** (1 / $n); }"; + doap-tests:purpose "Checks duck type constraints work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/positional.t"; + nfo:fileName "t/20-unit/Type-Tiny-Duck/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Params usage with slurpy parameters."; + doap-tests:purpose "Checks duck type constraints throw sane error messages."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Params/slurpy.t"; + nfo:fileName "t/20-unit/Type-Tiny-Duck/errors.t"; ]; ]; - nfo:fileName "lib/Type/Params.pm"; + nfo:fileName "lib/Type/Tiny/Duck.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Devel::TypeTiny::Perl56Compat"; + rdfs:label "Type::Tiny::Enum"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks 'B::perlstring()' works."; + doap-tests:purpose "Checks enum type constraints work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t"; + nfo:fileName "t/20-unit/Type-Tiny-Enum/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Checks enum type constraints throw sane error messages."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Type-Tiny-Enum/errors.t"; ]; ]; - nfo:fileName "lib/Devel/TypeTiny/Perl56Compat.pm"; + nfo:fileName "lib/Type/Tiny/Enum.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Parser"; + rdfs:label "Type::Tiny::Intersection"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Parser works."; + doap-tests:purpose "Checks intersection type constraints work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Parser/basic.t"; + nfo:fileName "t/20-unit/Type-Tiny-Intersection/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Parser can pick up MooseX::Types type constraints."; + doap-tests:purpose "Checks intersection type constraints throw sane error messages."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Parser/moosextypes.t"; + nfo:fileName "t/20-unit/Type-Tiny-Intersection/errors.t"; ]; ]; - nfo:fileName "lib/Type/Parser.pm"; + nfo:fileName "lib/Type/Tiny/Intersection.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Registry"; + rdfs:label "Type::Tiny::Role"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Registry works."; - doap-tests:test_script [ - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Registry/basic.t"; - ]; - ], [ - a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Registry works with MooseX::Types."; + doap-tests:purpose "Checks role type constraints work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Registry/moosextypes.t"; + nfo:fileName "t/20-unit/Type-Tiny-Role/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Registry works with MouseX::Types."; + doap-tests:purpose "Checks role type constraints throw sane error messages."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Registry/mousextypes.t"; + nfo:fileName "t/20-unit/Type-Tiny-Role/errors.t"; ]; ]; - nfo:fileName "lib/Type/Registry.pm"; + nfo:fileName "lib/Type/Tiny/Role.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny"; + rdfs:label "Type::Tiny::Union"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Tests overloading of bitwise operators and numeric comparison operators for Type::Tiny."; + doap-tests:purpose "Checks union type constraints work."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/arithmetic.t"; + nfo:fileName "t/20-unit/Type-Tiny-Union/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Tiny works."; + doap-tests:purpose "Checks union type constraints throw sane error messages."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/basic.t"; + nfo:fileName "t/20-unit/Type-Tiny-Union/errors.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks 'plus_coercions', 'minus_coercions' and 'no_coercions' methods work."; + doap-tests:purpose "Checks union type constraint subtype/supertype relationships."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/coercion-modifiers.t"; + nfo:fileName "t/20-unit/Type-Tiny-Union/relationships.t"; ]; - ], [ + ]; + nfo:fileName "lib/Type/Tiny/Union.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Tiny::_HalfOp"; + doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks various undocumented Type::Tiny methods. The fact that these are tested here should not be construed to mean tht they are any any way a stable, supported part of the Type::Tiny API."; + doap-tests:purpose "Ensure that the following works: ArrayRef[Str] | Undef | Str"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/esoteric.t"; + nfo:fileName "t/20-unit/Type-Tiny-_HalfOp/double-union.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Tiny's 'my_methods' attribute."; + doap-tests:purpose "Ensure that the following works consistently on all supported Perls: ArrayRef[Int] | HashRef[Int]"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/my-methods.t"; + nfo:fileName "t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t"; ]; - ], [ + ]; + nfo:fileName "lib/Type/Tiny/_HalfOp.pm"; + nfo:programmingLanguage "Perl". + +[] + a nfo:FileDataObject, nfo:SourceCode; + rdfs:label "Type::Utils"; + doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "There are loads of tests for parameterization in 'stdlib.t', 'stdlib-overload.t', 'stdlib-strmatch.t', 'stdlib-structures.t', 'syntax.t', 'stdlib-automatic.t', etc. This file includes a handful of other parameterization-related tests that didn't fit anywhere else."; + doap-tests:purpose "Test Type::Utils 'classifier' function."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/parameterization.t"; + nfo:fileName "t/20-unit/Type-Utils/classifier.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test the '->of' and '->where' shortcut methods."; + doap-tests:purpose "Checks sane behaviour of 'dwim_type' from Type::Utils when both Moose and Mouse are loaded."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/shortcuts.t"; + nfo:fileName "t/20-unit/Type-Utils/dwim-both.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Tiny works with the smartmatch operator."; + doap-tests:purpose "Checks Moose type constraints, and MooseX::Types type constraints are picked up by 'dwim_type' from Type::Utils."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/smartmatch.t"; + nfo:fileName "t/20-unit/Type-Utils/dwim-moose.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks that all this Type[Param] syntactic sugar works. In particular, the following three type constraints are expected to be equivalent to each other: use Types::Standard qw( ArrayRef Int Num Str ); use Type::Utils qw( union intersection ); my $type1 = ArrayRef[Int] | ArrayRef[Num & ~Int] | ArrayRef[Str & ~Num]; my $type2 = union [ ArrayRef[Int], ArrayRef[Num & ~Int], ArrayRef[Str & ~Num], ]; my $type3 = union([ ArrayRef->parameterize(Int), ArrayRef->parameterize( intersection([ Num, Int->complementary_type, ]), ), ArrayRef->parameterize( intersection([ Str, Num->complementary_type, ]), ), ]);"; + doap-tests:purpose "Checks Mouse type constraints, and MouseX::Types type constraints are picked up by 'dwim_type' from Type::Utils."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/syntax.t"; + nfo:fileName "t/20-unit/Type-Utils/dwim-mouse.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Tiny objects can be converted to Moose type constraint objects."; + doap-tests:purpose "Test Type::Utils 'match_on_type' and 'compile_match_on_type' functions."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/to-moose.t"; + nfo:fileName "t/20-unit/Type-Utils/match-on-type.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Type::Tiny objects can be converted to Mouse type constraint objects."; + doap-tests:purpose "Tests warnings raised by Type::Utils."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny/to-mouse.t"; + nfo:fileName "t/20-unit/Type-Utils/warnings.t"; ]; ]; - nfo:fileName "lib/Type/Tiny.pm"; + nfo:fileName "lib/Type/Utils.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Devel::TypeTiny::Perl58Compat"; + rdfs:label "Types::Common::Numeric"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks 're::is_regexp()' works."; + doap-tests:purpose "Tests constraints for Types::Common::Numeric. These tests are based on tests from MooseX::Types::Common."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t"; + nfo:fileName "t/20-unit/Types-Common-Numeric/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests constraints for Types::Common::Numeric's 'IntRange' and 'NumRange'."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Types-Common-Numeric/ranges.t"; ]; ]; - nfo:fileName "lib/Devel/TypeTiny/Perl58Compat.pm"; + nfo:fileName "lib/Types/Common/Numeric.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::Class"; + rdfs:label "Types::Common::String"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks class type constraints work."; + doap-tests:purpose "Tests constraints for Types::Common::String's 'StrLength'tring"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Class/basic.t"; + nfo:fileName "t/20-unit/Types-Common-String/strlength.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks class type constraints throw sane error messages."; + doap-tests:purpose "Tests Unicode support for Types::Common::String. These tests are based on tests from MooseX::Types::Common."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Class/errors.t"; + nfo:fileName "t/20-unit/Types-Common-String/unicode.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks the 'Type::Tiny::Class''s 'plus_constructors' method."; + doap-tests:purpose "Tests constraints for Types::Common::String. These tests are based on tests from MooseX::Types::Common."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Class/plus-constructors.t"; + nfo:fileName "t/20-unit/Types-Common-String/basic.t"; + ]; + ], [ + a doap-tests:UnitTest; + doap-tests:purpose "Tests coercions for Types::Common::String. These tests are based on tests from MooseX::Types::Common."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Types-Common-String/coerce.t"; ]; ]; - nfo:fileName "lib/Type/Tiny/Class.pm"; + nfo:fileName "lib/Types/Common/String.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::Duck"; + rdfs:label "Types::Standard"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Checks duck type constraints work."; + doap-tests:purpose "Checks various values against the type constraints from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Duck/basic.t"; + nfo:fileName "t/20-unit/Types-Standard/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks duck type constraints throw sane error messages."; + doap-tests:purpose "Checks various values against 'CycleTuple' from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Duck/errors.t"; + nfo:fileName "t/20-unit/Types-Standard/cycletuple.t"; ]; - ]; - nfo:fileName "lib/Type/Tiny/Duck.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::Enum"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks enum type constraints work."; + doap-tests:purpose "If a coercion exists for type 'Foo', then Type::Tiny should be able to auto-generate a coercion for type 'ArrayRef[Foo]', etc."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Enum/basic.t"; + nfo:fileName "t/20-unit/Types-Standard/deep-coercions.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks enum type constraints throw sane error messages."; + doap-tests:purpose "Checks various values against 'FileHandle' from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Enum/errors.t"; + nfo:fileName "t/20-unit/Types-Standard/filehandle.t"; ]; - ]; - nfo:fileName "lib/Type/Tiny/Enum.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::Intersection"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks intersection type constraints work."; + doap-tests:purpose "OK, we need to bite the bullet and lock down coercions on core type constraints and parameterized type constraints."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Intersection/basic.t"; + nfo:fileName "t/20-unit/Types-Standard/lockdown.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks intersection type constraints throw sane error messages."; + doap-tests:purpose "Test the following types from Types::Standard which were inspired by MooX::Types::MooseLike::Base. * 'InstanceOf' * 'ConsumerOf' * 'HasMethods' * 'Enum' Rather than checking they work directy, we check they are equivalent to known (and well-tested) type constraints generated using Type::Utils."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Intersection/errors.t"; + nfo:fileName "t/20-unit/Types-Standard/mxtmlb-alike.t"; ]; - ]; - nfo:fileName "lib/Type/Tiny/Intersection.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Error::TypeTiny"; - doap-tests:unit_test [ - a doap-tests:UnitTest; - doap-tests:purpose "Tests for basic Error::TypeTiny functionality."; - doap-tests:test_script _:B7; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests that Error::TypeTiny is capable of providing stack traces."; - doap-tests:test_script _:B12; - ]; - nfo:fileName "lib/Error/TypeTiny.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::Role"; - doap-tests:unit_test [ - a doap-tests:UnitTest; - doap-tests:purpose "Checks role type constraints work."; + doap-tests:purpose "Checks various values against 'OptList' from Types::Standard. Checks the standalone 'MkOpt' coercion."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Role/basic.t"; + nfo:fileName "t/20-unit/Types-Standard/optlist.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks role type constraints throw sane error messages."; + doap-tests:purpose "Checks various values against 'Overload' from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Role/errors.t"; + nfo:fileName "t/20-unit/Types-Standard/overload.t"; ]; - ]; - nfo:fileName "lib/Type/Tiny/Role.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::Union"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks union type constraints work."; + doap-tests:purpose "Checks various values against 'StrMatch' from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Union/basic.t"; + nfo:fileName "t/20-unit/Types-Standard/strmatch.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks union type constraints throw sane error messages."; + doap-tests:purpose "Checks various values against structured types from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-Union/errors.t"; + nfo:fileName "t/20-unit/Types-Standard/structured.t"; ]; - ]; - nfo:fileName "lib/Type/Tiny/Union.pm"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Tiny::_HalfOp"; - doap-tests:unit_test [ + ], [ a doap-tests:UnitTest; - doap-tests:purpose "Ensure that the following works consistently on all supported Perls: ArrayRef[Int] | HashRef[Int]"; + doap-tests:purpose "Checks various values against 'Tied' from Types::Standard."; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t"; + nfo:fileName "t/20-unit/Types-Standard/tied.t"; ]; ]; - nfo:fileName "lib/Type/Tiny/_HalfOp.pm"; + nfo:fileName "lib/Types/Standard.pm"; nfo:programmingLanguage "Perl". [] a nfo:FileDataObject, nfo:SourceCode; - rdfs:label "Type::Utils"; + rdfs:label "Types::TypeTiny"; doap-tests:unit_test [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Utils 'classifier' function."; + doap-tests:purpose "Test the Types::TypeTiny bootstrap library. (That is, type constraints used by Type::Tiny internally.)"; doap-tests:test_script [ a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/20-unit/Type-Utils/classifier.t"; + nfo:fileName "t/20-unit/Types-TypeTiny/basic.t"; ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Moose type constraints, and MooseX::Types type constraints are picked up by 'dwim_type' from Type::Utils."; - doap-tests:test_script _:B8; + doap-tests:purpose "Test Types::TypeTiny::to_TypeTiny pseudo-coercion."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Types-TypeTiny/coercion.t"; + ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Checks Mouse type constraints, and MouseX::Types type constraints are picked up by 'dwim_type' from Type::Utils."; - doap-tests:test_script _:B9; + doap-tests:purpose "Test the Types::TypeTiny introspection methods. Types::TypeTiny doesn't inherit from Type::Library (because bootstrapping), so provides independent re-implementations of the most important introspection stuff."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Types-TypeTiny/meta.t"; + ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Test Type::Utils 'match_on_type' and 'compile_match_on_type' functions."; - doap-tests:test_script _:B10; + doap-tests:purpose "Stuff that was originally in basic.t but was split out to avoid basic.t requiring Moose and Mouse."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Types-TypeTiny/moosemouse.t"; + ]; ], [ a doap-tests:UnitTest; - doap-tests:purpose "Tests warnings raised by Type::Utils."; - doap-tests:test_script _:B11; + doap-tests:purpose "Checks that Types::TypeTiny avoids loading Exporter::Tiny."; + doap-tests:test_script [ + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/20-unit/Types-TypeTiny/progressiveexporter.t"; + ]; ]; - nfo:fileName "lib/Type/Utils.pm"; + nfo:fileName "lib/Types/TypeTiny.pm"; nfo:programmingLanguage "Perl". -_:B33 +_:B6 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Class-InsideOut/basic.t". + +_:B7 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Exporter-Tiny/basic.t". + +_:B8 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Exporter-Tiny/installer.t". + +_:B9 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Exporter-Tiny/role-conflict.t". + +_:B10 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Function-Parameters/basic.t". + +_:B11 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Kavorka/80returntype.t". + +_:B12 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Kavorka/basic.t". + +_:B13 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moo/basic.t". + +_:B14 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moo/coercion-inlining-avoidance.t". + +_:B15 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moo/coercion.t". + +_:B16 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moo/exceptions.t". + +_:B17 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moo/inflation.t". + +_:B18 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moo/inflation2.t". + +_:B19 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moops/basic.t". + +_:B20 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moops/library-keyword.t". + +_:B21 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moose/accept-moose-types.t". + +_:B22 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moose/basic.t". + +_:B23 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moose/coercion-more.t". + +_:B24 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moose/coercion.t". + +_:B25 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Moose/inflate-then-inline.t". + +_:B26 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Moose/native-attribute-traits.t". -_:B34 +_:B27 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/MooseX-Getopt/coercion.t". -_:B35 +_:B28 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/MooseX-Types/basic.t". -_:B36 +_:B29 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/MooseX-Types/extending.t". -_:B37 +_:B30 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/MooseX-Types/more.t". -_:B38 +_:B31 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Mouse/basic.t". -_:B39 +_:B32 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Mouse/coercion.t". -_:B40 +_:B33 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/MouseX-Types/basic.t". -_:B41 +_:B34 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/MouseX-Types/extending.t". -_:B42 +_:B35 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Object-Accessor/basic.t". -_:B43 +_:B36 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Return-Type/basic.t". -_:B44 +_:B37 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Sub-Quote/basic.t". -_:B45 +_:B38 + a nfo:FileDataObject, nfo:SourceCode; + nfo:fileName "t/30-integration/Sub-Quote/delayed-quoting.t". + +_:B39 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Sub-Quote/unquote-coercions.t". -_:B46 +_:B40 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Sub-Quote/unquote-constraints.t". -_:B47 +_:B41 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Switcheroo/basic.t". -_:B48 +_:B42 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Type-Tie/basic.t". -_:B49 +_:B43 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Validation-Class-Simple/archaic.t". -_:B50 +_:B44 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/Validation-Class-Simple/basic.t". -_:B51 +_:B45 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/30-integration/match-simple/basic.t". -_:B52 +_:B46 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/40-regression/73f51e2d.t". -_:B53 +_:B47 a nfo:FileDataObject, nfo:SourceCode; nfo:fileName "t/40-regression/gh1.t". -_:B54 - a nfo:FileDataObject, nfo:SourceCode; - nfo:fileName "t/40-regression/ttxs-gh1.t". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "CONTRIBUTING". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "CREDITS". - -[] - a nfo:FileDataObject, nfo:TextDocument; - dc:license ; - dc:rightsHolder ; - nfo:fileName "Changes". - -[] - a nfo:FileDataObject, nfo:TextDocument; - dc:license ; - dc:rightsHolder ; - nfo:fileName "LICENSE". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "META.ttl". - -[] - a nfo:FileDataObject, nfo:SourceCode; - dc:license ; - dc:rightsHolder ; - nfo:fileName "Makefile.PL"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject, nfo:TextDocument; - dc:license ; - dc:rightsHolder ; - nfo:fileName "NEWS". - -[] - a nfo:FileDataObject, nfo:TextDocument; - dc:license ; - dc:rightsHolder ; - nfo:fileName "README". - -[] - a nfo:FileDataObject, nfo:TextDocument; - dc:license ; - dc:rightsHolder ; - nfo:fileName "TODO". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "TODO.mm". - -[] +_:B48 a nfo:FileDataObject, nfo:SourceCode; - dc:license ; - dc:rightsHolder ; - nfo:fileName "examples/benchmark-mkopt.pl"; - nfo:programmingLanguage "Perl". + nfo:fileName "t/40-regression/gh14.t". -[] +_:B49 a nfo:FileDataObject, nfo:SourceCode; - dc:license ; - dc:rightsHolder ; - nfo:fileName "examples/benchmark-param-validation.pl"; - nfo:programmingLanguage "Perl". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "meta/changes.pret". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "meta/doap.pret". - -[] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "meta/makefile.pret". + nfo:fileName "t/40-regression/ttxs-gh1.t". [] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "meta/people.pret". + a doap-tests:Test; + doap-tests:purpose "Print some standard diagnostics before beginning testing."; + doap-tests:test_script _:B1. [] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "meta/rights.pret". + a doap-tests:Test; + doap-tests:purpose "Test that Type::Tiny, Type::Library, etc compile."; + doap-tests:test_script _:B2. [] - a nfo:FileDataObject, nfo:SourceCode; - dc:license ; - dc:rightsHolder ; - nfo:fileName "inc/Test/Fatal.pm"; - nfo:programmingLanguage "Perl". + a doap-tests:IntegrationTest; + doap-tests:purpose "Check type constraints work with Class::InsideOut."; + doap-tests:test_script _:B6. [] - a nfo:FileDataObject, nfo:SourceCode; - dc:license ; - dc:rightsHolder ; - nfo:fileName "inc/Test/Requires.pm"; - nfo:programmingLanguage "Perl". + a doap-tests:IntegrationTest; + doap-tests:purpose "Tests Exporter::Tiny has the features Type::Tiny needs."; + doap-tests:test_script _:B7. [] - a nfo:FileDataObject, nfo:SourceCode; - dc:license ; - dc:rightsHolder ; - nfo:fileName "inc/Try/Tiny.pm"; - nfo:programmingLanguage "Perl". + a doap-tests:IntegrationTest; + doap-tests:purpose "Tests Type::Library libraries work with Sub::Exporter plugins."; + doap-tests:test_script _:B8. [] - a nfo:FileDataObject; - dc:license ; - dc:rightsHolder ; - nfo:fileName "MANIFEST.SKIP". + a doap-tests:IntegrationTest; + doap-tests:purpose "Tests exporting to two roles; tries to avoid reporting conflicts."; + doap-tests:test_script _:B9. [] - a doap-tests:Test; - doap-tests:purpose "Print some standard diagnostics before beginning testing."; - doap-tests:test_script _:B5. + a doap-tests:IntegrationTest; + doap-tests:purpose "Check type constraints work with Function::Parameters."; + doap-tests:test_script _:B10. [] - a doap-tests:Test; - doap-tests:purpose "Test that Type::Tiny, Type::Library, etc compile."; - doap-tests:test_script _:B6. + a doap-tests:IntegrationTest; + doap-tests:purpose "Adopted test from Kavorka test suite."; + doap-tests:test_script _:B11. [] a doap-tests:IntegrationTest; doap-tests:purpose "Checks Type::Tiny works with Kavorka."; - doap-tests:test_script _:B18. + doap-tests:test_script _:B12. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints work with Moo. Checks values that should pass and should fail; checks error messages."; - doap-tests:test_script _:B19. + doap-tests:test_script _:B13. + +[] + a doap-tests:IntegrationTest; + doap-tests:purpose "A rather complex case of defining an attribute with a type coercion in Moo; and only then adding coercion definitions to it. Does Moo pick up on the changes? It should."; + doap-tests:test_script _:B14. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check coercions work with Moo."; - doap-tests:test_script _:B20. + doap-tests:test_script _:B15. [] a doap-tests:IntegrationTest; doap-tests:purpose "Tests Error::TypeTiny interaction with Moo."; - doap-tests:test_script _:B21. + doap-tests:test_script _:B16. [] a doap-tests:IntegrationTest; doap-tests:purpose "Checks that type constraints continue to work when a Moo class is inflated to a Moose class. Checks that Moo::HandleMoose correctly calls back to Type::Tiny to build Moose type constraints."; - doap-tests:test_script _:B22. + doap-tests:test_script _:B17. [] a doap-tests:IntegrationTest; doap-tests:purpose "A test for type constraint inflation from Moo to Moose."; - doap-tests:test_script _:B23. + doap-tests:test_script _:B18. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check that type constraints work in Moops. This file is borrowed from the Moops test suite, where it is called '31types.t'."; - doap-tests:test_script _:B24. + doap-tests:test_script _:B19. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check that type libraries can be declared with Moops. This file is borrowed from the Moops test suite, where it is called '71library.t'."; - doap-tests:test_script _:B25. + doap-tests:test_script _:B20. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check that Moose type constraints can be passed into the Type::Tiny API where a Type::Tiny constraint might usually be expected."; - doap-tests:test_script _:B26. + doap-tests:test_script _:B21. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints work with Moose. Checks values that should pass and should fail; checks error messages."; - doap-tests:test_script _:B27. + doap-tests:test_script _:B22. + +[] + a doap-tests:IntegrationTest; + doap-tests:purpose "Test for the good old \"You cannot coerce an attribute unless its type has a coercion\" error."; + doap-tests:test_script _:B23. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check coercions work with Moose; both mutable and immutable classes."; - doap-tests:test_script _:B28. + doap-tests:test_script _:B24. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraint inlining works with Moose in strange edge cases where we need to inflate Type::Tiny constraints into full Moose::Meta::TypeConstraint objects."; - doap-tests:test_script _:B29. + doap-tests:test_script _:B25. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints and coercions work with Moose native attibute traits."; - doap-tests:test_script _:B33. + doap-tests:test_script _:B26. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check coercions work with MooseX::Getopt; both mutable and immutable classes."; - doap-tests:test_script _:B34. + doap-tests:test_script _:B27. [] a doap-tests:IntegrationTest; doap-tests:purpose "Complex checks between Type::Tiny and MooseX::Types."; - doap-tests:test_script _:B35. + doap-tests:test_script _:B28. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check that Type::Library can extend an existing MooseX::Types type constraint library."; - doap-tests:test_script _:B36. + doap-tests:test_script _:B29. [] a doap-tests:IntegrationTest; doap-tests:purpose "More checks between Type::Tiny and MooseX::Types. This started out as an example of making a parameterized 'Not[]' type constraint, but worked out as a nice test case."; - doap-tests:test_script _:B37. + doap-tests:test_script _:B30. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints work with Mouse. Checks values that should pass and should fail; checks error messages."; - doap-tests:test_script _:B38. + doap-tests:test_script _:B31. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check coercions work with Mouse; both mutable and immutable classes."; - doap-tests:test_script _:B39. + doap-tests:test_script _:B32. [] a doap-tests:IntegrationTest; doap-tests:purpose "Complex checks between Type::Tiny and MouseX::Types."; - doap-tests:test_script _:B40. + doap-tests:test_script _:B33. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check that Type::Library can extend an existing MooseX::Types type constraint library."; - doap-tests:test_script _:B41. + doap-tests:test_script _:B34. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints work with Object::Accessor."; - doap-tests:test_script _:B42. + doap-tests:test_script _:B35. [] a doap-tests:IntegrationTest; doap-tests:purpose "Test that this sort of thing works: sub foo :ReturnType(Int) { ...; }"; - doap-tests:test_script _:B43. + doap-tests:test_script _:B36. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints can be made inlinable using Sub::Quote."; - doap-tests:test_script _:B44. + doap-tests:test_script _:B37. + +[] + a doap-tests:IntegrationTest; + doap-tests:purpose "Check type constraints can be made inlinable using Sub::Quote even if Sub::Quote is loaded late."; + doap-tests:test_script _:B38. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type coercions can be unquoted Sub::Quote."; - doap-tests:test_script _:B45. + doap-tests:test_script _:B39. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints can be unquoted Sub::Quote."; - doap-tests:test_script _:B46. + doap-tests:test_script _:B40. [] a doap-tests:IntegrationTest; doap-tests:purpose "Checks Type::Tiny works with Switcheroo."; - doap-tests:test_script _:B47. + doap-tests:test_script _:B41. [] a doap-tests:IntegrationTest; doap-tests:purpose "Test that this sort of thing works: tie my $var, Int;"; - doap-tests:test_script _:B48. + doap-tests:test_script _:B42. [] a doap-tests:IntegrationTest; doap-tests:purpose "Fake Validation::Class::Simple 7.900017 by overriding '$VERSION' variable. (There is a reason for this... 'Types::TypeTiny::to_TypeTiny' follows two different code paths depending on the version of the Validation::Class::Simple object passed to it.)"; - doap-tests:test_script _:B49. + doap-tests:test_script _:B43. [] a doap-tests:IntegrationTest; doap-tests:purpose "Check type constraints Validation::Class::Simple objects can be used as type constraints."; - doap-tests:test_script _:B50. + doap-tests:test_script _:B44. [] a doap-tests:IntegrationTest; doap-tests:purpose "Checks Type::Tiny works with match::simple."; - doap-tests:test_script _:B51. + doap-tests:test_script _:B45. [] a doap-tests:RegressionTest; doap-tests:purpose "Possible issue causing segfaults on threaded Perl 5.18.x."; - doap-tests:test_script _:B52. + doap-tests:test_script _:B46. [] a doap-tests:RegressionTest; doap-tests:purpose "Test that subtypes of Type::Tiny::Class work."; - doap-tests:test_script _:B53. + doap-tests:test_script _:B47. + +[] + a doap-tests:RegressionTest; + doap-tests:purpose "Test for non-inlined coercions in Moo. The issue that prompted this test was actually invalid, caused by a typo in the bug reporter's code. But I wrote the test case, so I might as well include it."; + doap-tests:test_script _:B48. [] a doap-tests:RegressionTest; doap-tests:purpose "Test that was failing with Type::Tiny::XS prior to 0.009."; - doap-tests:test_script _:B54. + doap-tests:test_script _:B49. [] a doap-tests:Test; doap-tests:purpose "Test that Type::Tiny and Type::Coercion provide a Moose/Mouse-compatible API."; - doap-tests:test_script _:B30. + doap-tests:test_script _:B3. [] a doap-tests:Test; doap-tests:purpose "Check for memory leaks. These tests are not comprehensive; chances are that there are still memory leaks lurking somewhere in Type::Tiny. If you have any concrete suggestions for things to test, or fixes for identified memory leaks, please file a bug report. https://rt.cpan.org/Ticket/Create.html?Queue=Type-Tiny."; - doap-tests:test_script _:B31. + doap-tests:test_script _:B4. [] a doap-tests:Test; doap-tests:purpose "Type constraint tests pilfered from the Moose test suite."; - doap-tests:test_script _:B32. - -[] - a doap-tests:IntegrationTest; - doap-tests:purpose "Check type constraints work with Class::InsideOut."; - doap-tests:test_script _:B13. - -[] - a doap-tests:IntegrationTest; - doap-tests:purpose "Tests Exporter::Tiny has the features Type::Tiny needs."; - doap-tests:test_script _:B14. - -[] - a doap-tests:IntegrationTest; - doap-tests:purpose "Tests Type::Library libraries work with Sub::Exporter plugins."; - doap-tests:test_script _:B15. - -[] - a doap-tests:IntegrationTest; - doap-tests:purpose "Tests exporting to two roles; tries to avoid reporting conflicts."; - doap-tests:test_script _:B16. - -[] - a doap-tests:IntegrationTest; - doap-tests:purpose "Check type constraints work with Function::Parameters."; - doap-tests:test_script _:B17. + doap-tests:test_script _:B5. diff -Nru libtype-tiny-perl-1.000005/examples/benchmark-coercions.pl libtype-tiny-perl-1.004004/examples/benchmark-coercions.pl --- libtype-tiny-perl-1.000005/examples/benchmark-coercions.pl 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmark-coercions.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -=pod - -=encoding utf-8 - -=head1 PURPOSE - -Compares the speed of the constructor in four equivalent classes built -using different tools: - -=over - -=item B - -L with L types and non-L -coderef coercions. - -=item B - -L with L types and coercions. - -=item B - -L with L type constraints and coderef coercions. Class is made -immutable. - -=item B - -L with L type constraints and coercions. Class is made -immutable. - -=back - -=head1 RESULTS - -For both Moose and Moo, L type constraints are clearly faster -than the conventional approach. - -B<< With Type::Tiny::XS: >> - - Rate Moo_MXTML Moose Moo_TT Moose_TT - Moo_MXTML 3040/s -- -44% -64% -83% - Moose 5463/s 80% -- -35% -69% - Moo_TT 8373/s 175% 53% -- -52% - Moose_TT 17612/s 479% 222% 110% -- - -B<< Without Type::Tiny::XS: >> - - Rate Moo_MXTML Moo_TT Moose Moose_TT - Moo_MXTML 3140/s -- -41% -50% -63% - Moo_TT 5288/s 68% -- -16% -38% - Moose 6305/s 101% 19% -- -26% - Moose_TT 8574/s 173% 62% 36% -- - -(Tested versions: Type::Tiny 0.045_03, Type::Tiny::XS 0.004, Moose 2.1207, -Moo 1.005000, and MooX::Types::MooseLike 0.25.) - -=head1 DEPENDENCIES - -To run this script, you will need: - -L, -L, L, L. - -=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 Benchmark ':all'; - -{ - package Local::Moo_MXTML; - use Moo; - use MooX::Types::MooseLike::Base qw(HashRef ArrayRef Int is_Int); - has attr1 => ( - is => "ro", - isa => ArrayRef[Int], - coerce => sub { is_Int($_[0]) ? [ $_[0] ] : $_[0] }, - ); - has attr2 => ( - is => "ro", - isa => HashRef[ArrayRef[Int]], - ); -} - -{ - package Local::Moo_TT; - use Moo; - use Types::Standard qw(HashRef ArrayRef Int); - my $AofI = (ArrayRef[Int])->plus_coercions(Int, '[$_]'); - has attr1 => ( - is => "ro", - isa => $AofI, - coerce => $AofI->coercion, - ); - has attr2 => ( - is => "ro", - isa => HashRef[ArrayRef[Int]], - ); -} - -{ - package Local::Moose; - use Moose; - use Moose::Util::TypeConstraints qw(subtype as coerce from via); - subtype "AofI", as "ArrayRef[Int]"; - coerce "AofI", from "Int", via { [$_] }; - has attr1 => ( - is => "ro", - isa => "AofI", - coerce => 1, - ); - has attr2 => ( - is => "ro", - isa => "HashRef[ArrayRef[Int]]", - ); - __PACKAGE__->meta->make_immutable; -} - -{ - package Local::Moose_TT; - use Moose; - use Types::Standard qw(HashRef ArrayRef Int); - use Sub::Quote; - my $AofI = (ArrayRef[Int])->plus_coercions(Int, '[$_]'); - has attr1 => ( - is => "ro", - isa => $AofI, - coerce => 1, - ); - has attr2 => ( - is => "ro", - isa => HashRef[ArrayRef[Int]], - ); - __PACKAGE__->meta->make_immutable; -} - -our %data = ( - attr1 => 4, - attr2 => { - one => [0 .. 1], - two => [0 .. 2], - three => [0 .. 3], - }, -); - -cmpthese(-1, { - Moo_MXTML => q{ Local::Moo_MXTML->new(%::data) }, - Moo_TT => q{ Local::Moo_TT->new(%::data) }, - Moose_TT => q{ Local::Moose_TT->new(%::data) }, - Moose => q{ Local::Moose->new(%::data) }, -}); diff -Nru libtype-tiny-perl-1.000005/examples/benchmark-constraints.pl libtype-tiny-perl-1.004004/examples/benchmark-constraints.pl --- libtype-tiny-perl-1.000005/examples/benchmark-constraints.pl 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmark-constraints.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -=pod - -=encoding utf-8 - -=head1 PURPOSE - -Compares the speed of the constructor in six equivalent classes built -using different tools: - -=over - -=item B - -L with L types. - -=item B - -L with L types. - -=item B - -L with L type constraints. Class is made immutable. - -=item B - -L with L type constraints. Class is made immutable. - -=item B - -L with L type constraints. Class is made immutable. -B<< XS is switched off using C environment variable. >> - -=item B - -L with L type constraints. Class is made immutable. -B<< XS is switched off using C environment variable. >> - -=back - -Each tool is used to define a class like the following: - - { - package Local::Class; - use Whatever::Tool; - use Types::Standard qw(HashRef ArrayRef Int); - has attr1 => (is => "ro", isa => ArrayRef[Int]); - has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); - } - -Then we benchmark the following object instantiation: - - Local::Class->new( - attr1 => [1..10], - attr2 => { - one => [0 .. 1], - two => [0 .. 2], - three => [0 .. 3], - }, - ); - -=head1 RESULTS - -In all cases, L type constraints are clearly faster -than the conventional approach. - -B<< With Type::Tiny::XS: >> - - Rate Moo_MXTML Mouse Moose Moo_TT Moose_TT Mouse_TT - Moo_MXTML 2428/s -- -35% -57% -82% -90% -91% - Mouse 3759/s 55% -- -33% -72% -85% -86% - Moose 5607/s 131% 49% -- -58% -78% -79% - Moo_TT 13274/s 447% 253% 137% -- -48% -51% - Moose_TT 25358/s 945% 575% 352% 91% -- -7% - Mouse_TT 27306/s 1025% 626% 387% 106% 8% -- - -B<< Without Type::Tiny::XS: >> - - Rate Moo_MXTML Mouse Moo_TT Moose Moose_TT Mouse_TT - Moo_MXTML 2610/s -- -31% -56% -56% -67% -67% - Mouse 3759/s 44% -- -36% -37% -52% -52% - Moo_TT 5894/s 126% 57% -- -1% -24% -25% - Moose 5925/s 127% 58% 1% -- -24% -25% - Moose_TT 7802/s 199% 108% 32% 32% -- -1% - Mouse_TT 7876/s 202% 110% 34% 33% 1% -- - -(Tested versions: Type::Tiny 0.045_03, Type::Tiny::XS 0.004, Moose 2.1207, -Moo 1.005000, MooX::Types::MooseLike 0.25, and Mouse 2.3.0) - -=head1 DEPENDENCIES - -To run this script, you will need: - -L, -L, L, L, L. - -=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 Benchmark ':all'; - -BEGIN { $ENV{MOUSE_PUREPERL} = 1 }; - -{ - package Local::Moo_MXTML; - use Moo; - use MooX::Types::MooseLike::Base qw(HashRef ArrayRef Int); - has attr1 => (is => "ro", isa => ArrayRef[Int]); - has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); -} - -{ - package Local::Moo_TT; - use Moo; - use Types::Standard qw(HashRef ArrayRef Int); - has attr1 => (is => "ro", isa => ArrayRef[Int]); - has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); -} - -{ - package Local::Moose; - use Moose; - has attr1 => (is => "ro", isa => "ArrayRef[Int]"); - has attr2 => (is => "ro", isa => "HashRef[ArrayRef[Int]]"); - __PACKAGE__->meta->make_immutable; -} - -{ - package Local::Moose_TT; - use Moose; - use Types::Standard qw(HashRef ArrayRef Int); - has attr1 => (is => "ro", isa => ArrayRef[Int]); - has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); - __PACKAGE__->meta->make_immutable; -} - -{ - package Local::Mouse; - use Mouse; - has attr1 => (is => "ro", isa => "ArrayRef[Int]"); - has attr2 => (is => "ro", isa => "HashRef[ArrayRef[Int]]"); - __PACKAGE__->meta->make_immutable; -} - -{ - package Local::Mouse_TT; - use Mouse; - use Types::Standard qw(HashRef ArrayRef Int); - has attr1 => (is => "ro", isa => ArrayRef[Int]); - has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); - __PACKAGE__->meta->make_immutable; -} - -our %data = ( - attr1 => [1..10], - attr2 => { - one => [0 .. 1], - two => [0 .. 2], - three => [0 .. 3], - }, -); - -cmpthese(-1, { - Moo_MXTML => q{ Local::Moo_MXTML->new(%::data) }, - Moose => q{ Local::Moose->new(%::data) }, - Mouse => q{ Local::Mouse->new(%::data) }, - Moo_TT => q{ Local::Moo_TT->new(%::data) }, - Moose_TT => q{ Local::Moose_TT->new(%::data) }, - Mouse_TT => q{ Local::Mouse_TT->new(%::data) }, -}); diff -Nru libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-coercions.pl libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-coercions.pl --- libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-coercions.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-coercions.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,162 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Compares the speed of the constructor in four equivalent classes built +using different tools: + +=over + +=item B + +L with L types and non-L +coderef coercions. + +=item B + +L with L types and coercions. + +=item B + +L with L type constraints and coderef coercions. Class is made +immutable. + +=item B + +L with L type constraints and coercions. Class is made +immutable. + +=back + +=head1 RESULTS + +For both Moose and Moo, L type constraints are clearly faster +than the conventional approach. + +B<< With Type::Tiny::XS: >> + + Rate Moo_MXTML Moose Moo_TT Moose_TT + Moo_MXTML 3040/s -- -44% -64% -83% + Moose 5463/s 80% -- -35% -69% + Moo_TT 8373/s 175% 53% -- -52% + Moose_TT 17612/s 479% 222% 110% -- + +B<< Without Type::Tiny::XS: >> + + Rate Moo_MXTML Moo_TT Moose Moose_TT + Moo_MXTML 3140/s -- -41% -50% -63% + Moo_TT 5288/s 68% -- -16% -38% + Moose 6305/s 101% 19% -- -26% + Moose_TT 8574/s 173% 62% 36% -- + +(Tested versions: Type::Tiny 0.045_03, Type::Tiny::XS 0.004, Moose 2.1207, +Moo 1.005000, and MooX::Types::MooseLike 0.25.) + +=head1 DEPENDENCIES + +To run this script, you will need: + +L, +L, L, L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017 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 Benchmark ':all'; + +{ + package Local::Moo_MXTML; + use Moo; + use MooX::Types::MooseLike::Base qw(HashRef ArrayRef Int is_Int); + has attr1 => ( + is => "ro", + isa => ArrayRef[Int], + coerce => sub { is_Int($_[0]) ? [ $_[0] ] : $_[0] }, + ); + has attr2 => ( + is => "ro", + isa => HashRef[ArrayRef[Int]], + ); +} + +{ + package Local::Moo_TT; + use Moo; + use Types::Standard qw(HashRef ArrayRef Int); + my $AofI = (ArrayRef[Int])->plus_coercions(Int, '[$_]'); + has attr1 => ( + is => "ro", + isa => $AofI, + coerce => $AofI->coercion, + ); + has attr2 => ( + is => "ro", + isa => HashRef[ArrayRef[Int]], + ); +} + +{ + package Local::Moose; + use Moose; + use Moose::Util::TypeConstraints qw(subtype as coerce from via); + subtype "AofI", as "ArrayRef[Int]"; + coerce "AofI", from "Int", via { [$_] }; + has attr1 => ( + is => "ro", + isa => "AofI", + coerce => 1, + ); + has attr2 => ( + is => "ro", + isa => "HashRef[ArrayRef[Int]]", + ); + __PACKAGE__->meta->make_immutable; +} + +{ + package Local::Moose_TT; + use Moose; + use Types::Standard qw(HashRef ArrayRef Int); + use Sub::Quote; + my $AofI = (ArrayRef[Int])->plus_coercions(Int, '[$_]'); + has attr1 => ( + is => "ro", + isa => $AofI, + coerce => 1, + ); + has attr2 => ( + is => "ro", + isa => HashRef[ArrayRef[Int]], + ); + __PACKAGE__->meta->make_immutable; +} + +our %data = ( + attr1 => 4, + attr2 => { + one => [0 .. 1], + two => [0 .. 2], + three => [0 .. 3], + }, +); + +cmpthese(-1, { + Moo_MXTML => q{ Local::Moo_MXTML->new(%::data) }, + Moo_TT => q{ Local::Moo_TT->new(%::data) }, + Moose_TT => q{ Local::Moose_TT->new(%::data) }, + Moose => q{ Local::Moose->new(%::data) }, +}); diff -Nru libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-constraints.pl libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-constraints.pl --- libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-constraints.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-constraints.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,181 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Compares the speed of the constructor in six equivalent classes built +using different tools: + +=over + +=item B + +L with L types. + +=item B + +L with L types. + +=item B + +L with L type constraints. Class is made immutable. + +=item B + +L with L type constraints. Class is made immutable. + +=item B + +L with L type constraints. Class is made immutable. +B<< XS is switched off using C environment variable. >> + +=item B + +L with L type constraints. Class is made immutable. +B<< XS is switched off using C environment variable. >> + +=back + +Each tool is used to define a class like the following: + + { + package Local::Class; + use Whatever::Tool; + use Types::Standard qw(HashRef ArrayRef Int); + has attr1 => (is => "ro", isa => ArrayRef[Int]); + has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); + } + +Then we benchmark the following object instantiation: + + Local::Class->new( + attr1 => [1..10], + attr2 => { + one => [0 .. 1], + two => [0 .. 2], + three => [0 .. 3], + }, + ); + +=head1 RESULTS + +In all cases, L type constraints are clearly faster +than the conventional approach. + +B<< With Type::Tiny::XS: >> + + Rate Moo_MXTML Mouse Moose Moo_TT Moose_TT Mouse_TT + Moo_MXTML 2428/s -- -35% -57% -82% -90% -91% + Mouse 3759/s 55% -- -33% -72% -85% -86% + Moose 5607/s 131% 49% -- -58% -78% -79% + Moo_TT 13274/s 447% 253% 137% -- -48% -51% + Moose_TT 25358/s 945% 575% 352% 91% -- -7% + Mouse_TT 27306/s 1025% 626% 387% 106% 8% -- + +B<< Without Type::Tiny::XS: >> + + Rate Moo_MXTML Mouse Moo_TT Moose Moose_TT Mouse_TT + Moo_MXTML 2610/s -- -31% -56% -56% -67% -67% + Mouse 3759/s 44% -- -36% -37% -52% -52% + Moo_TT 5894/s 126% 57% -- -1% -24% -25% + Moose 5925/s 127% 58% 1% -- -24% -25% + Moose_TT 7802/s 199% 108% 32% 32% -- -1% + Mouse_TT 7876/s 202% 110% 34% 33% 1% -- + +(Tested versions: Type::Tiny 0.045_03, Type::Tiny::XS 0.004, Moose 2.1207, +Moo 1.005000, MooX::Types::MooseLike 0.25, and Mouse 2.3.0) + +=head1 DEPENDENCIES + +To run this script, you will need: + +L, +L, L, L, L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017 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 Benchmark ':all'; + +BEGIN { $ENV{MOUSE_PUREPERL} = 1 }; + +{ + package Local::Moo_MXTML; + use Moo; + use MooX::Types::MooseLike::Base qw(HashRef ArrayRef Int); + has attr1 => (is => "ro", isa => ArrayRef[Int]); + has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); +} + +{ + package Local::Moo_TT; + use Moo; + use Types::Standard qw(HashRef ArrayRef Int); + has attr1 => (is => "ro", isa => ArrayRef[Int]); + has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); +} + +{ + package Local::Moose; + use Moose; + has attr1 => (is => "ro", isa => "ArrayRef[Int]"); + has attr2 => (is => "ro", isa => "HashRef[ArrayRef[Int]]"); + __PACKAGE__->meta->make_immutable; +} + +{ + package Local::Moose_TT; + use Moose; + use Types::Standard qw(HashRef ArrayRef Int); + has attr1 => (is => "ro", isa => ArrayRef[Int]); + has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); + __PACKAGE__->meta->make_immutable; +} + +{ + package Local::Mouse; + use Mouse; + has attr1 => (is => "ro", isa => "ArrayRef[Int]"); + has attr2 => (is => "ro", isa => "HashRef[ArrayRef[Int]]"); + __PACKAGE__->meta->make_immutable; +} + +{ + package Local::Mouse_TT; + use Mouse; + use Types::Standard qw(HashRef ArrayRef Int); + has attr1 => (is => "ro", isa => ArrayRef[Int]); + has attr2 => (is => "ro", isa => HashRef[ArrayRef[Int]]); + __PACKAGE__->meta->make_immutable; +} + +our %data = ( + attr1 => [1..10], + attr2 => { + one => [0 .. 1], + two => [0 .. 2], + three => [0 .. 3], + }, +); + +cmpthese(-1, { + Moo_MXTML => q{ Local::Moo_MXTML->new(%::data) }, + Moose => q{ Local::Moose->new(%::data) }, + Mouse => q{ Local::Mouse->new(%::data) }, + Moo_TT => q{ Local::Moo_TT->new(%::data) }, + Moose_TT => q{ Local::Moose_TT->new(%::data) }, + Mouse_TT => q{ Local::Mouse_TT->new(%::data) }, +}); diff -Nru libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-named-param-validation.pl libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-named-param-validation.pl --- libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-named-param-validation.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-named-param-validation.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,117 @@ +=pod + +=encoding utf-8 + +=head1 DESCRIPTION + +Let's use L to see how fast +L is compared with other modules for validating +named parameters. (Hint: very fast.) + +=head1 RESULTS + +The results of running the script on a fairly low-powered laptop. +Each parameter checking implementation is called 250,000 times. +The table below displays the average time taken for each call in +nanoseconds. + +=head2 With Type::Tiny::XS + + Type::Params .................................... 5079 ns (196850/s) + Params::ValidateCompiler with Type::Tiny ........ 6599 ns (151515/s) + Pure Perl Implementation with Ref::Util::XS ..... 7000 ns (142857/s) + Naive Pure Perl Implementation .................. 7560 ns (132275/s) + Data::Validator with Mouse ...................... 8440 ns (118483/s) + Data::Validator with Type::Tiny ................. 9840 ns (101626/s) + Params::ValidateCompiler with Moose ............. 11279 ns (88652/s) + Params::ValidateCompiler with Specio ............ 11320 ns (88339/s) + Data::Validator with Moose ...................... 18319 ns (54585/s) + Params::Check with Type::Tiny ................... 21639 ns (46210/s) + Params::Check with coderefs ..................... 28079 ns (35612/s) + MooseX::Params::Validate with Moose ............. 48559 ns (20593/s) + MooseX::Params::Validate with Type::Tiny ........ 54079 ns (18491/s) + +=head2 Without Type::Tiny::XS + + Pure Perl Implementation with Ref::Util::XS ..... 7120 ns (140449/s) + Naive Pure Perl Implementation .................. 7520 ns (132978/s) + Type::Params .................................... 7960 ns (125628/s) + Data::Validator with Mouse ...................... 9000 ns (111111/s) + Params::ValidateCompiler with Type::Tiny ........ 9159 ns (109170/s) + Params::ValidateCompiler with Moose ............. 10159 ns (98425/s) + Params::ValidateCompiler with Specio ............ 11240 ns (88967/s) + Data::Validator with Type::Tiny ................. 14240 ns (70224/s) + Data::Validator with Moose ...................... 18159 ns (55066/s) + Params::Check with Type::Tiny ................... 22039 ns (45372/s) + Params::Check with coderefs ..................... 22479 ns (44483/s) + MooseX::Params::Validate with Moose ............. 42920 ns (23299/s) + MooseX::Params::Validate with Type::Tiny ........ 43360 ns (23062/s) + +=head1 ANALYSIS + +Type::Params (using Type::Tiny type constraints) provides the fastest way of +checking named parameters for a function, whether or not Type::Tiny::XS +is available. + +Params::ValidationCompiler (also using Type::Tiny type constraints) is very +nearly as fast. + +Params::ValidationCompiler using other type constraints is also quite fast, +and when Type::Tiny::XS is not available, Moose and Specio constraints run +almost as fast as Type::Tiny constraints. + +Data::Validator is acceptably fast. + +Params::Check is fairly slow, and MooseX::Params::Validate very slow. + +Type::Tiny::XS seems to slow down MooseX::Params::Validate for some strange +reason. + +=head1 DEPENDENCIES + +To run this script, you will need: + +L, +L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2017 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 v5.12; +use strict; +use warnings; +use Benchmark qw(:hireswallclock timeit); +use Benchmark::Featureset::ParamCheck 0.002; +use Module::Runtime qw(use_module); + +my $data = 'Benchmark::Featureset::ParamCheck'->trivial_named_data; +my @impl = 'Benchmark::Featureset::ParamCheck'->implementations; +my $iter = 250_000; + +say for + map { + sprintf( + '%s %s %6d ns (%d/s)', + $_->[0]->long_name, + '.' x (48 - length($_->[0]->long_name)), + 1_000_000_000 * $_->[1]->cpu_a / $iter, + $iter / $_->[1]->cpu_a, + ); + } + sort { + $a->[1]->cpu_a <=> $b->[1]->cpu_a; + } + map { + my $pkg = use_module($_); + [ $pkg, timeit 1, sub { $pkg->run_named_check($iter, $data) } ]; + } @impl; diff -Nru libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-param-validation.pl libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-param-validation.pl --- libtype-tiny-perl-1.000005/examples/benchmarking/benchmark-param-validation.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmarking/benchmark-param-validation.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,115 @@ +=pod + +=encoding utf-8 + +=head1 DESCRIPTION + +Let's use L to see how fast +L is compared with other modules for validating +positional parameters. (Hint: very fast.) + +=head1 RESULTS + +The results of running the script on a fairly low-powered laptop. +Each parameter checking implementation is called 250,000 times. +The table below displays the average time taken for each call in +nanoseconds. + +=head2 With Type::Tiny::XS + + Type::Params .................................... 2640 ns (378787/s) + Params::ValidationCompiler with Type::Tiny ...... 3120 ns (320512/s) + Pure Perl Implementation with Ref::Util::XS ..... 3639 ns (274725/s) + Naive Pure Perl Implementation .................. 4600 ns (217391/s) + Params::ValidationCompiler with Specio .......... 11719 ns (85324/s) + Params::ValidationCompiler with Moose ........... 12079 ns (82781/s) + Data::Validator with Mouse ...................... 51760 ns (19319/s) + Data::Validator with Type::Tiny ................. 51920 ns (19260/s) + Data::Validator with Moose ...................... 52120 ns (19186/s) + MooseX::Params::Validate with Moose ............. 83080 ns (12036/s) + MooseX::Params::Validate with Type::Tiny ........ 84839 ns (11786/s) + +=head2 Without Type::Tiny::XS + + Pure Perl Implementation with Ref::Util::XS ..... 3560 ns (280898/s) + Naive Pure Perl Implementation .................. 4479 ns (223214/s) + Type::Params .................................... 7879 ns (126903/s) + Params::ValidationCompiler with Type::Tiny ...... 8319 ns (120192/s) + Params::ValidationCompiler with Specio .......... 11800 ns (84745/s) + Params::ValidationCompiler with Moose ........... 12159 ns (82236/s) + Data::Validator with Type::Tiny ................. 51039 ns (19592/s) + Data::Validator with Moose ...................... 51559 ns (19394/s) + Data::Validator with Mouse ...................... 51760 ns (19319/s) + MooseX::Params::Validate with Type::Tiny ........ 82800 ns (12077/s) + MooseX::Params::Validate with Moose ............. 93160 ns (10734/s) + +=head1 ANALYSIS + +Type::Params (using Type::Tiny type constraints) provides the fastest convenient +way of checking positional parameters for a function, whether or not Type::Tiny::XS +is available. + +The only way to beat it is to write your own type checking in longhand, +but if Type::Tiny::XS is installed, you probably still won't be able +to match Type::Params' speed. + +Params::ValidationCompiler (also using Type::Tiny type constraints) is very +nearly as fast. + +Params::ValidationCompiler using other type constraints is also quite fast, +and when Type::Tiny::XS is not available, Moose and Specio constraints run +almost as fast as Type::Tiny constraints. + +Data::Validator and MooseX::Params::Validate are far slower. + +=head1 DEPENDENCIES + +To run this script, you will need: + +L, +L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017 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 v5.12; +use strict; +use warnings; +use Benchmark qw(:hireswallclock timeit); +use Benchmark::Featureset::ParamCheck 0.002; +use Module::Runtime qw(use_module); + +my $data = 'Benchmark::Featureset::ParamCheck'->trivial_positional_data; +my @impl = 'Benchmark::Featureset::ParamCheck'->implementations; +my $iter = 250_000; + +say for + map { + sprintf( + '%s %s %6d ns (%d/s)', + $_->[0]->long_name, + '.' x (48 - length($_->[0]->long_name)), + 1_000_000_000 * $_->[1]->cpu_a / $iter, + $iter / $_->[1]->cpu_a, + ); + } + sort { + $a->[1]->cpu_a <=> $b->[1]->cpu_a; + } + map { + my $pkg = use_module($_); + $pkg->accept_array + ? [ $pkg, timeit 1, sub { $pkg->run_positional_check($iter, @$data) } ] + : () + } + @impl; diff -Nru libtype-tiny-perl-1.000005/examples/benchmarking/versus-scalar-validation.pl libtype-tiny-perl-1.004004/examples/benchmarking/versus-scalar-validation.pl --- libtype-tiny-perl-1.000005/examples/benchmarking/versus-scalar-validation.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmarking/versus-scalar-validation.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,87 @@ +use strict; +use warnings; +use Test::More; +use Test::Fatal; +use Test::Benchmark; +use Benchmark qw(timethis); + +$Test::Benchmark::VERBOSE = 1; + +{ + package UseSV; + + use Scalar::Validation qw(:all); + + sub test { + my $p_bool = par p_bool => -Enum => [0 => '1'] => shift; + my $p_123 = par p_123 => -Enum => {1 => 1, 2 => 1, 3 => 1} => shift; + my $p_free = par p_free => sub { $_ > 5 } => shift, sub { "$_ is not larger than 5" }; + p_end \@_; + + return $p_bool + $p_123 + $p_free; + } +} + +{ + package UseTP; + + use Type::Params qw(compile); + use Types::Standard qw(Enum); + use Types::XSD::Lite qw(Integer); + + my $_check = compile Enum[0,1], Enum[1..3], Integer[minExclusive => 5]; + + sub test { + my ($p_bool, $p_123, $p_free) = $_check->(@_); + return $p_bool + $p_123 + $p_free; + } +} + +subtest "Scalar::Validation works ok" => sub { + is( UseSV::test(1,2,7), 10 ); + + like( + exception { UseSV::test(2,2,2) }, + qr/^Error/, + ); +}; + +subtest "Type::Params works ok" => sub { + is( UseTP::test(1,2,7), 10 ); + + like( + exception { UseTP::test(2,2,2) }, + qr/did not pass type constraint/, + ); +}; + +is_fastest('TP', -1, { + SV => q[ UseSV::test(1,2,7) ], + TP => q[ UseTP::test(1,2,7) ], +}, 'Type::Params is fastest at passing validations'); + +is_fastest('TP', -1, { + SV => q[ eval { UseSV::test(1,2,3) } ], + TP => q[ eval { UseTP::test(1,2,3) } ], +}, 'Type::Params is fastest at failing validations'); + +done_testing; + +__END__ + # Subtest: Scalar::Validation works ok + ok 1 + ok 2 + 1..2 +ok 1 - Scalar::Validation works ok + # Subtest: Type::Params works ok + ok 1 + ok 2 + 1..2 +ok 2 - Type::Params works ok +ok 3 - Type::Params is fastest at passing validations +# TP - 2 wallclock secs ( 1.17 usr + 0.00 sys = 1.17 CPU) @ 6564.10/s (n=7680) +# SV - 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 4744.66/s (n=4887) +ok 4 - Type::Params is fastest at failing validations +# TP - 1 wallclock secs ( 1.05 usr + 0.00 sys = 1.05 CPU) @ 3412.38/s (n=3583) +# SV - 1 wallclock secs ( 1.07 usr + 0.03 sys = 1.10 CPU) @ 1285.45/s (n=1414) +1..4 diff -Nru libtype-tiny-perl-1.000005/examples/benchmark-param-validation.pl libtype-tiny-perl-1.004004/examples/benchmark-param-validation.pl --- libtype-tiny-perl-1.000005/examples/benchmark-param-validation.pl 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/benchmark-param-validation.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,229 +0,0 @@ -=pod - -=encoding utf-8 - -=head1 TEST 1: COMPLEX PARAMETER CHECKING - -Compares the run-time speed of five parameter validators for validating -a fairly complex function signature. The function accepts an arrayref, -followed by an object providing C and C methods, followed -by an integer less than 90. - -The validators tested were: - -=over - -=item B (shown as B in results table) - -Using the C trait. - -=item B (shown as B in results table) - -C given the following spec: - - state $spec = [ - { type => ARRAYREF, - }, - { can => ["print", "say"], - }, - { type => SCALAR, - regex => qr{^\d+$}, - callbacks => { - 'less than 90' => sub { shift() < 90 }, - }, - }, - ]; - -=item B (shown as B in results table) - -Given three coderefs to validate parameters. - -=item B<< Type::Params::validate() >> (shown as B<< T:P v >> in results table) - -Called as: - - validate(\@_, ArrayRef, $PrintAndSay, $SmallInt); - -Where C<< $PrintAndSay >> is a duck type, and C<< $SmallInt >> is a -subtype of C<< Int >>, with inlining defined. - -=item B<< Type::Params::compile() >> (shown as B<< T:P c >> in results table) - -Using the same type constraints as C<< validate() >> - -=back - -=head2 Results - -B<< With Type::Tiny::XS: >> - - Rate [D:V] [P:V] [P:C] [T:P v] [T:P c] - [D:V] 10324/s -- -8% -35% -48% -81% - [P:V] 11247/s 9% -- -29% -43% -80% - [P:C] 15941/s 54% 42% -- -19% -71% - [T:P v] 19685/s 91% 75% 23% -- -64% - [T:P c] 55304/s 436% 392% 247% 181% -- - -B<< Without Type::Tiny::XS: >> - - Rate [P:V] [D:V] [P:C] [T:P v] [T:P c] - [P:V] 9800/s -- -7% -8% -41% -72% - [D:V] 10500/s 7% -- -1% -37% -71% - [P:C] 10609/s 8% 1% -- -36% -70% - [T:P v] 16638/s 70% 58% 57% -- -53% - [T:P c] 35628/s 264% 239% 236% 114% -- - -(Tested versions: Data::Validator 1.04 with Mouse 2.3.0, -Params::Validate 1.10, Params::Check 0.38, and Type::Params 0.045_03 -with Type::Tiny::XS 0.004.) - -=head1 TEST B: SIMPLE PARAMETER CHECKING - -Based on the idea that I was playing to Type::Params' strengths, -I decided on something I thought would be more of a challenge: a simpler -function signature which takes two required and one optional parameters. -This is purely a test of parameter count; no type checking is involved! - -This is a face off between Type::Params and Params::Validate. - -=head2 Results - -Because no type checks are involved, it doesn't matter whether -Type::Tiny::XS is available or not. (The results are similar either -way.) - - Rate [P:V] [T:P c] - [P:V] 73643/s -- -70% - [T:P c] 241917/s 228% -- - -=head1 DEPENDENCIES - -To run this script, you will need: - -L, -L, L, L. - -=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 feature qw(state); -use Benchmark qw(cmpthese); - -# In today's contest, we'll be comparing Type::Params... -# -use Type::Params qw( compile validate ); -use Type::Utils; -use Types::Standard qw( -types ); - -# ... with Params::Validate... -# -BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS' }; # ... which we'll give a fighting chance -use Params::Validate qw( validate_pos ARRAYREF SCALAR ); - -# ... and Data::Validator... -use Data::Validator (); -use Mouse::Util::TypeConstraints (); - -# ... and Params::Check... -use Params::Check (); - -# Define custom type constraints... -my $PrintAndSay = duck_type PrintAndSay => ["print", "say"]; -my $SmallInt = declare SmallInt => as Int, - where { $_ < 90 }, - inline_as { $_[0]->parent->inline_check($_)." and $_ < 90" }; - -# ... and for Mouse... -my $PrintAndSay2 = Mouse::Util::TypeConstraints::duck_type(PrintAndSay => ["print", "say"]); -my $SmallInt2 = Mouse::Util::TypeConstraints::subtype( - "SmallInt", - Mouse::Util::TypeConstraints::as("Int"), - Mouse::Util::TypeConstraints::where(sub { $_ < 90 }), -); - -sub TypeParams_validate -{ - my @in = validate(\@_, ArrayRef, $PrintAndSay, $SmallInt); -} - -sub TypeParams_compile -{ - state $spec = compile(ArrayRef, $PrintAndSay, $SmallInt); - my @in = $spec->(@_); -} - -sub ParamsValidate -{ - state $spec = [ - { type => ARRAYREF }, - { can => ["print", "say"] }, - { type => SCALAR, regex => qr{^\d+$}, callbacks => { 'less than 90' => sub { shift() < 90 } } }, - ]; - my @in = validate_pos(@_, @$spec); -} - -sub ParamsCheck -{ - state $spec = [ - [sub { ref $_[0] eq 'ARRAY' }], - [sub { Scalar::Util::blessed($_[0]) and $_[0]->can("print") and $_[0]->can("say") }], - [sub { !ref($_[0]) and $_[0] =~ m{^\d+$} and $_[0] < 90 }], - ]; - # Params::Check::check doesn't support positional parameters. - # Params::Check::allow fakery instead. - my @in = map { - Params::Check::allow($_[$_], $spec->[$_]) - ? $_[$_] - : die - } 0..$#$spec; -} - -sub DataValidator -{ - state $spec = "Data::Validator"->new( - first => "ArrayRef", - second => $PrintAndSay2, - third => $SmallInt2, - )->with("StrictSequenced"); - my @in = $spec->validate(@_); -} - -# Actually run the benchmarks... -# - -use IO::Handle (); -our @data = ( - [1, 2, 3], - IO::Handle->new, - 50, -); - -cmpthese(-3, { - '[D:V]' => q{ DataValidator(@::data) }, - '[P:V]' => q{ ParamsValidate(@::data) }, - '[P:C]' => q{ ParamsCheck(@::data) }, - '[T:P v]' => q{ TypeParams_validate(@::data) }, - '[T:P c]' => q{ TypeParams_compile(@::data) }, -}); - -# Now we'll just do a simple check of argument count; not checking any types! -print "\n----\n\n"; -our $CHK = compile(1, 1, 0); -our @ARGS = 1..2; -cmpthese(-3, { - '[T:P c]' => q { $::CHK->(@::ARGS) }, - '[P:V]' => q { validate_pos(@::ARGS, 1, 1, 0) }, -}); - diff -Nru libtype-tiny-perl-1.000005/examples/nonempty.pl libtype-tiny-perl-1.004004/examples/nonempty.pl --- libtype-tiny-perl-1.000005/examples/nonempty.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/nonempty.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,65 @@ +use v5.14; +use strict; +use warnings; + +package Example1 { + use Moo; + use Sub::Quote 'quote_sub'; + use Types::Standard -types; + + has my_string => ( + is => 'ro', + isa => Str->where( 'length($_) > 0' ), + ); + + has my_array => ( + is => 'ro', + isa => ArrayRef->where( '@$_ > 0' ), + ); + + has my_hash => ( + is => 'ro', + isa => HashRef->where( 'keys(%$_) > 0' ), + ); +} + +use Test::More; +use Test::Fatal; + +is( + exception { Example1::->new( my_string => 'u' ) }, + undef, + 'non-empty string, okay', +); + +isa_ok( + exception { Example1::->new( my_string => '' ) }, + 'Error::TypeTiny', + 'result of empty string', +); + +is( + exception { Example1::->new( my_array => [undef] ) }, + undef, + 'non-empty arrayref, okay', +); + +isa_ok( + exception { Example1::->new( my_array => [] ) }, + 'Error::TypeTiny', + 'result of empty arrayref', +); + +is( + exception { Example1::->new( my_hash => { '' => undef } ) }, + undef, + 'non-empty hashref, okay', +); + +isa_ok( + exception { Example1::->new( my_hash => +{} ) }, + 'Error::TypeTiny', + 'result of empty hashref', +); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/examples/page-numbers.pl libtype-tiny-perl-1.004004/examples/page-numbers.pl --- libtype-tiny-perl-1.000005/examples/page-numbers.pl 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/page-numbers.pl 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,87 @@ +use strict; +use warnings; + +# Type constraint library… +BEGIN { + package Types::Bookish; + $INC{'Types/Bookish.pm'} = __FILE__; + + use Type::Library -base, + -declare => qw( PageNumber PageRangeArray PageRange PageSeriesArray PageSeries ); + use Types::Standard qw( Str StrMatch Tuple ArrayRef ); + use Types::Common::Numeric qw( PositiveInt ); + use Type::Utils -all; + + declare PageNumber, + as PositiveInt, + ; + + declare PageRangeArray, + as Tuple[ PageNumber, PageNumber ], + constraint => '$_->[0] < $_->[1]', + ; + + declare PageRange, + as StrMatch[ qr/\A([0-9]+)-([0-9]+)\z/, PageRangeArray ], + ; + + coerce PageRangeArray + from PageRange, q{ [ split /-/, $_ ] }, + ; + + coerce PageRange + from PageRangeArray, q{ join q/-/, @$_ }, + ; + + declare PageSeriesArray, + as ArrayRef[ PageNumber | PageRange ], + constraint => ( + # This constraint prevents page series arrays from being in + # the wrong order, like [ 20, '4-16', 12 ]. + 'my $J = join q/-/, @$_; '. + 'my $S = join q/-/, sort { $a <=> $b } split /-/, $J; '. + '$S eq $J' + ), + ; + + declare PageSeries, + as Str, + constraint => ( + 'my $tmp = [split /\s*,\s*/]; '. + PageSeriesArray->inline_check('$tmp') + ), + ; + + coerce PageSeriesArray + from PageSeries, q{ [ split /\s*,\s*/, $_ ] }, + from PageRange, q{ [ $_ ] }, + from PageNumber, q{ [ $_ ] }, + ; + + coerce PageSeries + from PageSeriesArray, q{ join q[,], @$_ }, + ; + + + __PACKAGE__->meta->make_immutable; +} + +use Types::Bookish -types; +use Perl::Tidy; + +PageNumber->assert_valid('4'); + +PageRangeArray->assert_valid([4, 16]); + +PageRange->assert_valid('4-16'); + +PageSeriesArray->assert_valid([ '4-16', 18, 20 ]); + +PageSeries->assert_valid('4-16, 18, 20'); + +Perl::Tidy::perltidy( + source => \( PageSeries->inline_check('$DATA') ), + destination => \( my $tidied ), +); + +print $tidied; diff -Nru libtype-tiny-perl-1.000005/examples/versus-scalar-validation.pl libtype-tiny-perl-1.004004/examples/versus-scalar-validation.pl --- libtype-tiny-perl-1.000005/examples/versus-scalar-validation.pl 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/examples/versus-scalar-validation.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -use strict; -use warnings; -use Test::More; -use Test::Fatal; -use Test::Benchmark; -use Benchmark qw(timethis); - -$Test::Benchmark::VERBOSE = 1; - -{ - package UseSV; - - use Scalar::Validation qw(:all); - - sub test { - my $p_bool = par p_bool => -Enum => [0 => '1'] => shift; - my $p_123 = par p_123 => -Enum => {1 => 1, 2 => 1, 3 => 1} => shift; - my $p_free = par p_free => sub { $_ > 5 } => shift, sub { "$_ is not larger than 5" }; - p_end \@_; - - return $p_bool + $p_123 + $p_free; - } -} - -{ - package UseTP; - - use Type::Params qw(compile); - use Types::Standard qw(Enum); - use Types::XSD::Lite qw(Integer); - - my $_check = compile Enum[0,1], Enum[1..3], Integer[minExclusive => 5]; - - sub test { - my ($p_bool, $p_123, $p_free) = $_check->(@_); - return $p_bool + $p_123 + $p_free; - } -} - -subtest "Scalar::Validation works ok" => sub { - is( UseSV::test(1,2,7), 10 ); - - like( - exception { UseSV::test(2,2,2) }, - qr/^Error/, - ); -}; - -subtest "Type::Params works ok" => sub { - is( UseTP::test(1,2,7), 10 ); - - like( - exception { UseTP::test(2,2,2) }, - qr/did not pass type constraint/, - ); -}; - -is_fastest('TP', -1, { - SV => q[ UseSV::test(1,2,7) ], - TP => q[ UseTP::test(1,2,7) ], -}, 'Type::Params is fastest at passing validations'); - -is_fastest('TP', -1, { - SV => q[ eval { UseSV::test(1,2,3) } ], - TP => q[ eval { UseTP::test(1,2,3) } ], -}, 'Type::Params is fastest at failing validations'); - -done_testing; - -__END__ - # Subtest: Scalar::Validation works ok - ok 1 - ok 2 - 1..2 -ok 1 - Scalar::Validation works ok - # Subtest: Type::Params works ok - ok 1 - ok 2 - 1..2 -ok 2 - Type::Params works ok -ok 3 - Type::Params is fastest at passing validations -# TP - 2 wallclock secs ( 1.17 usr + 0.00 sys = 1.17 CPU) @ 6564.10/s (n=7680) -# SV - 1 wallclock secs ( 1.03 usr + 0.00 sys = 1.03 CPU) @ 4744.66/s (n=4887) -ok 4 - Type::Params is fastest at failing validations -# TP - 1 wallclock secs ( 1.05 usr + 0.00 sys = 1.05 CPU) @ 3412.38/s (n=3583) -# SV - 1 wallclock secs ( 1.07 usr + 0.03 sys = 1.10 CPU) @ 1285.45/s (n=1414) -1..4 diff -Nru libtype-tiny-perl-1.000005/lib/Devel/TypeTiny/Perl56Compat.pm libtype-tiny-perl-1.004004/lib/Devel/TypeTiny/Perl56Compat.pm --- libtype-tiny-perl-1.000005/lib/Devel/TypeTiny/Perl56Compat.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Devel/TypeTiny/Perl56Compat.pm 2019-01-08 18:26:35.000000000 +0000 @@ -5,7 +5,7 @@ use warnings; our $AUTHORITY = 'cpan:TOBYINK'; -our $VERSION = '1.000005'; +our $VERSION = '1.004004'; #### B doesn't provide perlstring() in 5.6. Monkey patch it. @@ -23,7 +23,12 @@ }; } -push @B::EXPORT_OK, 'perlstring'; +unless (exists &B::cstring) +{ + *B::cstring = \&B::perlstring; +} + +push @B::EXPORT_OK, qw( perlstring cstring ); #### Done! @@ -65,7 +70,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Devel/TypeTiny/Perl58Compat.pm libtype-tiny-perl-1.004004/lib/Devel/TypeTiny/Perl58Compat.pm --- libtype-tiny-perl-1.000005/lib/Devel/TypeTiny/Perl58Compat.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Devel/TypeTiny/Perl58Compat.pm 2019-01-08 18:26:35.000000000 +0000 @@ -5,7 +5,7 @@ use warnings; our $AUTHORITY = 'cpan:TOBYINK'; -our $VERSION = '1.000005'; +our $VERSION = '1.004004'; #### re doesn't provide is_regexp in Perl < 5.10 @@ -21,7 +21,7 @@ #### Done! -5.6; +5.8; __END__ @@ -59,7 +59,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Error/TypeTiny/Assertion.pm libtype-tiny-perl-1.004004/lib/Error/TypeTiny/Assertion.pm --- libtype-tiny-perl-1.000005/lib/Error/TypeTiny/Assertion.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Error/TypeTiny/Assertion.pm 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ BEGIN { $Error::TypeTiny::Assertion::AUTHORITY = 'cpan:TOBYINK'; - $Error::TypeTiny::Assertion::VERSION = '1.000005'; + $Error::TypeTiny::Assertion::VERSION = '1.004004'; } require Error::TypeTiny; @@ -76,7 +76,7 @@ $msg .= sprintf(" at %s line %s", $c->{file}||'file?', $c->{line}||'NaN') if $c; my $explain = $e->explain; - return $msg unless @{ $explain || [] }; + return "$msg\n" unless @{ $explain || [] }; $msg .= "\n"; for my $line (@$explain) { @@ -187,7 +187,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Error/TypeTiny/Compilation.pm libtype-tiny-perl-1.004004/lib/Error/TypeTiny/Compilation.pm --- libtype-tiny-perl-1.000005/lib/Error/TypeTiny/Compilation.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Error/TypeTiny/Compilation.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Error::TypeTiny::Compilation::AUTHORITY = 'cpan:TOBYINK'; - $Error::TypeTiny::Compilation::VERSION = '1.000005'; + $Error::TypeTiny::Compilation::VERSION = '1.004004'; } require Error::TypeTiny; @@ -81,7 +81,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Error/TypeTiny/WrongNumberOfParameters.pm libtype-tiny-perl-1.004004/lib/Error/TypeTiny/WrongNumberOfParameters.pm --- libtype-tiny-perl-1.000005/lib/Error/TypeTiny/WrongNumberOfParameters.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Error/TypeTiny/WrongNumberOfParameters.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Error::TypeTiny::WrongNumberOfParameters::AUTHORITY = 'cpan:TOBYINK'; - $Error::TypeTiny::WrongNumberOfParameters::VERSION = '1.000005'; + $Error::TypeTiny::WrongNumberOfParameters::VERSION = '1.004004'; } require Error::TypeTiny; @@ -124,7 +124,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Error/TypeTiny.pm libtype-tiny-perl-1.004004/lib/Error/TypeTiny.pm --- libtype-tiny-perl-1.000005/lib/Error/TypeTiny.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Error/TypeTiny.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Error::TypeTiny::AUTHORITY = 'cpan:TOBYINK'; - $Error::TypeTiny::VERSION = '1.000005'; + $Error::TypeTiny::VERSION = '1.004004'; } use overload @@ -17,23 +17,44 @@ our %CarpInternal; $CarpInternal{$_}++ for qw( - Eval::TypeTiny - Eval::TypeTiny::Sandbox + Types::Standard::_Stringable Exporter::Tiny + Eval::TypeTiny::Sandbox + + Devel::TypeTiny::Perl56Compat + Devel::TypeTiny::Perl58Compat + Error::TypeTiny + Error::TypeTiny::Assertion + Error::TypeTiny::Compilation + Error::TypeTiny::WrongNumberOfParameters + Eval::TypeTiny + Reply::Plugin::TypeTiny Test::TypeTiny Type::Coercion + Type::Coercion::FromMoose Type::Coercion::Union - Error::TypeTiny Type::Library Type::Params + Type::Parser Type::Registry + Types::Common::Numeric + Types::Common::String Types::Standard - Types::Standard::_Stringable + Types::Standard::ArrayRef + Types::Standard::CycleTuple + Types::Standard::Dict + Types::Standard::HashRef + Types::Standard::Map + Types::Standard::ScalarRef + Types::Standard::StrMatch + Types::Standard::Tied + Types::Standard::Tuple Types::TypeTiny Type::Tiny Type::Tiny::Class Type::Tiny::Duck Type::Tiny::Enum + Type::Tiny::_HalfOp Type::Tiny::Intersection Type::Tiny::Role Type::Tiny::Union @@ -52,14 +73,21 @@ my $class = shift; my ($level, @caller, %ctxt) = 0; - while ( - defined scalar caller($level) and $CarpInternal{scalar caller($level)} - ) { $level++ }; - if ( ((caller($level - 1))[1]||"") =~ /^parameter validation for '(.+?)'$/ ) + while (do { + my $caller = caller $level; + defined $caller and $CarpInternal{$caller}; + }) { $level++ }; + if ( ((caller($level - 1))[1]||"") =~ /^(?:parameter validation for|exportable function) '(.+?)'$/ ) { my ($pkg, $func) = ($1 =~ m{^(.+)::(\w+)$}); $level++ if caller($level) eq ($pkg||""); } + # Moo's Method::Generate::Constructor puts an eval in the stack trace, + # that is useless for debugging, so show the stack frame one above. + $level++ if ( + (caller($level))[1] =~ /^\(eval \d+\)$/ and + (caller($level))[3] eq '(eval)' # (caller())[3] is $subroutine + ); @ctxt{qw/ package file line /} = caller($level); my $stack = undef; @@ -262,7 +290,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Eval/TypeTiny.pm libtype-tiny-perl-1.004004/lib/Eval/TypeTiny.pm --- libtype-tiny-perl-1.000005/lib/Eval/TypeTiny.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Eval/TypeTiny.pm 2019-01-08 18:26:35.000000000 +0000 @@ -2,11 +2,22 @@ use strict; +sub _clean_eval { + local $@; + local $SIG{__DIE__}; + my $r = eval $_[0]; + my $e = $@; + return ($r, $e); +} + +use warnings; + BEGIN { *HAS_LEXICAL_SUBS = ($] >= 5.018) ? sub(){!!1} : sub(){!!0}; }; { + # this is unused now and will be removed in a future version of Eval::TypeTiny my $hlv; sub HAS_LEXICAL_VARS () { $hlv = !! eval { @@ -17,38 +28,55 @@ } } -sub _clean_eval -{ - local $@; - local $SIG{__DIE__}; - my $r = eval $_[0]; - my $e = $@; - return ($r, $e); +BEGIN { + sub IMPLEMENTATION_DEVEL_LEXALIAS () { 'Devel::LexAlias' } + sub IMPLEMENTATION_PADWALKER () { 'PadWalker' } + sub IMPLEMENTATION_TIE () { 'tie' } + sub IMPLEMENTATION_NATIVE () { 'perl' } + + my $implementation; + sub ALIAS_IMPLEMENTATION () { + $implementation ||= do { + do { $] ge '5.022' } ? IMPLEMENTATION_NATIVE : + eval { require Devel::LexAlias } ? IMPLEMENTATION_DEVEL_LEXALIAS : + eval { require PadWalker } ? IMPLEMENTATION_PADWALKER : IMPLEMENTATION_TIE + }; + } + + sub _force_implementation { + $implementation = shift; + } } +BEGIN { + *_EXTENDED_TESTING = ($ENV{EXTENDED_TESTING}) ? sub(){!!1} : sub(){!!0}; +}; + our $AUTHORITY = 'cpan:TOBYINK'; -our $VERSION = '1.000005'; +our $VERSION = '1.004004'; our @EXPORT = qw( eval_closure ); -our @EXPORT_OK = qw( HAS_LEXICAL_SUBS HAS_LEXICAL_VARS ); - -sub import -{ - # do the shuffle! - no warnings "redefine"; - our @ISA = qw( Exporter::Tiny ); - require Exporter::Tiny; - my $next = \&Exporter::Tiny::import; - *import = $next; - my $class = shift; - my $opts = { ref($_[0]) ? %{+shift} : () }; - $opts->{into} ||= scalar(caller); - return $class->$next($opts, @_); +our @EXPORT_OK = qw( + HAS_LEXICAL_SUBS HAS_LEXICAL_VARS ALIAS_IMPLEMENTATION + IMPLEMENTATION_DEVEL_LEXALIAS IMPLEMENTATION_PADWALKER + IMPLEMENTATION_NATIVE IMPLEMENTATION_TIE +); + +# See Types::TypeTiny for an explanation of this import method. +# +sub import { + # uncoverable subroutine + no warnings "redefine"; # uncoverable statement + our @ISA = qw( Exporter::Tiny ); # uncoverable statement + require Exporter::Tiny; # uncoverable statement + my $next = \&Exporter::Tiny::import; # uncoverable statement + *import = $next; # uncoverable statement + my $class = shift; # uncoverable statement + my $opts = { ref($_[0]) ? %{+shift} : () }; # uncoverable statement + $opts->{into} ||= scalar(caller); # uncoverable statement + return $class->$next($opts, @_); # uncoverable statement } -use warnings; - -sub eval_closure -{ +sub eval_closure { my (%args) = @_; my $src = ref $args{source} eq "ARRAY" ? join("\n", @{$args{source}}) : $args{source}; @@ -57,16 +85,19 @@ $args{description} =~ s/[^\w .:-\[\]\(\)\{\}\']//g if defined $args{description}; $src = qq{#line $args{line} "$args{description}"\n$src} if defined $args{description} && !($^P & 0x10); $args{environment} ||= {}; - -# for my $k (sort keys %{$args{environment}}) -# { -# next if $k =~ /^\$/ && ref($args{environment}{$k}) =~ /^(SCALAR|REF)$/; -# next if $k =~ /^\@/ && ref($args{environment}{$k}) eq q(ARRAY); -# next if $k =~ /^\%/ && ref($args{environment}{$k}) eq q(HASH); -# -# require Error::TypeTiny; -# Error::TypeTiny::croak("Expected a variable name and ref; got %s => %s", $k, $args{environment}{$k}); -# } + + if (_EXTENDED_TESTING) { + require Scalar::Util; + for my $k (sort keys %{$args{environment}}) { + next if $k =~ /^\$/ && Scalar::Util::reftype($args{environment}{$k}) =~ /^(SCALAR|REF)$/; + next if $k =~ /^\@/ && Scalar::Util::reftype($args{environment}{$k}) eq q(ARRAY); + next if $k =~ /^\%/ && Scalar::Util::reftype($args{environment}{$k}) eq q(HASH); + next if $k =~ /^\&/ && Scalar::Util::reftype($args{environment}{$k}) eq q(CODE); + + require Error::TypeTiny; + Error::TypeTiny::croak("Expected a variable name and ref; got %s => %s", $k, $args{environment}{$k}); + } + } my $sandpkg = 'Eval::TypeTiny::Sandbox'; my $alias = exists($args{alias}) ? $args{alias} : 0; @@ -80,11 +111,12 @@ "}", ); - _manufacture_ties() if $alias && !HAS_LEXICAL_VARS; + if ($alias and ALIAS_IMPLEMENTATION eq IMPLEMENTATION_TIE) { + _manufacture_ties(); + } my ($compiler, $e) = _clean_eval($source); - if ($e) - { + if ($e) { chomp $e; require Error::TypeTiny::Compilation; "Error::TypeTiny::Compilation"->throw( @@ -97,16 +129,22 @@ my $code = $compiler->(@{$args{environment}}{@keys}); undef($compiler); - if ($alias && HAS_LEXICAL_VARS) { - Devel::LexAlias::lexalias($code, $_, $args{environment}{$_}) for grep !/^\&/, @keys; + if ($alias and ALIAS_IMPLEMENTATION eq IMPLEMENTATION_DEVEL_LEXALIAS) { + require Devel::LexAlias; + Devel::LexAlias::lexalias($code, $_ => $args{environment}{$_}) for grep !/^\&/, @keys; } - + + if ($alias and ALIAS_IMPLEMENTATION eq IMPLEMENTATION_PADWALKER) { + require PadWalker; + my %env = map +($_ => $args{environment}{$_}), grep !/^\&/, @keys; + PadWalker::set_closed_over($code, \%env); + } + return $code; } my $tmp; -sub _make_lexical_assignment -{ +sub _make_lexical_assignment { my ($key, $index, $alias) = @_; my $name = substr($key, 1); @@ -124,7 +162,16 @@ my $sigil = substr($key, 0, 1); return "my $key = $sigil\{ \$_[$index] };"; } - elsif (HAS_LEXICAL_VARS) { + elsif (ALIAS_IMPLEMENTATION eq IMPLEMENTATION_NATIVE) { + return + "no warnings 'experimental::refaliasing';". + "use feature 'refaliasing';". + "my $key; \\$key = \$_[$index];" + } + elsif (ALIAS_IMPLEMENTATION eq IMPLEMENTATION_DEVEL_LEXALIAS) { + return "my $key;"; + } + elsif (ALIAS_IMPLEMENTATION eq IMPLEMENTATION_PADWALKER) { return "my $key;"; } else { @@ -160,7 +207,7 @@ my ($method) = (our $AUTOLOAD =~ /(\w+)$/); defined tied(@$self) and return tied(@$self)->$method(@_); require Carp; - Carp::croak(qq[Can't call method "$method" on an undefined value]); + Carp::croak(qq[Can't call method "$method" on an undefined value]) unless $method eq 'DESTROY'; } sub can { my $self = shift; @@ -189,7 +236,7 @@ my ($method) = (our $AUTOLOAD =~ /(\w+)$/); defined tied(%$self) and return tied(%$self)->$method(@_); require Carp; - Carp::croak(qq[Can't call method "$method" on an undefined value]); + Carp::croak(qq[Can't call method "$method" on an undefined value]) unless $method eq 'DESTROY'; } sub can { my $self = shift; @@ -218,7 +265,7 @@ my ($method) = (our $AUTOLOAD =~ /(\w+)$/); defined tied($$self) and return tied($$self)->$method(@_); require Carp; - Carp::croak(qq[Can't call method "$method" on an undefined value]); + Carp::croak(qq[Can't call method "$method" on an undefined value]) unless $method eq 'DESTROY'; } sub can { my $self = shift; @@ -284,13 +331,35 @@ Boolean indicating whether Eval::TypeTiny has support for lexical subs. (This feature requires Perl 5.18.) -=item C<< HAS_LEXICAL_VARS >> +=item C<< ALIAS_IMPLEMENTATION >> + +Returns a string indicating what implementation of C<< alias => 1 >> is +being used. Eval::TypeTiny will automatically choose the best implementation. +This constant can be matched against the C<< IMPLEMENTAION_* >> constants. + +=item C<< IMPLEMENTATION_NATIVE >> + +If C<< ALIAS_IMPLEMENTATION eq IMPLEMENTATION_NATIVE >> then Eval::TypeTiny is +currently using Perl 5.22's native alias feature. This requires Perl 5.22. + +=item C<< IMPLEMENTATION_DEVEL_LEXALIAS >> + +If C<< ALIAS_IMPLEMENTATION eq IMPLEMENTATION_DEVEL_LEXALIAS >> then +Eval::TypeTiny is currently using L to provide aliases. + +=item C<< IMPLEMENTATION_PADWALKER >> + +If C<< ALIAS_IMPLEMENTATION eq IMPLEMENTATION_PADWALKER >> then +Eval::TypeTiny is currently using L to provide aliases. + +=item C<< IMPLEMENTATION_TIE >> -Don't worry; closing over lexical variables in the closures is always -supported! However, if this constant is true, it means that -L is available, which makes them slightly faster than -the fallback solution which uses tied variables. (This only makes any -difference when the C<< alias => 1 >> option is used.) +If C<< ALIAS_IMPLEMENTATION eq IMPLEMENTATION_TIE >> then Eval::TypeTiny is +using the fallback implementation of aliases using C. This is the +slowest implementation, and may cause problems in certain edge cases, like +trying to alias already-tied variables, but it's the only way to implement +C<< alias => 1 >> without a recent version of Perl or one of the two optional +modules mentioned above. =back @@ -337,7 +406,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Reply/Plugin/TypeTiny.pm libtype-tiny-perl-1.004004/lib/Reply/Plugin/TypeTiny.pm --- libtype-tiny-perl-1.000005/lib/Reply/Plugin/TypeTiny.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Reply/Plugin/TypeTiny.pm 2019-01-08 18:26:35.000000000 +0000 @@ -5,7 +5,7 @@ BEGIN { $Reply::Plugin::TypeTiny::AUTHORITY = 'cpan:TOBYINK'; - $Reply::Plugin::TypeTiny::VERSION = '1.000005'; + $Reply::Plugin::TypeTiny::VERSION = '1.004004'; }; require Reply::Plugin; @@ -97,7 +97,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Test/TypeTiny.pm libtype-tiny-perl-1.004004/lib/Test/TypeTiny.pm --- libtype-tiny-perl-1.000005/lib/Test/TypeTiny.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Test/TypeTiny.pm 2019-01-08 18:26:35.000000000 +0000 @@ -15,7 +15,7 @@ }; our $AUTHORITY = 'cpan:TOBYINK'; -our $VERSION = '1.000005'; +our $VERSION = '1.004004'; our @EXPORT = qw( should_pass should_fail ok_subtype ); our @EXPORT_OK = qw( EXTENDED_TESTING matchfor ); @@ -230,7 +230,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Coercion/FromMoose.pm libtype-tiny-perl-1.004004/lib/Type/Coercion/FromMoose.pm --- libtype-tiny-perl-1.000005/lib/Type/Coercion/FromMoose.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Coercion/FromMoose.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Coercion::FromMoose::AUTHORITY = 'cpan:TOBYINK'; - $Type::Coercion::FromMoose::VERSION = '1.000005'; + $Type::Coercion::FromMoose::VERSION = '1.004004'; } use Scalar::Util qw< blessed >; @@ -112,7 +112,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Coercion/Union.pm libtype-tiny-perl-1.004004/lib/Type/Coercion/Union.pm --- libtype-tiny-perl-1.000005/lib/Type/Coercion/Union.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Coercion/Union.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Coercion::Union::AUTHORITY = 'cpan:TOBYINK'; - $Type::Coercion::Union::VERSION = '1.000005'; + $Type::Coercion::Union::VERSION = '1.004004'; } use Scalar::Util qw< blessed >; @@ -31,7 +31,7 @@ { return Type::Tiny::Union->new(type_constraints => $union); } - return; + return; # uncoverable statement } sub type_coercion_map @@ -126,7 +126,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Coercion.pm libtype-tiny-perl-1.004004/lib/Type/Coercion.pm --- libtype-tiny-perl-1.000005/lib/Type/Coercion.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Coercion.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Coercion::AUTHORITY = 'cpan:TOBYINK'; - $Type::Coercion::VERSION = '1.000005'; + $Type::Coercion::VERSION = '1.004004'; } use Eval::TypeTiny qw<>; @@ -104,7 +104,7 @@ { return Type::Tiny->new(constraint => $check); } - return; + return; # uncoverable statement } sub add @@ -229,15 +229,21 @@ while (@args) { - my $type = Types::TypeTiny::to_TypeTiny(shift @args); - my $coercion = shift @args; - - _croak "Types must be blessed Type::Tiny objects" - unless Types::TypeTiny::TypeTiny->check($type); - _croak "Coercions must be code references or strings" - unless Types::TypeTiny::StringLike->check($coercion) || Types::TypeTiny::CodeLike->check($coercion); + my $type = Types::TypeTiny::to_TypeTiny(shift @args); - push @{$self->type_coercion_map}, $type, $coercion; + if (blessed $type and my $method = $type->can('type_coercion_map')) + { + push @{$self->type_coercion_map}, @{$method->($type)}; + } + else + { + my $coercion = shift @args; + _croak "Types must be blessed Type::Tiny objects" + unless Types::TypeTiny::TypeTiny->check($type); + _croak "Coercions must be code references or strings" + unless Types::TypeTiny::StringLike->check($coercion) || Types::TypeTiny::CodeLike->check($coercion); + push @{$self->type_coercion_map}, $type, $coercion; + } } $self->_clear_compiled_coercion; @@ -926,7 +932,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Library.pm libtype-tiny-perl-1.004004/lib/Type/Library.pm --- libtype-tiny-perl-1.000005/lib/Type/Library.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Library.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Library::AUTHORITY = 'cpan:TOBYINK'; - $Type::Library::VERSION = '1.000005'; + $Type::Library::VERSION = '1.004004'; } use Eval::TypeTiny qw< eval_closure >; @@ -22,14 +22,17 @@ sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } { - my $got_subname; + my $subname; my %already; # prevent renaming established functions sub _subname ($$) { - ($got_subname or eval "require Sub::Name") - and ($got_subname = 1) - and !$already{refaddr($_[1])}++ - and return(Sub::Name::subname(@_)); + $subname = + eval { require Sub::Util } ? \&Sub::Util::set_subname : + eval { require Sub::Name } ? \&Sub::Name::subname : + 0 + if not defined $subname; + !$already{refaddr($_[1])}++ and return($subname->(@_)) + if $subname; return $_[1]; } } @@ -105,7 +108,7 @@ $type->qualified_name, eval_closure( source => $source, - description => sprintf("exportable function '%s'", $type), + description => sprintf("exportable function '%s::%s'", $class, $type), environment => {'$type' => \$type}, ), ); @@ -161,8 +164,15 @@ my ($name, $value, $globals, $sym) = @_; my $package = $globals->{into}; + my $type = $class->get_type($name); - if (!ref $package and my $type = $class->get_type($name)) + Exporter::Tiny::_carp( + "Exporting deprecated type %s to %s", + $type->qualified_name, + ref($package) ? "reference" : "package $package", + ) if (defined $type and $type->deprecated and not $globals->{allow_deprecated}); + + if (!ref $package and defined $type) { my ($prefix) = grep defined, $value->{-prefix}, $globals->{prefix}, q(); my ($suffix) = grep defined, $value->{-suffix}, $globals->{suffix}, q(); @@ -533,6 +543,11 @@ # use Types::Mine qw( :types ); + # Exports "coerce_String" and "coerce_Number", as well as any other + # coercions + # + use Types::Mine qw( :coercions ); + # Exports a sub "is_String" so that "is_String($foo)" is equivalent # to "String->check($foo)". # @@ -591,7 +606,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Params.pm libtype-tiny-perl-1.004004/lib/Type/Params.pm --- libtype-tiny-perl-1.000005/lib/Type/Params.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Params.pm 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ BEGIN { $Type::Params::AUTHORITY = 'cpan:TOBYINK'; - $Type::Params::VERSION = '1.000005'; + $Type::Params::VERSION = '1.004004'; } use B qw(); @@ -19,23 +19,40 @@ use Error::TypeTiny; use Error::TypeTiny::Assertion; use Error::TypeTiny::WrongNumberOfParameters; -use Type::Tiny::Union; use Types::Standard -types; -use Types::TypeTiny qw(CodeLike ArrayLike to_TypeTiny); +use Types::TypeTiny qw(CodeLike TypeTiny ArrayLike to_TypeTiny); require Exporter::Tiny; our @ISA = 'Exporter::Tiny'; -our @EXPORT = qw( compile ); -our @EXPORT_OK = qw( multisig validate Invocant ); +our @EXPORT = qw( compile compile_named ); +our @EXPORT_OK = qw( multisig validate validate_named compile_named_oo Invocant ); -BEGIN { - my $Invocant = 'Type::Tiny::Union'->new( - name => 'Invocant', - type_constraints => [Object, ClassName], - ); - sub Invocant () { $Invocant }; -}; +sub english_list { + require Type::Utils; + goto \&Type::Utils::english_list; +} + +my $QUOTE = ($^V < 5.010 && exists(&B::cstring)) + ? \&B::cstring + : \&B::perlstring; # is buggy on Perl 5.8 + +{ + my $Invocant; + sub Invocant () { + $Invocant ||= do { + require Type::Tiny::Union; + require Types::Standard; + 'Type::Tiny::Union'->new( + name => 'Invocant', + type_constraints => [ + Types::Standard::Object(), + Types::Standard::ClassName(), + ], + ); + }; + } +} sub _mkslurpy { @@ -52,24 +69,73 @@ '%s = (($#_-%d)%%2)==0 ? "Error::TypeTiny::WrongNumberOfParameters"->throw(message => sprintf("Odd number of elements in %%s", %s)) : +{ @_[%d..$#_] };', $name, $i, - B::perlstring("$tc"), + $QUOTE->("$tc"), $i, ); } +sub _mkdefault +{ + my $param_options = shift; + my $default; + + if (exists $param_options->{default}) { + $default = $param_options->{default}; + if (ArrayRef->check($default) and not @$default) { + $default = '[]'; + } + elsif (HashRef->check($default) and not %$default) { + $default = '{}'; + } + elsif (Str->check($default)) { + $default = $QUOTE->($default); + } + elsif (Undef->check($default)) { + $default = 'undef'; + } + elsif (not CodeLike->check($default)) { + Error::TypeTiny::croak("Default expected to be string, coderef, undef, or reference to an empty hash or array"); + } + } + + $default; +} + sub compile { my (@code, %env); - @code = 'my (@R, %tmp, $tmp);'; - push @code, '#placeholder'; # $code[1] + push @code, '#placeholder', '#placeholder'; # @code[0,1] - my %options = (ref($_[0]) eq "HASH" && !$_[0]{slurpy}) ? %{+shift} : (); + my %options; + while (ref($_[0]) eq "HASH" && !$_[0]{slurpy}) { + %options = (%options, %{+shift}); + } my $arg = -1; my $saw_slurpy = 0; my $min_args = 0; my $max_args = 0; my $saw_opt = 0; + my $return_default_list = !!1; + $code[0] = 'my (%tmp, $tmp);'; + PARAM: for my $param (@_) { + if (HashRef->check($param)) { + $code[0] = 'my (@R, %tmp, $tmp, $dtmp);'; + $return_default_list = !!0; + last PARAM; + } + elsif (not Bool->check($param)) { + if ($param->has_coercion) { + $code[0] = 'my (@R, %tmp, $tmp, $dtmp);'; + $return_default_list = !!0; + last PARAM; + } + } + } + + my @default_indices; + my @default_values; + while (@_) { ++$arg; @@ -79,14 +145,25 @@ my $is_slurpy; my $varname; + my $param_options = {}; + $param_options = shift if HashRef->check($_[0]) && !exists $_[0]{slurpy}; + my $default = _mkdefault($param_options); + + if ($param_options->{optional} or defined $default) { + $is_optional = 1; + } + if (Bool->check($constraint)) { $constraint = $constraint ? Any : Optional[Any]; } - - if (HashRef->check($constraint)) + + if (HashRef->check($constraint) and exists $constraint->{slurpy}) { - $constraint = to_TypeTiny($constraint->{slurpy}); + $constraint = to_TypeTiny( + $constraint->{slurpy} + or Error::TypeTiny::croak("Slurpy parameter malformed") + ); push @code, $constraint->is_a_type_of(Dict) ? _mkslurpy('$_', '%', $constraint => $arg) : $constraint->is_a_type_of(Map) ? _mkslurpy('$_', '%', $constraint => $arg) : @@ -102,23 +179,50 @@ { Error::TypeTiny::croak("Parameter following slurpy parameter") if $saw_slurpy; - $is_optional = grep $_->{uniq} == Optional->{uniq}, $constraint->parents; - $really_optional = $is_optional && $constraint->parent->{uniq} eq Optional->{uniq} && $constraint->type_parameter; + $is_optional += grep $_->{uniq} == Optional->{uniq}, $constraint->parents; + $really_optional = $is_optional && $constraint->parent && $constraint->parent->{uniq} eq Optional->{uniq} && $constraint->type_parameter; - if ($is_optional) + if (ref $default) { + $env{'@default'}[$arg] = $default; + push @code, sprintf( + '$dtmp = ($#_ < %d) ? $default[%d]->() : $_[%d];', + $arg, + $arg, + $arg, + ); + $saw_opt++; + $max_args++; + $varname = '$dtmp'; + } + elsif (defined $default) { + push @code, sprintf( + '$dtmp = ($#_ < %d) ? %s : $_[%d];', + $arg, + $default, + $arg, + ); + $saw_opt++; + $max_args++; + $varname = '$dtmp'; + } + elsif ($is_optional) { - push @code, sprintf 'return @R if $#_ < %d;', $arg; + push @code, sprintf( + 'return %s if $#_ < %d;', + $return_default_list ? '@_' : '@R', + $arg, + ); $saw_opt++; $max_args++; + $varname = sprintf '$_[%d]', $arg; } else { Error::TypeTiny::croak("Non-Optional parameter following Optional parameter") if $saw_opt; $min_args++; $max_args++; + $varname = sprintf '$_[%d]', $arg; } - - $varname = sprintf '$_[%d]', $arg; } if ($constraint->has_coercion and $constraint->coercion->can_be_inlined) @@ -150,7 +254,7 @@ ? $constraint->type_parameter->inline_check($varname) : $constraint->inline_check($varname), $constraint->{uniq}, - B::perlstring($constraint), + $QUOTE->($constraint), $varname, $is_slurpy ? 'q{$SLURPY}' : sprintf('q{$_[%d]}', $arg), ); @@ -164,13 +268,15 @@ '%s or Type::Tiny::_failed_check(%d, %s, %s, varname => %s);', sprintf(sprintf '$check[%d]->(%s)', $arg, $varname), $constraint->{uniq}, - B::perlstring($constraint), + $QUOTE->($constraint), $varname, $is_slurpy ? 'q{$SLURPY}' : sprintf('q{$_[%d]}', $arg), ); } - push @code, sprintf 'push @R, %s;', $varname; + unless ($return_default_list) { + push @code, sprintf 'push @R, %s;', $varname; + } } if ($min_args == $max_args and not $saw_slurpy) @@ -201,7 +307,12 @@ ); } - push @code, '@R;'; + if ($return_default_list) { + push @code, '@_;'; + } + else { + push @code, '@R;'; + } my $source = "sub { no warnings; ".join("\n", @code)." };"; @@ -209,25 +320,334 @@ my $closure = eval_closure( source => $source, - description => sprintf("parameter validation for '%s'", [caller(1+($options{caller_level}||0))]->[3] || '__ANON__'), + description => $options{description}||sprintf("parameter validation for '%s'", $options{subname}||[caller(1+($options{caller_level}||0))]->[3] || '__ANON__'), environment => \%env, ); return { - min_args => $min_args, - max_args => $saw_slurpy ? undef : $max_args, - closure => $closure, + min_args => $min_args, + max_args => $saw_slurpy ? undef : $max_args, + closure => $closure, + source => $source, + environment => \%env, } if $options{want_details}; return $closure; } +sub compile_named +{ + my (@code, %env); + + @code = 'my (%R, %tmp, $tmp);'; + push @code, '#placeholder'; # $code[1] + + my %options; + while (ref($_[0]) eq "HASH" && !$_[0]{slurpy}) { + %options = (%options, %{+shift}); + } + my $arg = -1; + my $had_slurpy; + + push @code, 'my %in = ((@_==1) && ref($_[0]) eq "HASH") ? %{$_[0]} : (@_ % 2) ? "Error::TypeTiny::WrongNumberOfParameters"->throw(message => "Odd number of elements in hash") : @_;'; + + while (@_) { + ++$arg; + my ($name, $constraint) = splice(@_, 0, 2); + + my $is_optional; + my $really_optional; + my $is_slurpy; + my $varname; + my $default; + + Str->check($name) + or Error::TypeTiny::croak("Expected parameter name as string, got $name"); + + my $param_options = {}; + $param_options = shift @_ if HashRef->check($_[0]) && !exists $_[0]{slurpy}; + $default = _mkdefault($param_options); + + if ($param_options->{optional} or defined $default) { + $is_optional = 1; + } + + if (Bool->check($constraint)) + { + $constraint = $constraint ? Any : Optional[Any]; + } + + if (HashRef->check($constraint) and exists $constraint->{slurpy}) + { + $constraint = to_TypeTiny($constraint->{slurpy}); + ++$is_slurpy; + ++$had_slurpy; + } + else + { + $is_optional += grep $_->{uniq} == Optional->{uniq}, $constraint->parents; + $really_optional = $is_optional && $constraint->parent && $constraint->parent->{uniq} eq Optional->{uniq} && $constraint->type_parameter; + + $constraint = $constraint->type_parameter if $really_optional; + } + + if (ref $default) { + $env{'@default'}[$arg] = $default; + push @code, sprintf( + 'exists($in{%s}) or $in{%s} = $default[%d]->();', + $QUOTE->($name), + $QUOTE->($name), + $arg, + ); + } + elsif (defined $default) { + push @code, sprintf( + 'exists($in{%s}) or $in{%s} = %s;', + $QUOTE->($name), + $QUOTE->($name), + $default, + ); + } + elsif (not $is_optional||$is_slurpy) { + push @code, sprintf( + 'exists($in{%s}) or "Error::TypeTiny::WrongNumberOfParameters"->throw(message => sprintf "Missing required parameter: %%s", %s);', + $QUOTE->($name), + $QUOTE->($name), + ); + } + + my $need_to_close_if = 0; + + if ($is_slurpy) { + $varname = '\\%in'; + } + elsif ($is_optional) { + push @code, sprintf('if (exists($in{%s})) {', $QUOTE->($name)); + push @code, sprintf('$tmp = delete($in{%s});', $QUOTE->($name)); + $varname = '$tmp'; + ++$need_to_close_if; + } + else { + push @code, sprintf('$tmp = delete($in{%s});', $QUOTE->($name)); + $varname = '$tmp'; + } + + if ($constraint->has_coercion) { + if ($constraint->coercion->can_be_inlined) { + push @code, sprintf( + '$tmp = %s;', + $constraint->coercion->inline_coercion($varname) + ); + } + else { + $env{'@coerce'}[$arg] = $constraint->coercion->compiled_coercion; + push @code, sprintf( + '$tmp = $coerce[%d]->(%s);', + $arg, + $varname, + ); + } + $varname = '$tmp'; + } + + if ($constraint->can_be_inlined) + { + push @code, sprintf( + '(%s) or Type::Tiny::_failed_check(%d, %s, %s, varname => %s);', + $constraint->inline_check($varname), + $constraint->{uniq}, + $QUOTE->($constraint), + $varname, + $is_slurpy ? 'q{$SLURPY}' : sprintf('q{$_{%s}}', $QUOTE->($name)), + ); + } + else + { + $env{'@check'}[$arg] = $constraint->compiled_check; + push @code, sprintf( + '%s or Type::Tiny::_failed_check(%d, %s, %s, varname => %s);', + sprintf(sprintf '$check[%d]->(%s)', $arg, $varname), + $constraint->{uniq}, + $QUOTE->($constraint), + $varname, + $is_slurpy ? 'q{$SLURPY}' : sprintf('q{$_{%s}}', $QUOTE->($name)), + ); + } + + push @code, sprintf('$R{%s} = %s;', $QUOTE->($name), $varname); + + push @code, '}' if $need_to_close_if; + } + + if (!$had_slurpy) { + push @code, 'keys(%in) and "Error::TypeTiny"->throw(message => sprintf "Unrecognized parameter%s: %s", keys(%in)>1?"s":"", Type::Params::english_list(sort keys %in));' + } + + if ($options{bless}) { + push @code, sprintf('bless \\%%R, %s;', $QUOTE->($options{bless})); + } + elsif (ArrayRef->check($options{class})) { + push @code, sprintf('(%s)->%s(\\%%R);', $QUOTE->($options{class}[0]), $options{class}[1]||'new'); + } + elsif ($options{class}) { + push @code, sprintf('(%s)->%s(\\%%R);', $QUOTE->($options{class}), $options{constructor}||'new'); + } + else { + push @code, '\\%R;'; + } + + my $source = "sub { no warnings; ".join("\n", @code)." };"; + return $source if $options{want_source}; + + my $closure = eval_closure( + source => $source, + description => $options{description}||sprintf("parameter validation for '%s'", $options{subname}||[caller(1+($options{caller_level}||0))]->[3] || '__ANON__'), + environment => \%env, + ); + + return { + min_args => undef, # always going to be 1 or 0 + max_args => undef, # should be possible to figure out if no slurpy param + closure => $closure, + source => $source, + environment => \%env, + } if $options{want_details}; + + return $closure; +} + +my %klasses; +my $kls_id = 0; +my $has_cxsa; +my $want_cxsa; +sub _mkklass +{ + my $klass = sprintf('%s::OO::Klass%d', __PACKAGE__, ++$kls_id); + + if (!defined $has_cxsa or !defined $want_cxsa) { + $has_cxsa = !! eval { + require Class::XSAccessor; + 'Class::XSAccessor'->VERSION('1.17'); # exists_predicates, June 2013 + 1; + }; + + $want_cxsa = + $ENV{PERL_TYPE_PARAMS_XS} ? 'XS' : + exists($ENV{PERL_TYPE_PARAMS_XS}) ? 'PP' : + $has_cxsa ? 'XS' : 'PP'; + + if ($want_cxsa eq 'XS' and not $has_cxsa) { + Error::TypeTiny::croak("Cannot load Class::XSAccessor"); # uncoverable statement + } + } + + if ($want_cxsa eq 'XS') { + eval { + 'Class::XSAccessor'->import( + redefine => 1, + class => $klass, + getters => { map { defined($_->{getter}) ? ($_->{getter} => $_->{slot}) : () } values %{$_[0]} }, + exists_predicates => { map { defined($_->{predicate}) ? ($_->{predicate} => $_->{slot}) : () } values %{$_[0]} }, + ); + 1; + } ? return($klass) : die($@); + } + + for my $attr (values %{$_[0]}) { + defined($attr->{getter}) and eval sprintf( + 'package %s; sub %s { $_[0]{%s} }; 1', + $klass, + $attr->{getter}, + $attr->{slot}, + ) || die($@); + defined($attr->{predicate}) and eval sprintf( + 'package %s; sub %s { exists $_[0]{%s} }; 1', + $klass, + $attr->{predicate}, + $attr->{slot}, + ) || die($@); + } + + $klass; +} + +sub compile_named_oo +{ + my %options; + while (ref($_[0]) eq "HASH" && !$_[0]{slurpy}) { + %options = (%options, %{+shift}); + } + my @rest = @_; + + my %attribs; + while (@_) { + my ($name, $type) = splice(@_, 0, 2); + my $opts = (HashRef->check($_[0]) && !exists $_[0]{slurpy}) ? shift(@_) : {}; + + my $is_optional = 0+!! $opts->{optional}; + $is_optional += grep $_->{uniq} == Optional->{uniq}, $type->parents; + + my $getter = exists($opts->{getter}) + ? $opts->{getter} + : $name; + + Error::TypeTiny::croak("Bad accessor name: $getter") + unless $getter =~ /\A[A-Za-z][A-Za-z0-9_]*\z/; + + my $predicate = exists($opts->{predicate}) + ? ($opts->{predicate} eq '1' ? "has_$getter" : $opts->{predicate} eq '0' ? undef : $opts->{predicate}) + : ($is_optional ? "has_$getter" : undef); + + $attribs{$name} = { + slot => $name, + getter => $getter, + predicate => $predicate, + }; + } + + my $kls = join '//', + map sprintf('%s*%s*%s', $attribs{$_}{slot}, $attribs{$_}{getter}, $attribs{$_}{predicate}||'0'), + sort keys %attribs; + + $klasses{$kls} ||= _mkklass(\%attribs); + + compile_named({ %options, bless => $klasses{$kls} }, @rest); +} + +# Would be faster to inline this into validate and validate_named, but +# that would complicate them. :/ +sub _mk_key { + local $_; + join ':', map { + HashRef->check($_) ? do { my %h = %$_; sprintf('{%s}', _mk_key(map {; $_ => $h{$_} } sort keys %h)) } : + TypeTiny->check($_) ? sprintf('TYPE=%s', $_->{uniq}) : + Ref->check($_) ? sprintf('REF=%s', refaddr($_)) : + Undef->check($_) ? sprintf('UNDEF') : + $QUOTE->($_) + } @_; +} + my %compiled; sub validate { - my $arr = shift; - my $sub = $compiled{ join ":", map($_->{uniq}||"\@$_->{slurpy}", @_) } ||= compile({ caller_level => 1 }, @_); - @_ = @$arr; + my $arg = shift; + my $sub = ($compiled{_mk_key(@_)} ||= compile( + { caller_level => 1, %{ref($_[0])eq'HASH'?shift(@_):+{}} }, + @_, + )); + @_ = @$arg; + goto $sub; +} + +my %compiled_named; +sub validate_named +{ + my $arg = shift; + my $sub = ($compiled_named{_mk_key(@_)} ||= compile_named( + { caller_level => 1, %{ref($_[0])eq'HASH'?shift(@_):+{}} }, + @_, + )); + @_ = @$arg; goto $sub; } @@ -244,12 +664,17 @@ for my $i (0 .. $#multi) { - my $sig = $multi[$i]; + my $flag = sprintf('${^TYPE_PARAMS_MULTISIG} = %d', $i); + my $sig = $multi[$i]; my @cond; push @cond, sprintf('@_ >= %s', $sig->{min_args}) if defined $sig->{min_args}; push @cond, sprintf('@_ <= %s', $sig->{max_args}) if defined $sig->{max_args}; + if (defined $sig->{max_args} and defined $sig->{min_args}) { + @cond = sprintf('@_ == %s', $sig->{min_args}) + if $sig->{max_args} == $sig->{min_args}; + } push @code, sprintf('if (%s){', join(' and ', @cond)) if @cond; - push @code, sprintf('eval { $r = [ $multi[%d]{closure}->(@_) ] };', $i); + push @code, sprintf('eval { $r = [ $multi[%d]{closure}->(@_) ]; %s };', $i, $flag); push @code, 'return(@$r) if $r;'; push @code, '}' if @cond; } @@ -272,7 +697,7 @@ =encoding utf-8 -=for stopwords evals +=for stopwords evals invocant =head1 NAME @@ -334,7 +759,7 @@ sub deposit_monies { $deposit_monies_check ||= compile( Str, Str, slurpy ArrayRef[Num] ); - my ($sort_code, $account_number, $monies) = $check->(@_); + my ($sort_code, $account_number, $monies) = $deposit_monies_check->(@_); ...; } @@ -365,195 +790,294 @@ =item validate +=item compile_named + +=item validate_named + +=item compile_named_oo + =item Invocant =item multisig =end trustme -=head1 COOKBOOK +=head1 VALIDATE VERSUS COMPILE -=head2 Positional Parameters +This module offers one-stage ("validate") and two-stage ("compile" then +"check") variants of parameter checking for you to use. Performance with +the two-stage variant will I beat the one stage variant — I +cannot think of many reasons you'd want to use the one-stage version. - sub nth_root - { - state $check = compile( Num, Num ); - my ($x, $n) = $check->(@_); - - return $x ** (1 / $n); - } + # One-stage, positional parameters + my @args = validate(\@_, @spec); + + # Two-stage, positional parameters + state $check = compile(@spec); + my @args = $check->(@_); + + # One-stage, named parameters + my $args = validate_named(\@_, @spec); + + # Two-stage, named parameters + state $check = compile_named(@spec); + my $args = $check->(@_); -=head2 Method Calls +Use C and C, not C and C. -Type::Params exports an additional keyword C on request. This is -a type constraint accepting blessed objects and also class names. +=head1 VALIDATION SPECIFICATIONS - use Types::Standard qw( ClassName Object Str Int ); - use Type::Params qw( compile Invocant ); - - # a class method - sub new_from_json - { - state $check = compile( ClassName, Str ); - my ($class, $json) = $check->(@_); - - $class->new( from_json($json) ); - } - - # an object method - sub dump - { - state $check = compile( Object, Int ); - my ($self, $limit) = $check->(@_); - - local $Data::Dumper::Maxdepth = $limit; - print Data::Dumper::Dumper($self); - } - - # can be called as either and object or class method - sub run - { - state $check = compile( Invocant ); - my ($proto) = $check->(@_); - - my $self = ref($proto) ? $proto : $default_instance; - $self->_run; - } +The C<< @spec >> is where most of the magic happens. + +The generalized form of specifications for positional parameters is: + + @spec = ( + \%general_opts, + $type_for_arg_1, \%opts_for_arg_1, + $type_for_arg_2, \%opts_for_arg_2, + $type_for_arg_3, \%opts_for_arg_3, + ..., + slurpy($slurpy_type), + ); + +And for named parameters: + + @spec = ( + \%general_opts, + foo => $type_for_foo, \%opts_for_foo, + bar => $type_for_bar, \%opts_for_bar, + baz => $type_for_baz, \%opts_for_baz, + ..., + slurpy($slurpy_type), + ); + +Option hashrefs can simply be omitted if you don't need to specify any +particular options. + +The C function is exported by L. It may be +omitted if not needed. + +=head2 General Options + +Currently supported general options are: + +=over + +=item C<< want_source => Bool >> + +Instead of returning a coderef, return Perl source code string. Handy +for debugging. + +=item C<< want_details => Bool >> + +Instead of returning a coderef, return a hashref of stuff including the +coderef. This is mostly for people extending Type::Params and I won't go +into too many details about what else this hashref contains. + +=item C<< class => ClassName >> + +B<< Named parameters only. >> The check coderef will, instead of returning +a simple hashref, call C<< $class->new($hashref) >> and return a proper +object. + +=item C<< constructor => Str >> + +B<< Named parameters only. >> Specify an alternative method name instead +of C for the C option described above. + +=item C<< class => Tuple[ClassName, Str] >> + +B<< Named parameters only. >> Given a class name and constructor name pair, +the check coderef will, instead of returning a simple hashref, call +C<< $class->$constructor($hashref) >> and return a proper object. Shortcut +for declaring both the C and C options at once. + +=item C<< bless => ClassName >> + +B<< Named parameters only. >> Bypass the constructor entirely and directly +bless the hashref. + +=item C<< description => Str >> + +Description of the coderef that will show up in stack traces. Defaults to +"parameter validation for X" where X is the caller sub name. + +=item C<< subname => Str >> + +If you wish to use the default description, but need to change the sub name, +use this. + +=item C<< caller_level => Int >> + +If you wish to use the default description, but need to change the caller +level for detecting the sub name, use this. + +=back + +=head2 Type Constraints + +The types for each parameter may be any L type constraint, or +anything that Type::Tiny knows how to coerce into a Type::Tiny type +constraint, such as a MooseX::Types type constraint or a coderef. =head2 Optional Parameters - use Types::Standard qw( Object Optional Int ); - - sub dump - { - state $check = compile( Object, Optional[Int] ); - my ($self, $limit) = $check->(@_); - $limit //= 0; - - local $Data::Dumper::Maxdepth = $limit; - print Data::Dumper::Dumper($self); - } - - $obj->dump(1); # ok - $obj->dump(); # ok - $obj->dump(undef); # dies +The C parameterizable type constraint from L +may be used to indicate optional parameters. + + # Positional parameters + state $check = compile(Int, Optional[Int], Optional[Int]); + my ($foo, $bar, $baz) = $check->(@_); # $bar and $baz are optional + + # Named parameters + state $check = compile( + foo => Int, + bar => Optional[Int], + baz => Optional[Int], + ); + my $args = $check->(@_); # $args->{bar} and $args->{baz} are optional + +As a special case, the numbers 0 and 1 may be used as shortcuts for +C<< Optional[Any] >> and C<< Any >>. + + # Positional parameters + state $check = compile(1, 0, 0); + my ($foo, $bar, $baz) = $check->(@_); # $bar and $baz are optional + + # Named parameters + state $check = compile_named(foo => 1, bar => 0, baz => 0); + my $args = $check->(@_); # $args->{bar} and $args->{baz} are optional + +If you're using positional parameters, then required parameters must +precede any optional ones. =head2 Slurpy Parameters - use Types::Standard qw( slurpy ClassName HashRef ); - - sub new - { - state $check = compile( ClassName, slurpy HashRef ); - my ($class, $ref) = $check->(@_); - bless $ref => $class; - } - - __PACKAGE__->new(foo => 1, bar => 2); +Specifications may include a single slurpy parameter which should have +a type constraint derived from C or C. (C is +also allowed, which is interpreted as C in the case of positional +parameters, and C in the case of named parameters.) + +If a slurpy parameter is provided in the specification, the C<< $check >> +coderef will slurp up any remaining arguments from C<< @_ >> (after +required and optional parameters have been removed), validate it against +the given slurpy type, and return it as a single arrayref/hashref. + +For example: + + sub xyz { + state $check = compile(Int, Int, slurpy ArrayRef[Int]); + my ($foo, $bar, $baz) = $check->(@_); + } + + xyz(1..5); # $foo = 1 + # $bar = 2 + # $baz = [ 3, 4, 5 ] -The following types from L can be made slurpy: -C, C, C, C, C. Hash-like types -will die if an odd number of elements are slurped in. +A specification have one or zero slurpy parameters. If there is a slurpy +parameter, it must be the final one. -A check may only have one slurpy parameter, and it must be the last -parameter. +Note that having a slurpy parameter will slightly slow down C<< $check >> +because it means that C<< $check >> can't just check C<< @_ >> and return +it unaltered if it's valid — it needs to build a new array to return. -=head2 Named Parameters +=head2 Type Coercion -Just use a slurpy C: +Type coercions are automatically applied for all types that have +coercions. - use Types::Standard qw( slurpy Dict Ref Optional Int ); - - sub dump - { - state $check = compile( - slurpy Dict[ - var => Ref, - limit => Optional[Int], - ], - ); - my ($arg) = $check->(@_); - - local $Data::Dumper::Maxdepth = $arg->{limit}; - print Data::Dumper::Dumper($arg->{var}); - } - - dump(var => $foo, limit => 1); # ok - dump(var => $foo); # ok - dump(limit => 1); # dies + my $RoundedInt = Int->plus_coercions(Num, q{ int($_) }); + + state $check = compile($RoundedInt, $RoundedInt); + my ($foo, $bar) = $check->(@_); + + # if @_ is (1.1, 2.2), then $foo is 1 and $bar is 2. -=head2 Mixed Positional and Named Parameters +Coercions carry over into structured types such as C automatically: - use Types::Standard qw( slurpy Dict Ref Optional Int ); - - sub my_print - { - state $check = compile( - Str, - slurpy Dict[ - colour => Optional[Str], - size => Optional[Int], - ], - ); - my ($string, $arg) = $check->(@_); - } + sub delete_articles + { + state $check = compile( Object, slurpy ArrayRef[$RoundedInt] ); + my ($db, $articles) = $check->(@_); - my_print("Hello World", colour => "blue"); + $db->select_article($_)->delete for @$articles; + } + + # delete articles 1, 2 and 3 + delete_articles($my_db, 1.1, 2.2, 3.3); -=head2 Coercions +That's a L feature rather than something specific to +Type::Params. -Coercions will automatically be applied for I type constraints that have -a coercion associated. +Note that having any coercions in a specification, even if they're not +used in a particular check, will slightly slow down C<< $check >> +because it means that C<< $check >> can't just check C<< @_ >> and return +it unaltered if it's valid — it needs to build a new array to return. - use Type::Utils; - use Types::Standard qw( Int Num ); - - my $RoundedInt = declare as Int; - coerce $RoundedInt, from Num, q{ int($_) }; - - sub set_age - { - state $check = compile( Object, $RoundedInt ); - my ($self, $age) = $check->(@_); - - $self->{age} = $age; - } - - $obj->set_age(32.5); # ok; coerced to "32". +=head2 Parameter Options -Coercions carry over into structured types such as C automatically: +The type constraint for a parameter may be followed by a hashref of +options for it. - sub delete_articles - { - state $check = compile( Object, slurpy ArrayRef[$RoundedInt] ); - my ($db, $articles) = $check->(@_); - - $db->select_article($_)->delete for @$articles; - } - - # delete articles 1, 2 and 3 - delete_articles($my_db, 1.1, 2.2, 3.3); +The following options are supported: -If type C has coercions from C and C and you want to -B coercion, then use: +=over - state $check = compile( Foo->no_coercions ); +=item C<< optional => Bool >> -Or if you just want to prevent coercion from C, use: +This is an alternative way of indicating that a parameter is optional. - state $check = compile( Foo->minus_coercions(Str) ); + state $check = compile_named( + foo => Int, + bar => Int, { optional => 1 }, + baz => Optional[Int], + ); -Or maybe add an extra coercion: +The two are not I equivalent. If you were to set C to a +non-integer, it would throw an exception about the C type constraint +being violated. If C were a non-integer, the exception would mention +the C<< Optional[Int] >> type constraint instead. - state $check = compile( - Foo->plus_coercions(Int, q{ Foo->new_from_number($_) }), - ); +=item C<< default => CodeRef|Ref|Str|Undef >> + +A default may be provided for a parameter. + + state $check = compile_named( + foo => Int, + bar => Int, { default => "666" }, + baz => Int, { default => "999" }, + ); + +Supported defaults are any strings (including numerical ones), C, +and empty hashrefs and arrayrefs. Non-empty hashrefs and arrayrefs are +I<< not allowed as defaults >>. + +Alternatively, you may provide a coderef to generate a default value: + + state $check = compile_named( + foo => Int, + bar => Int, { default => sub { 6 * 111 } }, + baz => Int, { default => sub { 9 * 111 } }, + ); -Note that the coercion is specified as a string of Perl code. This is usually -the fastest way to do it, but a coderef is also accepted. Either way, the -value to be coerced is C<< $_ >>. +That coderef may generate any value, including non-empty arrayrefs and +non-empty hashrefs. For undef, simple strings, numbers, and empty +structures, avoiding using a coderef will make your parameter processing +faster. -=head2 Alternatives +The default I be validated against the type constraint, and +potentially coerced. + +Defaults are not supported for slurpy parameters. + +Note that having any defaults in a specification, even if they're not +used in a particular check, will slightly slow down C<< $check >> +because it means that C<< $check >> can't just check C<< @_ >> and return +it unaltered if it's valid — it needs to build a new array to return. + +=back + +=head1 MULTIPLE SIGNATURES Type::Params can export a C function that compiles multiple alternative signatures into one, and uses the first one that works: @@ -564,16 +1088,16 @@ [ CodeRef ], ); - my ($int, $arrayref) = $check->( 1, [] ); - my ($hashref, $num) = $check->( {}, 1.1 ); - my ($code) = $check->( sub { 1 } ); + my ($int, $arrayref) = $check->( 1, [] ); # okay + my ($hashref, $num) = $check->( {}, 1.1 ); # okay + my ($code) = $check->( sub { 1 } ); # okay $check->( sub { 1 }, 1.1 ); # throws an exception Coercions, slurpy parameters, etc still work. -There's currently no indication of which of the multiple signatures -succeeded. +The magic global C<< ${^TYPE_PARAMS_MULTISIG} >> is set to the index of +the first signature which succeeded. The present implementation involves compiling each signature independently, and trying them each (in their given order!) in an C block. The only @@ -588,6 +1112,7 @@ sub { ... }, [ HashRef, Num ], [ CodeRef ], + compile_named( needle => Value, haystack => Ref ), ); The coderef is expected to die if that alternative should be abandoned (and @@ -605,19 +1130,260 @@ return ($meth, $obj); }, ); + my ($needle, $haystack) = $check->(@_); - is_HashRef($haystack) ? $haystack->{$needle} : - is_ArrayRef($haystack) ? $haystack->[$needle] : - is_Object($haystack) ? $haystack->$needle : - die; + for (${^TYPE_PARAMS_MULTISIG) { + return $haystack->[$needle] if $_ == 0; + return $haystack->{$needle} if $_ == 1; + return $haystack->$needle if $_ == 2; + } } get_from(0, \@array); # returns $array[0] get_from('foo', \%hash); # returns $hash{foo} get_from('foo', $obj); # returns $obj->foo -=head1 COMPARISON WITH PARAMS::VALIDATE +=head1 PARAMETER OBJECTS + +Here's a quick example function: + + sub add_contact_to_database { + state $check = compile_named( + dbh => Object, + id => Int, + name => Str, + ); + my $arg = $check->(@_); + + my $sth = $arg->{db}->prepare('INSERT INTO contacts VALUES (?, ?)'); + $sth->execute($arg->{id}, $arg->{name}); + } + +Looks simple, right? Did you spot that it will always die with an error +message I<< Can't call method "prepare" on an undefined value >>? + +This is because we defined a parameter called 'dbh' but later tried to +refer to it as C<< $arg{db} >>. Here, Perl gives us a pretty clear +error, but sometimes the failures will be far more subtle. Wouldn't it +be nice if instead we could do this? + + sub add_contact_to_database { + state $check = compile_named_oo( + dbh => Object, + id => Int, + name => Str, + ); + my $arg = $check->(@_); + + my $sth = $arg->dbh->prepare('INSERT INTO contacts VALUES (?, ?)'); + $sth->execute($arg->id, $arg->name); + } + +If we tried to call C<< $arg->db >>, it would fail because there was +no such method. + +Well, that's exactly what C does. + +As well as giving you nice protection against mistyped parameter names, +It also looks kinda pretty, I think. Hash lookups are a little faster +than method calls, of course (though Type::Params creates the methods +using L if it's installed, so they're still pretty +fast). + +An optional parameter C will also get a nifty C<< $arg->has_foo >> +predicate method. Yay! + +=head2 Options + +C gives you some extra options for parameters. + + sub add_contact_to_database { + state $check = compile_named_oo( + dbh => Object, + id => Int, { default => '0', getter => 'identifier' }, + name => Str, { optional => 1, predicate => 'has_name' }, + ); + my $arg = $check->(@_); + + my $sth = $arg->dbh->prepare('INSERT INTO contacts VALUES (?, ?)'); + $sth->execute($arg->identifier, $arg->name) if $arg->has_name; + } + +The C option lets you choose the method name for getting the +argument value. The C option lets you choose the method name +for checking the existence of an argument. + +By setting an explicit predicate method name, you can force a predicate +method to be generated for non-optional arguments. + +=head2 Classes + +The objects returned by C are blessed into lightweight +classes which have been generated on the fly. Don't expect the names of +the classes to be stable or predictable. It's probably a bad idea to be +checking C, C, or C on any of these objects. If you're +doing that, you've missed the point of them. + +They don't have any constructor (C method). The C<< $check >> +coderef effectively I the constructor. + +=head1 COOKBOOK + +=head2 Mixed Positional and Named Parameters + +This can be faked using positional parameters and a slurpy dictionary. + + state $check = compile( + Int, + slurpy Dict[ + foo => Int, + bar => Optional[Int], + baz => Optional[Int], + ], + ); + + @_ = (42, foo => 21); # ok + @_ = (42, foo => 21, bar => 84); # ok + @_ = (42, foo => 21, bar => 10.5); # not ok + @_ = (42, foo => 21, quux => 84); # not ok + +=head2 Method Calls + +Some people like to C off the invocant before running type checks: + + sub my_method { + my $self = shift; + state $check = compile_named( + haystack => ArrayRef, + needle => Int, + ); + my $arg = $check->(@_); + + return $arg->{haystack}[ $self->base_index + $arg->{needle} ]; + } + + $object->my_method(haystack => \@somelist, needle => 42); + +If you're using positional parameters, there's really no harm in including +the invocant in the check: + + sub my_method { + state $check = compile(Object, ArrayRef, Int); + my ($self, $arr, $ix) = $check->(@_); + + return $arr->[ $self->base_index + $ix ]; + } + + $object->my_method(\@somelist, 42); + +Some methods will be designed to be called as class methods rather than +instance methods. Remember to use C instead of C in +those cases. + +Type::Params exports an additional keyword C on request. This +gives you a type constraint which accepts classnames I blessed +objects. + + use Type::Params qw( compile Invocant ); + + sub my_method { + state $check = compile(Invocant, ArrayRef, Int); + my ($self_or_class, $arr, $ix) = $check->(@_); + + return $arr->[ $ix ]; + } + +=head2 There is no C<< coerce => 0 >> + +If you give C a type constraint which has coercions, then +C<< $check >> will I<< always coerce >>. It cannot be switched off. + +Luckily, Type::Tiny gives you a very easy way to create a type +constraint without coercions from one that has coercions: + + state $check = compile( + $RoundedInt->no_coercions, + $RoundedInt->minus_coercions(Num), + ); + +That's a Type::Tiny feature rather than a Type::Params feature though. + +=head2 Extra Coercions + +Type::Tiny provides an easy shortcut for adding coercions to +a type constraint: + + # We want an arrayref, but accept a hashref and coerce it + state $check => compile( + ArrayRef->plus_coercions( HashRef, sub { [sort values %$_] } ), + ); + +=head2 Value Constraints + +You may further constrain a parameter using C: + + state $check = compile( + Int->where('$_ % 2 == 0'), # even numbers only + ); + +This is also a Type::Tiny feature rather than a Type::Params feature. + +=head2 Smarter Defaults + +This works: + + sub print_coloured { + state $check = compile( + Str, + Str, { default => "black" }, + ); + + my ($text, $colour) = $check->(@_); + + ...; + } + +But so does this (and it might benchmark a little faster): + + sub print_coloured { + state $check = compile( + Str, + Str, { optional => 1 }, + ); + + my ($text, $colour) = $check->(@_); + $colour = "black" if @_ < 2; + + ...; + } + +Just because Type::Params now supports defaults, doesn't mean you can't +do it the old-fashioned way. The latter is more flexible. In the example, +we've used C<< if @_ < 2 >>, but we could instead have done something like: + + $colour ||= "black"; + +Which would have defaulted C<< $colour >> to "black" if it were the empty +string. + +=head1 ENVIRONMENT + +=over + +=item C + +Affects the building of accessors for C. If set to true, +will use L. If set to false, will use pure Perl. If this +environment variable does not exist, will use L if it +is available. + +=back + + +=head1 COMPARISONS WITH OTHER MODULES + +=head2 Params::Validate L is not really a drop-in replacement for L; the API differs far too much to claim that. Yet it performs a similar task, @@ -634,11 +1400,8 @@ =item * -Type::Params is mostly geared towards positional parameters, while -Params::Validate seems to be primarily aimed at named parameters. (Though -either works for either.) Params::Validate doesn't appear to have a -particularly natural way of validating a mix of positional and named -parameters. +Params::Validate doesn't appear to have a particularly natural way of +validating a mix of positional and named parameters. =item * @@ -647,11 +1410,6 @@ =item * -Params::Validate allows you to supply defaults for missing parameters; -Type::Params does not, but you may be able to use coercion from Undef. - -=item * - If you are primarily writing object-oriented code, using Moose or similar, and you are using Type::Tiny type constraints for your attributes, then using Type::Params allows you to use the same constraints for method calls. @@ -671,6 +1429,43 @@ =back +=head2 Params::ValidationCompiler + +L does basically the same thing as +L. + +=over + +=item * + +Params::ValidationCompiler and Type::Params are likely to perform fairly +similarly. In most cases, recent versions of Type::Params seem to be +I faster, but except in very trivial cases, you're unlikely to +notice the speed difference. Speed probably shouldn't be a factor when +choosing between them. + +=item * + +Type::Params's syntax is more compact: + + state $check = compile(Object, Optional[Int], slurpy ArrayRef); + +Versus: + + state $check = validation_for( + params => [ + { type => Object }, + { type => Int, optional => 1 }, + { type => ArrayRef, slurpy => 1 }, + ], + ); + +=item * + +L probably has slightly better exceptions. + +=back + =head1 BUGS Please report any bugs to @@ -686,7 +1481,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Parser.pm libtype-tiny-perl-1.004004/lib/Type/Parser.pm --- libtype-tiny-perl-1.000005/lib/Type/Parser.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Parser.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } our $AUTHORITY = 'cpan:TOBYINK'; -our $VERSION = '1.000005'; +our $VERSION = '1.004004'; # Token types # @@ -343,7 +343,6 @@ Type::Parser::TokenStream; use Scalar::Util qw(looks_like_number); - use Text::Balanced qw(extract_quotelike); sub new { @@ -454,9 +453,13 @@ return $punctuation{$spelling}; } - if (my $quotelike = extract_quotelike $self->{remaining}) + if ($self->{remaining} =~ /\A\s*[q'"]/sm) { - return bless([ Type::Parser::QUOTELIKE, $quotelike ], "Type::Parser::Token"),; + require Text::Balanced; + if (my $quotelike = Text::Balanced::extract_quotelike($self->{remaining})) + { + return bless([ Type::Parser::QUOTELIKE, $quotelike ], "Type::Parser::Token"),; + } } if ($self->{remaining} =~ /^([+-]?[\w:.+]+)/sm) @@ -607,7 +610,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Registry.pm libtype-tiny-perl-1.004004/lib/Type/Registry.pm --- libtype-tiny-perl-1.000005/lib/Type/Registry.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Registry.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Registry::AUTHORITY = 'cpan:TOBYINK'; - $Type::Registry::VERSION = '1.000005'; + $Type::Registry::VERSION = '1.004004'; } use Exporter::Tiny qw( mkopt ); @@ -19,21 +19,17 @@ sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } -sub _exporter_expand_sub +sub _generate_t { my $class = shift; - my ($name, $value, $globals, $permitted) = @_; + my ($name, $value, $globals) = @_; - if ($name eq "t") - { - my $caller = $globals->{into}; - my $reg = $class->for_class( - ref($caller) ? sprintf('HASH(0x%08X)', refaddr($caller)) : $caller - ); - return t => sub (;$) { @_ ? $reg->lookup(@_) : $reg }; - } + my $caller = $globals->{into}; + my $reg = $class->for_class( + ref($caller) ? sprintf('HASH(0x%08X)', refaddr($caller)) : $caller + ); - return $class->SUPER::_exporter_expand_sub(@_); + sub (;$) { @_ ? $reg->lookup(@_) : $reg }; } sub new @@ -67,30 +63,33 @@ my $opts = mkopt(\@_); for my $opt (@$opts) { - my ($lib, $types) = @_; + my ($library, $types) = @_; + $library =~ s/^-/Types::/; - $lib =~ s/^-/Types::/; - eval "require $lib"; + { + local $SIG{__DIE__} = sub {}; + eval "require $library"; + }; my %hash; - if ($lib->isa("Type::Library") or $lib eq 'Types::TypeTiny') + if ($library->isa("Type::Library") or $library eq 'Types::TypeTiny') { $types ||= [qw/-types/]; ArrayLike->check($types) - or _croak("Expected arrayref following '%s'; got %s", $lib, $types); + or _croak("Expected arrayref following '%s'; got %s", $library, $types); - $lib->import({into => \%hash}, @$types); + $library->import({into => \%hash}, @$types); $hash{$_} = &{$hash{$_}}() for keys %hash; } - elsif ($lib->isa("MooseX::Types::Base")) + elsif ($library->isa("MooseX::Types::Base")) { $types ||= []; ArrayLike->check($types) && (@$types == 0) - or _croak("Library '%s' is a MooseX::Types type constraint library. No import options currently supported", $lib); + or _croak("Library '%s' is a MooseX::Types type constraint library. No import options currently supported", $library); require Moose::Util::TypeConstraints; - my $moosextypes = $lib->type_storage; + my $moosextypes = $library->type_storage; for my $name (sort keys %$moosextypes) { my $tt = to_TypeTiny( @@ -99,14 +98,14 @@ $hash{$name} = $tt; } } - elsif ($lib->isa("MouseX::Types::Base")) + elsif ($library->isa("MouseX::Types::Base")) { $types ||= []; ArrayLike->check($types) && (@$types == 0) - or _croak("Library '%s' is a MouseX::Types type constraint library. No import options currently supported", $lib); + or _croak("Library '%s' is a MouseX::Types type constraint library. No import options currently supported", $library); require Mouse::Util::TypeConstraints; - my $moosextypes = $lib->type_storage; + my $moosextypes = $library->type_storage; for my $name (sort keys %$moosextypes) { my $tt = to_TypeTiny( @@ -117,7 +116,7 @@ } else { - _croak("%s is not a type library", $lib); + _croak("%s is not a type library", $library); } for my $key (sort keys %hash) @@ -185,7 +184,10 @@ my $library = $1; my $typename = $2; - eval "require $library;"; + { + local $SIG{__DIE__} = sub {}; + eval "require $library;"; + }; if ( $library->isa('MooseX::Types::Base') ) { @@ -496,7 +498,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Class.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/Class.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Class.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Class.pm 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ BEGIN { $Type::Tiny::Class::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::Class::VERSION = '1.000005'; + $Type::Tiny::Class::VERSION = '1.004004'; } use Scalar::Util qw< blessed >; @@ -348,7 +348,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Duck.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/Duck.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Duck.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Duck.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Tiny::Duck::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::Duck::VERSION = '1.000005'; + $Type::Tiny::Duck::VERSION = '1.004004'; } use Scalar::Util qw< blessed >; @@ -192,7 +192,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Enum.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/Enum.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Enum.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Enum.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Tiny::Enum::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::Enum::VERSION = '1.000005'; + $Type::Tiny::Enum::VERSION = '1.004004'; } sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } @@ -212,7 +212,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/_HalfOp.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/_HalfOp.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/_HalfOp.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/_HalfOp.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Tiny::_HalfOp::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::_HalfOp::VERSION = '1.000005'; + $Type::Tiny::_HalfOp::VERSION = '1.004004'; } use overload (); @@ -80,7 +80,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Graham Knop. +This software is copyright (c) 2014, 2017-2019 by Graham Knop. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Intersection.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/Intersection.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Intersection.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Intersection.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Tiny::Intersection::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::Intersection::VERSION = '1.000005'; + $Type::Tiny::Intersection::VERSION = '1.004004'; } use Scalar::Util qw< blessed >; @@ -231,7 +231,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Coercions.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Coercions.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Coercions.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Coercions.pod 2019-01-08 18:26:35.000000000 +0000 @@ -13,8 +13,8 @@ B<< Stop! Don't do it! >> OK, it's fairly common practice in L/L code to define -coercions for type constraints. For example, suppose we have a type -constraint: +coercions for type constraints. For example, suppose we define a type +constraint in a type library: class_type PathTiny, { class => "Path::Tiny" }; @@ -54,12 +54,12 @@ anonymous type constraint, but with additional coercions. In our earlier example, we'd define the C type constraint -as before: +in our type library as before: class_type PathTiny, { class => "Path::Tiny" }; But then not define any coercions for it. Later, when using the -type constraint, we can add coercions: +type constraint in a class, we can add coercions: my $ConfigFileType = PathTiny->plus_coercions( Str, sub { "Path::Tiny"->new($_) }, @@ -181,6 +181,10 @@ =item * +C + +=item * + C =item * @@ -344,7 +348,7 @@ to define any additional coercions, they'll have to create a child type to do it with. -A shortcut exists for this: +A shortcut exists to do this on all types in your library: __PACKAGE__->meta->make_immutable; @@ -373,7 +377,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Libraries.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Libraries.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Libraries.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Libraries.pod 2019-01-08 18:26:35.000000000 +0000 @@ -142,7 +142,7 @@ Use a custom types library just like you would L: - packge MyClass; + package MyClass; use Moose; use DateTime; use Example::Types qw( Datetime ); # import the custom type @@ -304,7 +304,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Optimization.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Optimization.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Optimization.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Optimization.pod 2019-01-08 18:26:35.000000000 +0000 @@ -197,7 +197,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Params.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Params.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Params.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Params.pod 2019-01-08 18:26:35.000000000 +0000 @@ -173,7 +173,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Policies.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Policies.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/Policies.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/Policies.pod 2019-01-08 18:26:35.000000000 +0000 @@ -126,7 +126,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithMoo.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithMoo.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithMoo.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithMoo.pod 2019-01-08 18:26:35.000000000 +0000 @@ -11,26 +11,23 @@ { package Person; - use Moo; + use Moo 1.006000; + use Sub::Quote qw( quote_sub ); use Types::Standard qw( Str Int ); - use Type::Utils qw( declare as where inline_as coerce from ); has name => ( is => "ro", isa => Str, ); - my $PositiveInt = declare - as Int, - where { $_ > 0 }, - inline_as { "$_ =~ /^[0-9]+\$/ and $_ > 0" }; - - coerce $PositiveInt, from Int, q{ abs $_ }; + my $PositiveInt = Int + -> where( quote_sub '$_ > 0' ) + -> plus_coercions( Int, sub { abs $_ } ); has age => ( is => "rwp", isa => $PositiveInt, - coerce => $PositiveInt->coercion, + coerce => 1, ); sub get_older { @@ -49,9 +46,19 @@ C<< &{} >> as C constraints, so Type::Tiny objects can directly be used in C. -Moo doesn't support C<< coerce => 1 >> but requires a coderef as a coercion. -However, again it supports using objects that overload C<< &{} >>, which -Type::Coercion does, allowing C<< coerce => $Type->coercion >> to work. +Moo prior to 1.006000 doesn't support C<< coerce => 1 >>, instead +requiring a coderef to use as a coercion. However, Type::Tiny can +provide you with a suitable coderef to use (actually an object that +overloads C<< &{} >>). Just use: + + has age => ( + is => "rwp", + isa => $PositiveInt, + coerce => $PositiveInt->coercion, + ); + +If you can upgrade to the latest Moo, and use C<< coerce => 1 >> you'll +have a lot more fun though. :-) Type::Tiny hooks into Moo's HandleMoose interface to ensure that type constraints get inflated to Moose type constraints if and when Moo inflates @@ -86,7 +93,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithMoose.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithMoose.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithMoose.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithMoose.pod 2019-01-08 18:26:35.000000000 +0000 @@ -13,19 +13,15 @@ use Moose; use Types::Standard qw( Str Int ); - use Type::Utils qw( declare as where inline_as coerce from ); has name => ( is => "ro", isa => Str, ); - my $PositiveInt = declare - as Int, - where { $_ > 0 }, - inline_as { "$_ =~ /^[0-9]+\$/ and $_ > 0" }; - - coerce $PositiveInt, from Int, q{ abs $_ }; + my $PositiveInt = Int + -> where( sub { $_ > 0 } ) + -> plus_coercions( Int, sub { abs $_ } ); has age => ( is => "ro", @@ -44,6 +40,8 @@ =head1 DESCRIPTION +Type::Tiny is tested with L 2.0007 and above. + L type constraints have an API almost identical to that of L. It is also able to build a Moose::Meta::TypeConstraint constraint from a Type::Tiny constraint, and @@ -111,7 +109,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithMouse.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithMouse.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithMouse.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithMouse.pod 2019-01-08 18:26:35.000000000 +0000 @@ -13,19 +13,15 @@ use Mouse; use Types::Standard qw( Str Int ); - use Type::Utils qw( declare as where inline_as coerce from ); has name => ( is => "ro", isa => Str, ); - my $PositiveInt = declare - as Int, - where { $_ > 0 }, - inline_as { "$_ =~ /^[0-9]+\$/ and $_ > 0" }; - - coerce $PositiveInt, from Int, q{ abs $_ }; + my $PositiveInt = Int + -> where( sub { $_ > 0 } ) + -> plus_coercions( Int, sub { abs $_ } ); has age => ( is => "ro", @@ -50,6 +46,8 @@ =head1 DESCRIPTION +Type::Tiny is tested with L 1.00 and above. + L type constraints have an API almost identical to that of L. As a result, you can use a Type::Tiny object pretty much anywhere you'd use a Mouse::Meta::TypeConstraint and @@ -110,7 +108,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithOther.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithOther.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual/UsingWithOther.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual/UsingWithOther.pod 2019-01-08 18:26:35.000000000 +0000 @@ -150,7 +150,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual.pod libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual.pod --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Manual.pod 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Manual.pod 2019-01-08 18:26:35.000000000 +0000 @@ -111,8 +111,8 @@ install them separately. If using Type::Tiny in conjunction with L, then at least Moo -1.001000 is recommended. If using Type::Tiny with L, then at -least Moose 2.0600 is recommended. If using Type::Tiny with L, +1.000000 is recommended. If using Type::Tiny with L, then at +least Moose 2.0000 is recommended. If using Type::Tiny with L, then at least Mouse 1.00 is recommended. Type::Tiny is mostly untested against older versions of these packages. @@ -176,7 +176,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Role.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/Role.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Role.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Role.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Tiny::Role::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::Role::VERSION = '1.000005'; + $Type::Tiny::Role::VERSION = '1.004004'; } use Scalar::Util qw< blessed weaken >; @@ -162,7 +162,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny/Union.pm libtype-tiny-perl-1.004004/lib/Type/Tiny/Union.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny/Union.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny/Union.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Tiny::Union::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::Union::VERSION = '1.000005'; + $Type::Tiny::Union::VERSION = '1.004004'; } use Scalar::Util qw< blessed >; @@ -187,6 +187,75 @@ ]; } +sub equals +{ + my ($self, $other) = Type::Tiny::_loose_to_TypeTiny(@_); + return unless blessed($self) && $self->isa("Type::Tiny"); + return unless blessed($other) && $other->isa("Type::Tiny"); + + return !!1 if $self->SUPER::equals($other); + return !!0 unless $other->isa(__PACKAGE__); + + my @self_constraints = @{ $self->type_constraints }; + my @other_constraints = @{ $other->type_constraints }; + + return !!0 unless @self_constraints == @other_constraints; + + constraint: foreach my $constraint ( @self_constraints ) { + for ( my $i = 0; $i < @other_constraints; $i++ ) { + if ( $constraint->equals($other_constraints[$i]) ) { + splice @other_constraints, $i, 1; + next constraint; + } + } + } + + @other_constraints == 0; +} + +sub is_a_type_of +{ + my ($self, $other) = Type::Tiny::_loose_to_TypeTiny(@_); + return unless blessed($self) && $self->isa("Type::Tiny"); + return unless blessed($other) && $other->isa("Type::Tiny"); + + return !!1 if $self->SUPER::is_a_type_of($other); + + for my $tc (@{ $self->type_constraints }) { + return !!0 unless $tc->is_a_type_of($other); + } + return !!1; +} + +sub is_subtype_of +{ + my ($self, $other) = Type::Tiny::_loose_to_TypeTiny(@_); + return unless blessed($self) && $self->isa("Type::Tiny"); + return unless blessed($other) && $other->isa("Type::Tiny"); + + return !!1 if $self->SUPER::is_subtype_of($other); + + for my $tc (@{ $self->type_constraints }) { + return !!0 unless $tc->is_subtype_of($other); + } + return !!1; +} + +sub is_supertype_of +{ + my ($self, $other) = Type::Tiny::_loose_to_TypeTiny(@_); + return unless blessed($self) && $self->isa("Type::Tiny"); + return unless blessed($other) && $other->isa("Type::Tiny"); + + return !!1 if $self->SUPER::is_supertype_of($other); + + for my $tc (@{ $self->type_constraints }) { + return !!1 if $tc->equals($other); + return !!1 if $tc->is_supertype_of($other); + } + return !!0; +} + 1; __END__ @@ -284,7 +353,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Tiny.pm libtype-tiny-perl-1.004004/lib/Type/Tiny.pm --- libtype-tiny-perl-1.000005/lib/Type/Tiny.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Tiny.pm 2019-01-08 18:26:35.000000000 +0000 @@ -10,11 +10,10 @@ BEGIN { $Type::Tiny::AUTHORITY = 'cpan:TOBYINK'; - $Type::Tiny::VERSION = '1.000005'; - $Type::Tiny::XS_VERSION = '0.010'; + $Type::Tiny::VERSION = '1.004004'; + $Type::Tiny::XS_VERSION = '0.011'; } -use Eval::TypeTiny (); use Scalar::Util qw( blessed weaken refaddr isweak ); use Types::TypeTiny (); @@ -59,24 +58,55 @@ q(&{}) => "_overload_coderef", q(|) => sub { my @tc = _swap @_; - if (!_FIXED_PRECEDENCE && !blessed $tc[0] && ref $tc[0] eq 'ARRAY') { - require Type::Tiny::_HalfOp; - return "Type::Tiny::_HalfOp"->new('|', @tc); - } + if (!_FIXED_PRECEDENCE && $_[2]) { + if (blessed $tc[0]) { + if (blessed $tc[0] eq "Type::Tiny::_HalfOp") { + my $type = $tc[0]->{type}; + my $param = $tc[0]->{param}; + my $op = $tc[0]->{op}; + require Type::Tiny::Union; + return "Type::Tiny::_HalfOp"->new( + $op, + $param, + "Type::Tiny::Union"->new(type_constraints => [$type, $tc[1]]), + ); + } + } + elsif (ref $tc[0] eq 'ARRAY') { + require Type::Tiny::_HalfOp; + return "Type::Tiny::_HalfOp"->new('|', @tc); + } + } require Type::Tiny::Union; - "Type::Tiny::Union"->new(type_constraints => \@tc) + return "Type::Tiny::Union"->new(type_constraints => \@tc) }, q(&) => sub { my @tc = _swap @_; - if (!_FIXED_PRECEDENCE && !blessed $tc[0] && ref $tc[0] eq 'ARRAY') { - require Type::Tiny::_HalfOp; - return "Type::Tiny::_HalfOp"->new('&', @tc); - } + if (!_FIXED_PRECEDENCE && $_[2]) { + if (blessed $tc[0]) { + if (blessed $tc[0] eq "Type::Tiny::_HalfOp") { + my $type = $tc[0]->{type}; + my $param = $tc[0]->{param}; + my $op = $tc[0]->{op}; + require Type::Tiny::Intersection; + return "Type::Tiny::_HalfOp"->new( + $op, + $param, + "Type::Tiny::Intersection"->new(type_constraints => [$type, $tc[1]]), + ); + } + } + elsif (ref $tc[0] eq 'ARRAY') { + require Type::Tiny::_HalfOp; + return "Type::Tiny::_HalfOp"->new('&', @tc); + } + } require Type::Tiny::Intersection; "Type::Tiny::Intersection"->new(type_constraints => \@tc) }, q(~) => sub { shift->complementary_type }, q(==) => sub { $_[0]->equals($_[1]) }, + q(!=) => sub { not $_[0]->equals($_[1]) }, q(<) => sub { my $m = $_[0]->can('is_subtype_of'); $m->(_swap @_) }, q(>) => sub { my $m = $_[0]->can('is_subtype_of'); $m->(reverse _swap @_) }, q(<=) => sub { my $m = $_[0]->can('is_a_type_of'); $m->(_swap @_) }, @@ -119,11 +149,30 @@ my $QFS; my $uniq = 1; +my $subname; sub new { my $class = shift; my %params = (@_==1) ? %{$_[0]} : @_; + if (exists $params{constraint} + and not ref $params{constraint} + and not exists $params{constraint_generator} + and not exists $params{inline_generator}) + { + require Eval::TypeTiny; + my $code = $params{constraint}; + $params{constraint} = Eval::TypeTiny::eval_closure( + source => sprintf('sub ($) { %s }', $code), + description => "anonymous check", + ); + $params{inlined} ||= sub { + my ($type) = @_; + my $inlined = $_ eq '$_' ? "do { $code }" : "do { local \$_ = $_; $code }"; + $type->has_parent ? (undef, $inlined) : $inlined; + }; + } + if (exists $params{parent}) { $params{parent} = ref($params{parent}) =~ /^Type::Tiny\b/ @@ -132,8 +181,16 @@ _croak "Parent must be an instance of %s", __PACKAGE__ unless blessed($params{parent}) && $params{parent}->isa(__PACKAGE__); + + if ($params{parent}->deprecated and not exists $params{deprecated}) + { + $params{deprecated} = 1; + } } + # canonicalize to a boolean + $params{deprecated} = !!$params{deprecated}; + $params{name} = "__ANON__" unless exists $params{name}; $params{uniq} = $uniq++; @@ -203,14 +260,19 @@ $self->coercion->add_type_coercions(@$arr); } - if ($params{my_methods} and eval { require Sub::Name }) + if ($params{my_methods}) { - for my $key (keys %{$params{my_methods}}) + $subname = + eval { require Sub::Util } ? \&Sub::Util::set_subname : + eval { require Sub::Name } ? \&Sub::Name::subname : + 0 + if not defined $subname; + if ($subname) { - Sub::Name::subname( - sprintf("%s::my_%s", $self->qualified_name, $key), - $params{my_methods}{$key}, - ); + (Scalar::Util::reftype($params{my_methods}{$_}) eq 'CODE') && $subname->( + sprintf("%s::my_%s", $self->qualified_name, $_), + $params{my_methods}{$_}, + ) for keys %{$params{my_methods}}; } } @@ -280,6 +342,7 @@ sub message { $_[0]{message} } sub library { $_[0]{library} } sub inlined { $_[0]{inlined} } +sub deprecated { $_[0]{deprecated} } sub constraint_generator { $_[0]{constraint_generator} } sub inline_generator { $_[0]{inline_generator} } sub name_generator { $_[0]{name_generator} ||= $_[0]->_build_name_generator } @@ -363,6 +426,7 @@ return $self->parent->compiled_check; } + require Eval::TypeTiny; return Eval::TypeTiny::eval_closure( source => sprintf('sub ($) { %s }', $self->inline_check('$_[0]')), description => sprintf("compiled check '%s'", $self), @@ -673,7 +737,7 @@ unless $self->has_parent; $r[0] = $self->parent->inline_check(@_); } - my $r = join " && " => map { /[;{}]/ ? "do { $_ }" : "($_)" } @r; + my $r = join " && " => map { /[;{}]/ && !/\Ado \{.+\}\z/ ? "do { $_ }" : "($_)" } @r; return @r==1 ? $r : "($r)"; } @@ -1231,9 +1295,12 @@ =item C<< constraint >> -Coderef to validate a value (C<< $_ >>) against the type constraint. The -coderef will not be called unless the value is known to pass any parent -type constraint (see C below). +Coderef to validate a value (C<< $_ >>) against the type constraint. +The coderef will not be called unless the value is known to pass any +parent type constraint (see C below). + +Alternatively, a string of Perl code checking C<< $_ >> can be passed +as a parameter to the constructor, and will be converted to a coderef. Defaults to C<< sub { 1 } >> - i.e. a coderef that passes all values. @@ -1251,6 +1318,7 @@ If C (above) is a coderef generated via L, then Type::Tiny I be able to automatically generate C for you. +If C (above) is a string, it will be able to. =item C<< name >> @@ -1272,6 +1340,15 @@ Optional. Informational only: setting this attribute does not install the type into the package. +=item C<< deprecated >> + +Optional boolean indicating whether a type constraint is deprecated. +L will issue a warning if you attempt to import a deprecated +type constraint, but otherwise the type will continue to function as normal. +There will not be deprecation warnings every time you validate a value, for +instance. If omitted, defaults to the parent's deprecation status (or false +if there's no parent). + =item C<< message >> Coderef that returns an error message when C<< $_ >> does not validate @@ -1305,26 +1382,57 @@ =item C<< constraint_generator >> -Coderef that generates a new constraint coderef based on parameters. -Alternatively, the constraint generator can return a fully-formed -Type::Tiny object, in which case the C, C, -and C attributes documented below are ignored. +Coderef that is called when a type constraint is parameterized. When called, +it is passed the list of parameters, though any parameter which looks like a +foreign type constraint (Moose type constraints, Mouse type constraints, etc, +I<< and coderefs(!!!) >>) is first coerced to a native Type::Tiny object. + +Note that for compatibility with the Moose API, the base type is I +passed to the constraint generator, but can be found in the package variable +C<< $Type::Tiny::parameterize_type >>. The first parameter is also available +as C<< $_ >>. + +Types I be parameterized with an empty parameter list. For example, +in L, C is just an alias for C but +C<< Tuple[] >> will only allow zero-length arrayrefs to pass the constraint. +If you wish C<< YourType >> and C<< YourType[] >> to mean the same thing, +then do: + + return $Type::Tiny::parameterize_type unless @_; + +The constraint generator should generate and return a new constraint coderef +based on the parameters. Alternatively, the constraint generator can return a +fully-formed Type::Tiny object, in which case the C, +C, and C attributes documented below +are ignored. Optional; providing a generator makes this type into a parameterizable -type constraint. +type constraint. If there is no generator, attempting to parameterize the +type constraint will throw an exception. =item C<< name_generator >> -A coderef which generates a new display_name based on parameters. +A coderef which generates a new display_name based on parameters. Called with +the same parameters and package variables as the C. +Expected to return a string. + Optional; the default is reasonable. =item C<< inline_generator >> -A coderef which generates a new inlining coderef based on parameters. +A coderef which generates a new inlining coderef based on parameters. Called +with the same parameters and package variables as the C. +Expected to return a coderef. + +Optional. =item C<< coercion_generator >> A coderef which generates a new L object based on parameters. +Called with the same parameters and package variables as the +C. Expected to return a blessed object. + +Optional. =item C<< deep_explanation >> @@ -1478,6 +1586,11 @@ HashRef & sub { exists($_->{name}) } +Like the C<< constraint >> attribute, this will accept a string of Perl +code: + + HashRef->where('exists($_->{name})') + =item C<< child_type_class >> The class that create_child_type will construct by default. @@ -1756,6 +1869,18 @@ =back +=head2 Environment + +=over + +=item C + +Currently this has more effect on L than Type::Tiny. In +future it may be used to trigger or suppress the loading XS implementations +of parts of Type::Tiny. + +=back + =head1 BUGS Please report any bugs to @@ -1790,7 +1915,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Type/Utils.pm libtype-tiny-perl-1.004004/lib/Type/Utils.pm --- libtype-tiny-perl-1.000005/lib/Type/Utils.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Type/Utils.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Type::Utils::AUTHORITY = 'cpan:TOBYINK'; - $Type::Utils::VERSION = '1.000005'; + $Type::Utils::VERSION = '1.004004'; } sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } @@ -476,11 +476,46 @@ my $r = $self->SUPER::foreign_lookup(@_); return $r if $r; - if (defined($self->{"~~assume"}) + if (my $assume = $self->{"~~assume"} and $_[0] =~ /[A-Z_a-z][0-9A-Z_a-z]*(?:::[0-9A-Z_a-z]+)*/) { - my $method = $self->{"~~assume"}; - return $self->$method(@_); + my @methods = ref($assume) ? @$assume : $assume; + + for my $method (@methods) + { + $r = $self->$method(@_); + return $r if $r; + } + } + + return; + } + + sub lookup_via_moose + { + my $self = shift; + + if ($INC{'Moose.pm'}) + { + require Moose::Util::TypeConstraints; + require Types::TypeTiny; + my $r = Moose::Util::TypeConstraints::find_type_constraint($_[0]); + return Types::TypeTiny::to_TypeTiny($r) if defined $r; + } + + return; + } + + sub lookup_via_mouse + { + my $self = shift; + + if ($INC{'Mouse.pm'}) + { + require Mouse::Util::TypeConstraints; + require Types::TypeTiny; + my $r = Mouse::Util::TypeConstraints::find_type_constraint($_[0]); + return Types::TypeTiny::to_TypeTiny($r) if defined $r; } return; @@ -508,30 +543,6 @@ # Only continue any further if we've been called from Type::Parser. return unless $_[1]; - my $moose_lookup = sub - { - if ($INC{'Moose.pm'}) - { - require Moose::Util::TypeConstraints; - require Types::TypeTiny; - $r = Moose::Util::TypeConstraints::find_type_constraint($_[0]); - $r = Types::TypeTiny::to_TypeTiny($r) if defined $r; - } - defined $r; - }; - - my $mouse_lookup = sub - { - if ($INC{'Mouse.pm'}) - { - require Mouse::Util::TypeConstraints; - require Types::TypeTiny; - $r = Mouse::Util::TypeConstraints::find_type_constraint($_[0]); - $r = Types::TypeTiny::to_TypeTiny($r) if defined $r; - } - defined $r; - }; - my $meta; if (defined $self->{"~~chained"}) { @@ -541,16 +552,14 @@ if ($meta and $meta->isa('Class::MOP::Module')) { - $moose_lookup->(@_) and return $r; + $r = $self->lookup_via_moose(@_); + return $r if $r; } + elsif ($meta and $meta->isa('Mouse::Meta::Module')) { - $mouse_lookup->(@_) and return $r; - } - else - { - $moose_lookup->(@_) and return $r; - $mouse_lookup->(@_) and return $r; + $r = $self->lookup_via_mouse(@_); + return $r if $r; } return $self->foreign_lookup(@_); @@ -569,9 +578,20 @@ }; local $dwimmer->{'~~chained'} = $opts{for}; - local $dwimmer->{'~~assume'} = $opts{does} ? 'make_role_type' : 'make_class_type'; + local $dwimmer->{'~~assume'} = $opts{fallback} || [ + qw/ lookup_via_moose lookup_via_mouse /, + $opts{does} ? 'make_role_type' : 'make_class_type', + ]; + + local $@ = undef; + my $type; + unless (eval { $type = $dwimmer->lookup($string); 1 }) + { + my $e = $@; + die($e) unless $e =~ /not a known type constraint/; + } - $dwimmer->lookup($string); + $type; } sub english_list @@ -978,25 +998,54 @@ It uses the syntax of L. Firstly the L for the caller package is consulted; if that doesn't have a match, -L is consulted for type constraint names; and if -there's still no match, then if a type constraint looks like a class -name, a new L object is created for it. +L is consulted for standard type constraint names. + +If none of the above yields a type constraint, and the caller class +is a Moose-based class, then C attempts to look the type +constraint up in the Moose type registry. If it's a Mouse-based class, +then the Mouse type registry is used instead. + +If no type constraint can be found via these normal methods, several +fallbacks are available: + +=over + +=item C + +Lookup in Moose registry even if caller is non-Moose class. + +=item C -Somewhere along the way, it also checks Moose/Mouse's type constraint -registries if they are loaded. +Lookup in Mouse registry even if caller is non-Mouse class. + +=item C + +Create a new Type::Tiny::Class constraint. + +=item C + +Create a new Type::Tiny::Role constraint. + +=back + +You can alter which should be attempted, and in which order, by passing +an option to C: + + my $type = Type::Utils::dwim_type( + "ArrayRef[Int]", + fallback => [ "lookup_via_mouse" , "make_role_type" ], + ); + +For historical reasons, by default the fallbacks attempted are: + + lookup_via_moose, lookup_via_mouse, make_class_type + +You may set C to an empty arrayref to avoid using any of +these fallbacks. You can specify an alternative for the caller using the C option. -If you'd rather create a L object, set the C -option to true. - # An arrayref of objects, each of which must do role Foo. - my $type = dwim_type("ArrayRef[Foo]", does => 1); - - Type::Registry->for_me->add_types("-Standard"); - Type::Registry->for_me->alias_type("Int" => "Foo"); - - # An arrayref of integers. - my $type = dwim_type("ArrayRef[Foo]", does => 1); + my $type = dwim_type("ArrayRef", for => "Moose::Object"); While it's probably better overall to use the proper L interface for resolving type constraint strings, this function often does @@ -1053,7 +1102,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Common/Numeric.pm libtype-tiny-perl-1.004004/lib/Types/Common/Numeric.pm --- libtype-tiny-perl-1.000005/lib/Types/Common/Numeric.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Common/Numeric.pm 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ BEGIN { $Types::Common::Numeric::AUTHORITY = 'cpan:TOBYINK'; - $Types::Common::Numeric::VERSION = '1.000005'; + $Types::Common::Numeric::VERSION = '1.004004'; } use Type::Library -base, -declare => qw( @@ -19,10 +19,13 @@ NegativeNum NegativeOrZeroNum NegativeInt NegativeOrZeroInt SingleDigit + NumRange IntRange ); use Type::Tiny (); -use Types::Standard qw( Num Int ); +use Types::Standard qw( Num Int Bool ); + +sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } my $meta = __PACKAGE__->meta; @@ -44,7 +47,8 @@ my ($pos_int, $posz_int); if (Type::Tiny::_USE_XS) { - $pos_int = Type::Tiny::XS::get_coderef_for('PositiveInt'); + $pos_int = Type::Tiny::XS::get_coderef_for('PositiveInt') + if Type::Tiny::XS->VERSION >= 0.013; # fixed bug with "00" $posz_int = Type::Tiny::XS::get_coderef_for('PositiveOrZeroInt'); } @@ -118,6 +122,77 @@ message => sub { "Must be a single digit" }, ); +for my $base (qw/Num Int/) { + $meta->add_type( + name => "${base}Range", + parent => Types::Standard->get_type($base), + constraint_generator => sub { + return $meta->get_type("${base}Range") unless @_; + + my $base = Types::Standard->get_type($base); + + my ($min, $max, $min_excl, $max_excl) = @_; + !defined($min) or $base->check($min) or _croak("${base}Range min must be a %s; got %s", lc($base), $min); + !defined($max) or $base->check($max) or _croak("${base}Range max must be a %s; got %s", lc($base), $max); + !defined($min_excl) or Bool->check($min_excl) or _croak("${base}Range minexcl must be a boolean; got $min_excl"); + !defined($max_excl) or Bool->check($max_excl) or _croak("${base}Range maxexcl must be a boolean; got $max_excl"); + + # this is complicated so defer to the inline generator + eval sprintf( + 'sub { %s }', + join ' and ', + grep defined, + $meta->get_type("${base}Range")->inline_generator->(@_)->(undef, '$_[0]'), + ); + }, + inline_generator => sub { + my ($min, $max, $min_excl, $max_excl) = @_; + + my $gt = $min_excl ? '>' : '>='; + my $lt = $max_excl ? '<' : '<='; + + return sub { + my $v = $_[1]; + my @code = (undef); # parent constraint + push @code, "$v $gt $min"; + push @code, "$v $lt $max" if defined $max; + return @code; + }; + }, + deep_explanation => sub { + my ($type, $value, $varname) = @_; + my ($min, $max, $min_excl, $max_excl) = @{ $type->parameters || [] }; + my @whines; + if (defined $max) { + push @whines, sprintf( + '"%s" expects %s to be %s %d and %s %d', + $type, + $varname, + $min_excl ? 'greater than' : 'at least', + $min, + $max_excl ? 'less than' : 'at most', + $max, + ); + } + else { + push @whines, sprintf( + '"%s" expects %s to be %s %d', + $type, + $varname, + $min_excl ? 'greater than' : 'at least', + $min, + ); + } + push @whines, sprintf( + "length(%s) is %d", + $varname, + length($value), + ); + return \@whines; + }, + ); +} + __PACKAGE__->meta->make_immutable; 1; @@ -166,11 +241,50 @@ =item C -=back - C interestingly accepts the numbers -9 to -1; not just 0 to 9. +=back + +This module also defines an extra pair of type constraints not found in +L. + +=over + +=item C<< IntRange[`min, `max] >> + +Type constraint for an integer between min and max. For example: + + IntRange[1, 10] + +The maximum can be omitted. + + IntRange[10] # at least 10 + +The minimum and maximum are inclusive. + +=item C<< NumRange[`min, `max] >> + +Type constraint for a number between min and max. For example: + + NumRange[0.1, 10.0] + +As with IntRange, the maximum can be omitted, and the minimum and maximum +are inclusive. + +Exclusive ranges can be useful for non-integer values, so additional parameters +can be given to make the minimum and maximum exclusive. + + NumRange[0.1, 10.0, 0, 0] # both inclusive + NumRange[0.1, 10.0, 0, 1] # exclusive maximum, so 10.0 is invalid + NumRange[0.1, 10.0, 1, 0] # exclusive minimum, so 0.1 is invalid + NumRange[0.1, 10.0, 1, 1] # both exclusive + +Making one of the limits exclusive means that a C<< < >> or C<< > >> operator +will be used instead of the usual C<< <= >> or C<< >= >> operators. + +=back + =head1 BUGS Please report any bugs to @@ -190,7 +304,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Common/String.pm libtype-tiny-perl-1.004004/lib/Types/Common/String.pm --- libtype-tiny-perl-1.000005/lib/Types/Common/String.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Common/String.pm 2019-01-08 18:26:35.000000000 +0000 @@ -11,7 +11,7 @@ BEGIN { $Types::Common::String::AUTHORITY = 'cpan:TOBYINK'; - $Types::Common::String::VERSION = '1.000005'; + $Types::Common::String::VERSION = '1.004004'; } use Type::Library -base, -declare => qw( @@ -25,6 +25,7 @@ NonEmptyStr LowerCaseStr UpperCaseStr + StrLength ); use Type::Tiny (); @@ -60,7 +61,7 @@ ); NumericCode->coercion->add_type_coercions( - NonEmptySimpleStr, q[ do { (my $code = $_) =~ s/[[:punct:]]//g; $code } ], + NonEmptySimpleStr, q[ do { (my $code = $_) =~ s/[[:punct:][:space:]]//g; $code } ], ); $meta->add_type( @@ -128,7 +129,7 @@ parent => NonEmptySimpleStr, constraint => sub { !/\p{Upper}/ms }, inlined => sub { undef, qq($_ !~ /\\p{Upper}/ms) }, - message => sub { "Must not contain pper case letters" }, + message => sub { "Must not contain upper case letters" }, ); LowerCaseSimpleStr->coercion->add_type_coercions( @@ -147,6 +148,65 @@ NonEmptySimpleStr, q[ uc($_) ], ); +$meta->add_type( + name => StrLength, + parent => Str, + constraint_generator => sub { + return $meta->get_type('StrLength') unless @_; + + my ($min, $max) = @_; + Types::Standard::Int->check($_) + || Types::Standard::_croak("Parameters for StrLength[`min, `max] expected to be integers; got $_") + for @_; + + if (defined $max) { + return sub { length($_[0]) >= $min and length($_[0]) <= $max }; + } + else { + return sub { length($_[0]) >= $min }; + } + }, + inline_generator => sub { + my ($min, $max) = @_; + + return sub { + my $v = $_[1]; + my @code = (undef); # parent constraint + push @code, "length($v) >= $min"; + push @code, "length($v) <= $max" if defined $max; + return @code; + }; + }, + deep_explanation => sub { + my ($type, $value, $varname) = @_; + my ($min, $max) = @{ $type->parameters || [] }; + my @whines; + if (defined $max) { + push @whines, sprintf( + '"%s" expects length(%s) to be between %d and %d', + $type, + $varname, + $min, + $max, + ); + } + else { + push @whines, sprintf( + '"%s" expects length(%s) to be at least %d', + $type, + $varname, + $min, + ); + } + push @whines, sprintf( + "length(%s) is %d", + $varname, + length($value), + ); + return \@whines; + }, +); + __PACKAGE__->meta->make_immutable; 1; @@ -199,6 +259,31 @@ =back +This module also defines an extra type constraint not found in +L. + +=over + +=item C<< StrLength[`min, `max] >> + +Type constraint for a string between min and max characters long. For +example: + + StrLength[4, 20] + +It is sometimes useful to combine this with another type constraint in an +intersection. + + (LowerCaseStr) & (StrLength[4, 20]) + +The max length can be omitted. + + StrLength[10] # at least 10 characters + +Lengths are inclusive. + +=back + =head1 BUGS Please report any bugs to @@ -218,7 +303,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/ArrayRef.pm libtype-tiny-perl-1.004004/lib/Types/Standard/ArrayRef.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/ArrayRef.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/ArrayRef.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Types::Standard::ArrayRef::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::ArrayRef::VERSION = '1.000005'; + $Types::Standard::ArrayRef::VERSION = '1.004004'; } use Type::Tiny (); @@ -21,10 +21,13 @@ { return Types::Standard::ArrayRef unless @_; - my $param = Types::TypeTiny::to_TypeTiny(shift); + my $param = shift; Types::TypeTiny::TypeTiny->check($param) or _croak("Parameter to ArrayRef[`a] expected to be a type constraint; got $param"); + _croak("Only one parameter to ArrayRef[`a] expected; got @{[ 1 + @_ ]}. Did you mean to use Tuple[`a]?") + if @_; + my $param_compiled_check = $param->compiled_check; my $xsub; if (Type::Tiny::_USE_XS) @@ -67,7 +70,8 @@ my $param_check = $param->inline_check('$i'); return sub { my $v = $_[1]; - "ref($v) eq 'ARRAY' and do { " + my $p = Types::Standard::ArrayRef->inline_check($v); + "$p and do { " . "my \$ok = 1; " . "for my \$i (\@{$v}) { " . "(\$ok = 0, last) unless $param_check " @@ -175,7 +179,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/CycleTuple.pm libtype-tiny-perl-1.004004/lib/Types/Standard/CycleTuple.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/CycleTuple.pm 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/CycleTuple.pm 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,259 @@ +package Types::Standard::CycleTuple; + +use 5.006001; +use strict; +use warnings; + +BEGIN { + $Types::Standard::CycleTuple::AUTHORITY = 'cpan:TOBYINK'; + $Types::Standard::CycleTuple::VERSION = '1.004004'; +} + +use Type::Tiny (); +use Types::Standard (); +use Types::TypeTiny (); + +sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } + +my $_Optional = Types::Standard::Optional; +my $_arr = Types::Standard::ArrayRef; + +no warnings; + +my $cycleuniq = 0; + +sub __constraint_generator +{ + my @params = map { + ref($_) eq 'HASH' and exists($_->{slurpy}) + and _croak("Parameters to CycleTuple[...] cannot be slurpy"); + my $param = $_; + Types::TypeTiny::TypeTiny->check($param) + or _croak("Parameters to CycleTuple[...] expected to be type constraints; got $param"); + $param; + } @_; + my $count = @params; + my $tuple = Types::Standard::Tuple()->of(@params); + + _croak("Parameters to CycleTuple[...] cannot be optional") + if grep !!$_->is_strictly_a_type_of($_Optional), @params; + + sub { + my $value = shift; + return unless $_arr->check($value); + return if @$value % $count; + my $i = 0; + while ($i < $#$value) { + my $tmp = [@$value[ $i .. $i+$count-1 ]]; + return unless $tuple->check($tmp); + $i += $count; + } + !!1; + } +} + +sub __inline_generator +{ + my @params = map { + my $param = $_; + Types::TypeTiny::TypeTiny->check($param) + or _croak("Parameter to CycleTuple[`a] expected to be a type constraint; got $param"); + $param; + } @_; + my $count = @params; + my $tuple = Types::Standard::Tuple()->of(@params); + + return unless $tuple->can_be_inlined; + + sub { + $cycleuniq++; + + my $v = $_[1]; + my @checks = $_arr->inline_check($v); + push @checks, sprintf( + 'not(@%s %% %d)', + ($v=~/\A\$[a-z0-9_]+\z/i ? $v : "{$v}"), + $count, + ); + push @checks, sprintf( + 'do { my $cyclecount%d = 0; my $cycleok%d = 1; while ($cyclecount%d < $#{%s}) { my $cycletmp%d = [@{%s}[$cyclecount%d .. $cyclecount%d+%d]]; unless (%s) { $cycleok%d = 0; last; }; $cyclecount%d += %d; }; $cycleok%d; }', + $cycleuniq, + $cycleuniq, + $cycleuniq, + $v, + $cycleuniq, + $v, + $cycleuniq, + $cycleuniq, + $count - 1, + $tuple->inline_check("\$cycletmp$cycleuniq"), + $cycleuniq, + $cycleuniq, + $count, + $cycleuniq, + ) if grep { $_->inline_check('$xyz') ne '(!!1)' } @params; + join(' && ', @checks); + } +} + +sub __deep_explanation +{ + my ($type, $value, $varname) = @_; + + my @constraints = + map Types::TypeTiny::to_TypeTiny($_), @{ $type->parameters }; + + if (@$value % @constraints) + { + return [ + sprintf('"%s" expects a multiple of %d values in the array', $type, scalar(@constraints)), + sprintf('%d values found', scalar(@$value)), + ]; + } + + for my $i (0 .. $#$value) + { + my $constraint = $constraints[$i % @constraints]; + next if $constraint->check($value->[$i]); + + return [ + sprintf('"%s" constrains value at index %d of array with "%s"', $type, $i, $constraint), + @{ $constraint->validate_explain($value->[$i], sprintf('%s->[%s]', $varname, $i)) }, + ]; + } + + # This should never happen... + return; # uncoverable statement +} + +my $label_counter = 0; +sub __coercion_generator +{ + my ($parent, $child, @tuple) = @_; + + my $child_coercions_exist = 0; + my $all_inlinable = 1; + for my $tc (@tuple) + { + $all_inlinable = 0 if !$tc->can_be_inlined; + $all_inlinable = 0 if $tc->has_coercion && !$tc->coercion->can_be_inlined; + $child_coercions_exist++ if $tc->has_coercion; + } + + return unless $child_coercions_exist; + my $C = "Type::Coercion"->new(type_constraint => $child); + + if ($all_inlinable) + { + $C->add_type_coercions($parent => Types::Standard::Stringable { + my $label = sprintf("CTUPLELABEL%d", ++$label_counter); + my $label2 = sprintf("CTUPLEINNER%d", $label_counter); + my @code; + push @code, 'do { my ($orig, $return_orig, $tmp, @new) = ($_, 0);'; + push @code, "$label: {"; + push @code, sprintf('(($return_orig = 1), last %s) if scalar(@$orig) %% %d != 0;', $label, scalar @tuple); + push @code, sprintf('my $%s = 0; while ($%s < @$orig) {', $label2, $label2); + for my $i (0 .. $#tuple) + { + my $ct = $tuple[$i]; + my $ct_coerce = $ct->has_coercion; + + push @code, sprintf( + 'do { $tmp = %s; (%s) ? ($new[$%s + %d]=$tmp) : (($return_orig=1), last %s) };', + $ct_coerce + ? $ct->coercion->inline_coercion("\$orig->[\$$label2 + $i]") + : "\$orig->[\$$label2 + $i]", + $ct->inline_check('$tmp'), + $label2, + $i, + $label, + ); + } + push @code, sprintf('$%s += %d;', $label2, scalar(@tuple)); + push @code, '}'; + push @code, '}'; + push @code, '$return_orig ? $orig : \\@new'; + push @code, '}'; + "@code"; + }); + } + + else + { + $C->add_type_coercions( + $parent => sub { + my $value = @_ ? $_[0] : $_; + + if (scalar(@$value) % scalar(@tuple) != 0) + { + return $value; + } + + my @new; + for my $i (0 .. $#$value) + { + my $ct = $tuple[$i % @tuple]; + my $x = $ct->has_coercion ? $ct->coerce($value->[$i]) : $value->[$i]; + + return $value unless $ct->check($x); + + $new[$i] = $x; + } + + return \@new; + }, + ); + }; + + return $C; +} + +1; + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +Types::Standard::CycleTuple - internals for the Types::Standard CycleTuple type constraint + +=head1 STATUS + +This module is considered part of Type-Tiny's internals. It is not +covered by the +L. + +=head1 DESCRIPTION + +This file contains some of the guts for L. +It will be loaded on demand. You may ignore its presence. + +=head1 BUGS + +Please report any bugs to +L. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2017-2019 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. + diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/Dict.pm libtype-tiny-perl-1.004004/lib/Types/Standard/Dict.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/Dict.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/Dict.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,13 +6,13 @@ BEGIN { $Types::Standard::Dict::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::Dict::VERSION = '1.000005'; + $Types::Standard::Dict::VERSION = '1.004004'; } use Types::Standard (); use Types::TypeTiny (); -sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } +sub _croak ($;@) { require Carp; goto \&Carp::confess; require Error::TypeTiny; goto \&Error::TypeTiny::croak } my $_optional = Types::Standard::Optional; my $_hash = Types::Standard::HashRef; @@ -21,18 +21,41 @@ no warnings; +sub pair_iterator { + _croak("Expected even-sized list") if @_ % 2; + my @array = @_; + sub { + return unless @array; + splice(@array, 0, 2); + }; +} + sub __constraint_generator { - my $slurpy = ref($_[-1]) eq q(HASH) ? pop(@_)->{slurpy} : undef; - my %constraints = @_; + my $shash; + my $slurpy = ref($_[-1]) eq q(HASH) ? do { $shash = pop @_; Types::TypeTiny::to_TypeTiny($shash->{slurpy}) } : undef; + my $iterator = pair_iterator @_; + my %constraints; my %is_optional; + my @keys; - while (my ($k, $v) = each %constraints) + if ($slurpy) { - $constraints{$k} = Types::TypeTiny::to_TypeTiny($v); - $is_optional{$k} = !!$constraints{$k}->is_strictly_a_type_of($_optional); + Types::TypeTiny::TypeTiny->check($slurpy) + or _croak("Slurpy parameter to Dict[...] expected to be a type constraint; got $slurpy"); + + $shash->{slurpy} = $slurpy; # store canonicalized slurpy + } + + while (my ($k, $v) = $iterator->()) + { + $constraints{$k} = $v; Types::TypeTiny::TypeTiny->check($v) - or _croak("Parameter to Dict[`a] for key '$k' expected to be a type constraint; got $v"); + or _croak("Parameter for Dict[...] with key '$k' expected to be a type constraint; got $v"); + Types::TypeTiny::StringLike->check($k) + or _croak("Key for Dict[...] expected to be string; got $k"); + push @keys, $k; + $is_optional{$k} = !!$constraints{$k}->is_strictly_a_type_of($_optional); } return sub @@ -49,7 +72,7 @@ { exists($constraints{$_}) || return for sort keys %$value; } - for my $k (sort keys %constraints) { + for my $k (@keys) { exists($value->{$k}) or ($is_optional{$k} ? next : return); $constraints{$k}->check($value->{$k}) or return; } @@ -80,20 +103,24 @@ && [ $_any, $slurpy->parameters->[0] ] )); - my %constraints = @_; - for my $c (values %constraints) + my $iterator = pair_iterator @_; + my %constraints; + my @keys; + + while (my ($k, $c) = $iterator->()) { - next if $c->can_be_inlined; - return; + return unless $c->can_be_inlined; + $constraints{$k} = $c; + push @keys, $k; } - my $regexp = join "|", map quotemeta, sort keys %constraints; + my $regexp = join "|", map quotemeta, @keys; return sub { require B; my $h = $_[1]; join " and ", - "ref($h) eq 'HASH'", + Types::Standard::HashRef->inline_check($h), ( $slurpy_is_any ? () : $slurpy_is_map ? do { '(not grep {' @@ -117,7 +144,7 @@ $constraints{$_}->is_strictly_a_type_of( $_optional ) ? sprintf('(!exists %s->{%s} or %s)', $h, $k, $constraints{$_}->inline_check("$h\->{$k}")) : ( "exists($h\->{$k})", $constraints{$_}->inline_check("$h\->{$k}") ) - } sort keys %constraints ), + } @keys ), } } @@ -128,11 +155,19 @@ my @params = @{ $type->parameters }; my $slurpy = ref($params[-1]) eq q(HASH) ? pop(@params)->{slurpy} : undef; - my %constraints = @params; - - for my $k (sort keys %constraints) + my $iterator = pair_iterator @params; + my %constraints; + my @keys; + + while (my ($k, $c) = $iterator->()) + { + push @keys, $k; + $constraints{$k} = $c; + } + + for my $k (@keys) { - next if $constraints{$k}->parent == Types::Standard::Optional && !exists $value->{$k}; + next if $constraints{$k}->has_parent && ($constraints{$k}->parent == Types::Standard::Optional) && (!exists $value->{$k}); next if $constraints{$k}->check($value->{$k}); return [ @@ -180,15 +215,19 @@ my $C = "Type::Coercion"->new(type_constraint => $child); my $all_inlinable = 1; + my $child_coercions_exist = 0; for my $tc (values %dict) { $all_inlinable = 0 if !$tc->can_be_inlined; $all_inlinable = 0 if $tc->has_coercion && !$tc->coercion->can_be_inlined; - last if!$all_inlinable; + $child_coercions_exist++ if $tc->has_coercion; } $all_inlinable = 0 if $slurpy && !$slurpy->can_be_inlined; $all_inlinable = 0 if $slurpy && $slurpy->has_coercion && !$slurpy->coercion->can_be_inlined; - + + $child_coercions_exist++ if $slurpy && $slurpy->has_coercion; + return unless $child_coercions_exist; + if ($all_inlinable) { $C->add_type_coercions($parent => Types::Standard::Stringable { @@ -226,7 +265,7 @@ my $K = B::perlstring($k); push @code, sprintf( - 'if (exists $orig->{%s}) { $tmp = %s; (%s) ? ($new{%s}=$tmp) : ($return_orig=1 and last %s) }', + 'if (exists $orig->{%s}) { $tmp = %s; (%s) ? ($new{%s}=$tmp) : (($return_orig=1), last %s) }', $K, $ct_coerce ? $ct->coercion->inline_coercion("\$orig->{$K}") @@ -300,6 +339,84 @@ return $C; } +sub __dict_is_slurpy +{ + my $self = shift; + + return !!0 if $self==Types::Standard::Dict(); + + my $dict = $self->find_parent(sub { $_->has_parent && $_->parent==Types::Standard::Dict() }); + ref($dict->parameters->[-1]) eq q(HASH) + ? $dict->parameters->[-1]{slurpy} + : !!0 +} + +sub __hashref_allows_key +{ + my $self = shift; + my ($key) = @_; + + return Types::Standard::Str()->check($key) if $self==Types::Standard::Dict(); + + my $dict = $self->find_parent(sub { $_->has_parent && $_->parent==Types::Standard::Dict() }); + my %params; + my $slurpy = $dict->my_dict_is_slurpy; + if ($slurpy) + { + my @args = @{$dict->parameters}; + pop @args; + %params = @args; + } + else + { + %params = @{ $dict->parameters } + } + + return !!1 + if exists($params{$key}); + return !!0 + if !$slurpy; + return Types::Standard::Str()->check($key) + if $slurpy==Types::Standard::Any() || $slurpy==Types::Standard::Item() || $slurpy==Types::Standard::Defined() || $slurpy==Types::Standard::Ref(); + return $slurpy->my_hashref_allows_key($key) + if $slurpy->is_a_type_of(Types::Standard::HashRef()); + return !!0; +} + +sub __hashref_allows_value +{ + my $self = shift; + my ($key, $value) = @_; + + return !!0 unless $self->my_hashref_allows_key($key); + return !!1 if $self==Types::Standard::Dict(); + + my $dict = $self->find_parent(sub { $_->has_parent && $_->parent==Types::Standard::Dict() }); + my %params; + my $slurpy = $dict->my_dict_is_slurpy; + if ($slurpy) + { + my @args = @{$dict->parameters}; + pop @args; + %params = @args; + } + else + { + %params = @{ $dict->parameters } + } + + return !!1 + if exists($params{$key}) && $params{$key}->check($value); + return !!0 + if !$slurpy; + return !!1 + if $slurpy==Types::Standard::Any() || $slurpy==Types::Standard::Item() || $slurpy==Types::Standard::Defined() || $slurpy==Types::Standard::Ref(); + return $slurpy->my_hashref_allows_value($key, $value) + if $slurpy->is_a_type_of(Types::Standard::HashRef()); + return !!0; +} + + 1; __END__ @@ -338,7 +455,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/HashRef.pm libtype-tiny-perl-1.004004/lib/Types/Standard/HashRef.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/HashRef.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/HashRef.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Types::Standard::HashRef::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::HashRef::VERSION = '1.000005'; + $Types::Standard::HashRef::VERSION = '1.004004'; } use Type::Tiny (); @@ -21,7 +21,7 @@ { return Types::Standard::HashRef unless @_; - my $param = Types::TypeTiny::to_TypeTiny(shift); + my $param = shift; Types::TypeTiny::TypeTiny->check($param) or _croak("Parameter to HashRef[`a] expected to be a type constraint; got $param"); @@ -67,7 +67,8 @@ my $param_check = $param->inline_check('$i'); return sub { my $v = $_[1]; - "ref($v) eq 'HASH' and do { " + my $p = Types::Standard::HashRef->inline_check($v); + "$p and do { " . "my \$ok = 1; " . "for my \$i (values \%{$v}) { " . "(\$ok = 0, last) unless $param_check " @@ -138,6 +139,24 @@ return $C; } +sub __hashref_allows_key { + my $self = shift; + Types::Standard::Str()->check($_[0]); +} + +sub __hashref_allows_value { + my $self = shift; + my ($key, $value) = @_; + + return !!0 unless $self->my_hashref_allows_key($key); + return !!1 if $self==Types::Standard::HashRef(); + + my $href = $self->find_parent(sub { $_->has_parent && $_->parent==Types::Standard::HashRef() }); + my $param = $href->type_parameter; + + Types::Standard::Str()->check($key) and $param->check($value); +} + 1; __END__ @@ -176,7 +195,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/Map.pm libtype-tiny-perl-1.004004/lib/Types/Standard/Map.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/Map.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/Map.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Types::Standard::Map::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::Map::VERSION = '1.000005'; + $Types::Standard::Map::VERSION = '1.004004'; } use Type::Tiny (); @@ -23,7 +23,7 @@ { return $meta->get_type('Map') unless @_; - my ($keys, $values) = map Types::TypeTiny::to_TypeTiny($_), @_; + my ($keys, $values) = @_; Types::TypeTiny::TypeTiny->check($keys) or _croak("First parameter to Map[`k,`v] expected to be a type constraint; got $keys"); Types::TypeTiny::TypeTiny->check($values) @@ -80,7 +80,8 @@ my $v_check = $v->inline_check('$v'); return sub { my $h = $_[1]; - "ref($h) eq 'HASH' and do { " + my $p = Types::Standard::HashRef->inline_check($h); + "$p and do { " . "my \$ok = 1; " . "for my \$v (values \%{$h}) { " . "(\$ok = 0, last) unless $v_check " @@ -172,6 +173,32 @@ return $C; } +sub __hashref_allows_key { + my $self = shift; + my ($key) = @_; + + return Types::Standard::Str()->check($key) if $self==Types::Standard::Map(); + + my $map = $self->find_parent(sub { $_->has_parent && $_->parent==Types::Standard::Map() }); + my ($kcheck, $vcheck) = @{ $map->parameters }; + + ($kcheck or Types::Standard::Any())->check($key); +} + +sub __hashref_allows_value { + my $self = shift; + my ($key, $value) = @_; + + return !!0 unless $self->my_hashref_allows_key($key); + return !!1 if $self==Types::Standard::Map(); + + my $map = $self->find_parent(sub { $_->has_parent && $_->parent==Types::Standard::Map() }); + my ($kcheck, $vcheck) = @{ $map->parameters }; + + ($kcheck or Types::Standard::Any())->check($key) + and ($vcheck or Types::Standard::Any())->check($value); +} + 1; __END__ @@ -210,7 +237,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/ScalarRef.pm libtype-tiny-perl-1.004004/lib/Types/Standard/ScalarRef.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/ScalarRef.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/ScalarRef.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Types::Standard::ScalarRef::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::ScalarRef::VERSION = '1.000005'; + $Types::Standard::ScalarRef::VERSION = '1.004004'; } use Types::Standard (); @@ -20,7 +20,7 @@ { return Types::Standard::ScalarRef unless @_; - my $param = Types::TypeTiny::to_TypeTiny(shift); + my $param = shift; Types::TypeTiny::TypeTiny->check($param) or _croak("Parameter to ScalarRef[`a] expected to be a type constraint; got $param"); @@ -140,7 +140,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/StrMatch.pm libtype-tiny-perl-1.004004/lib/Types/Standard/StrMatch.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/StrMatch.pm 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/StrMatch.pm 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,163 @@ +package Types::Standard::StrMatch; + +use 5.006001; +use strict; +use warnings; + +BEGIN { + $Types::Standard::StrMatch::AUTHORITY = 'cpan:TOBYINK'; + $Types::Standard::StrMatch::VERSION = '1.004004'; +} + +use Type::Tiny (); +use Types::Standard (); +use Types::TypeTiny (); + +sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } + +no warnings; + +our %expressions; +my $has_regexp_util; +my $serialize_regexp = sub { + $has_regexp_util = eval { + require Regexp::Util; + Regexp::Util->VERSION('0.003'); + 1; + } || 0 unless defined $has_regexp_util; + + my $re = shift; + my $serialized; + if ($has_regexp_util) { + $serialized = eval { Regexp::Util::serialize_regexp($re) }; + } + + if (!$serialized) { + my $key = sprintf('%s|%s', ref($re), $re); + $expressions{$key} = $re; + $serialized = sprintf('$Types::Standard::StrMatch::expressions{%s}', B::perlstring($key)); + } + + return $serialized; +}; + +sub __constraint_generator +{ + return Types::Standard->meta->get_type('StrMatch') unless @_; + + my ($regexp, $checker) = @_; + + Types::Standard::RegexpRef->check($regexp) + or _croak("First parameter to StrMatch[`a] expected to be a Regexp; got $regexp"); + + if (@_ > 1) + { + $checker = Types::TypeTiny::to_TypeTiny($checker); + Types::TypeTiny::TypeTiny->check($checker) + or _croak("Second parameter to StrMatch[`a] expected to be a type constraint; got $checker") + } + + $checker + ? sub { + my $value = shift; + return if ref($value); + my @m = ($value =~ $regexp); + $checker->check(\@m); + } + : sub { + my $value = shift; + !ref($value) and $value =~ $regexp; + } + ; +} + +sub __inline_generator +{ + require B; + my ($regexp, $checker) = @_; + if ($checker) + { + return unless $checker->can_be_inlined; + + my $serialized_re = $regexp->$serialize_regexp; + return sub + { + my $v = $_[1]; + sprintf + "!ref($v) and do { my \$m = [$v =~ %s]; %s }", + $serialized_re, + $checker->inline_check('$m'), + ; + }; + } + else + { + my $regexp_string = "$regexp"; + if ($regexp_string =~ /\A\(\?\^u?:\\A(\.+)\)\z/) { + my $length = length $1; + return sub { "!ref($_) and length($_)>=$length" }; + } + + if ($regexp_string =~ /\A\(\?\^u?:\\A(\.+)\\z\)\z/) { + my $length = length $1; + return sub { "!ref($_) and length($_)==$length" }; + } + + my $serialized_re = $regexp->$serialize_regexp; + return sub + { + my $v = $_[1]; + "!ref($v) and $v =~ $serialized_re"; + }; + } +} + +1; + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +Types::Standard::StrMatch - internals for the Types::Standard StrMatch type constraint + +=head1 STATUS + +This module is considered part of Type-Tiny's internals. It is not +covered by the +L. + +=head1 DESCRIPTION + +This file contains some of the guts for L. +It will be loaded on demand. You may ignore its presence. + +=head1 BUGS + +Please report any bugs to +L. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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. + diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/Tied.pm libtype-tiny-perl-1.004004/lib/Types/Standard/Tied.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/Tied.pm 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/Tied.pm 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,110 @@ +package Types::Standard::Tied; + +use 5.006001; +use strict; +use warnings; + +BEGIN { + $Types::Standard::Tied::AUTHORITY = 'cpan:TOBYINK'; + $Types::Standard::Tied::VERSION = '1.004004'; +} + +use Type::Tiny (); +use Types::Standard (); +use Types::TypeTiny (); + +sub _croak ($;@) { require Error::TypeTiny; goto \&Error::TypeTiny::croak } + +no warnings; + +sub __constraint_generator +{ + return Types::Standard->meta->get_type('Tied') unless @_; + + my $param = Types::TypeTiny::to_TypeTiny(shift); + unless (Types::TypeTiny::TypeTiny->check($param)) + { + Types::TypeTiny::StringLike->check($param) + or _croak("Parameter to Tied[`a] expected to be a class name; got $param"); + require Type::Tiny::Class; + $param = "Type::Tiny::Class"->new(class => "$param"); + } + + my $check = $param->compiled_check; + sub { + $check->(tied(Scalar::Util::reftype($_) eq 'HASH' ? %{$_} : Scalar::Util::reftype($_) eq 'ARRAY' ? @{$_} : ${$_})); + }; +} + +sub __inline_generator +{ + my $param = Types::TypeTiny::to_TypeTiny(shift); + unless (Types::TypeTiny::TypeTiny->check($param)) + { + Types::TypeTiny::StringLike->check($param) + or _croak("Parameter to Tied[`a] expected to be a class name; got $param"); + require Type::Tiny::Class; + $param = "Type::Tiny::Class"->new(class => "$param"); + } + return unless $param->can_be_inlined; + + sub { + require B; + my $var = $_[1]; + sprintf( + "%s and do { my \$TIED = tied(Scalar::Util::reftype($var) eq 'HASH' ? \%{$var} : Scalar::Util::reftype($var) eq 'ARRAY' ? \@{$var} : \${$var}); %s }", + Types::Standard::Ref()->inline_check($var), + $param->inline_check('$TIED') + ); + } +} + +1; + +__END__ + +=pod + +=encoding utf-8 + +=head1 NAME + +Types::Standard::Tied - internals for the Types::Standard Tied type constraint + +=head1 STATUS + +This module is considered part of Type-Tiny's internals. It is not +covered by the +L. + +=head1 DESCRIPTION + +This file contains some of the guts for L. +It will be loaded on demand. You may ignore its presence. + +=head1 BUGS + +Please report any bugs to +L. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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. + diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard/Tuple.pm libtype-tiny-perl-1.004004/lib/Types/Standard/Tuple.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard/Tuple.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard/Tuple.pm 2019-01-08 18:26:35.000000000 +0000 @@ -6,7 +6,7 @@ BEGIN { $Types::Standard::Tuple::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::Tuple::VERSION = '1.000005'; + $Types::Standard::Tuple::VERSION = '1.004004'; } use Type::Tiny (); @@ -25,12 +25,12 @@ my $slurpy; if (exists $constraints[-1] and ref $constraints[-1] eq "HASH") { - $slurpy = Types::TypeTiny::to_TypeTiny(pop(@constraints)->{slurpy}); + $slurpy = Types::TypeTiny::to_TypeTiny($constraints[-1]{slurpy}); Types::TypeTiny::TypeTiny->check($slurpy) or _croak("Slurpy parameter to Tuple[...] expected to be a type constraint; got $slurpy"); + pop(@constraints)->{slurpy} = $slurpy; # keep canonicalized version around } - @constraints = map Types::TypeTiny::to_TypeTiny($_), @constraints; for (@constraints) { Types::TypeTiny::TypeTiny->check($_) @@ -61,6 +61,10 @@ my $slurp_hash = $slurpy && $slurpy->is_a_type_of(Types::Standard::HashRef); my $slurp_any = $slurpy && $slurpy->equals(Types::Standard::Any); + my @sorted_is_optional = sort @is_optional; + join("|", @sorted_is_optional) eq join("|", @is_optional) + or _croak("Optional parameters to Tuple[...] cannot precede required parameters"); + sub { my $value = $_[0]; @@ -100,10 +104,10 @@ { $slurpy = pop(@constraints)->{slurpy}; } - + return if grep { not $_->can_be_inlined } @constraints; return if defined $slurpy && !$slurpy->can_be_inlined; - + if (Type::Tiny::_USE_XS and !$slurpy) { my @known = map { @@ -141,22 +145,32 @@ { my $v = $_[1]; join " and ", - "ref($v) eq 'ARRAY'", - "scalar(\@{$v}) >= $min", + Types::Standard::ArrayRef->inline_check($v), ( - $slurpy_any - ? () + (scalar @constraints == $min and not $slurpy) + ? "\@{$v} == $min" : ( - $slurpy - ? sprintf($tmpl, $v, $#constraints+1, $v, $slurpy->inline_check('$tmp')) - : sprintf("\@{$v} <= %d", scalar @constraints) + "\@{$v} >= $min", + ( + $slurpy_any + ? () + : ( + $slurpy + ? sprintf($tmpl, $v, $#constraints+1, $v, $slurpy->inline_check('$tmp')) + : sprintf("\@{$v} <= %d", scalar @constraints) + ) + ), ) ), map { my $inline = $constraints[$_]->inline_check("$v\->[$_]"); - $is_optional[$_] - ? sprintf('(@{%s} <= %d or %s)', $v, $_, $inline) - : $inline; + $inline eq '(!!1)' + ? () + : ( + $is_optional[$_] + ? sprintf('(@{%s} <= %d or %s)', $v, $_, $inline) + : $inline + ); } 0 .. $#constraints; }; } @@ -216,7 +230,6 @@ sub __coercion_generator { my ($parent, $child, @tuple) = @_; - my $C = "Type::Coercion"->new(type_constraint => $child); my $slurpy; if (exists $tuple[-1] and ref $tuple[-1] eq "HASH") @@ -224,14 +237,18 @@ $slurpy = pop(@tuple)->{slurpy}; } + my $child_coercions_exist = 0; my $all_inlinable = 1; for my $tc (@tuple, ($slurpy ? $slurpy : ())) { $all_inlinable = 0 if !$tc->can_be_inlined; $all_inlinable = 0 if $tc->has_coercion && !$tc->coercion->can_be_inlined; - last if!$all_inlinable; + $child_coercions_exist++ if $tc->has_coercion; } - + + return unless $child_coercions_exist; + my $C = "Type::Coercion"->new(type_constraint => $child); + if ($all_inlinable) { $C->add_type_coercions($parent => Types::Standard::Stringable { @@ -247,7 +264,7 @@ my $ct_optional = $ct->is_a_type_of(Types::Standard::Optional); push @code, sprintf( - 'if (@$orig > %d) { $tmp = %s; (%s) ? ($new[%d]=$tmp) : ($return_orig=1 and last %s) }', + 'if (@$orig > %d) { $tmp = %s; (%s) ? ($new[%d]=$tmp) : (($return_orig=1), last %s) }', $i, $ct_coerce ? $ct->coercion->inline_coercion("\$orig->[$i]") @@ -358,7 +375,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/Standard.pm libtype-tiny-perl-1.004004/lib/Types/Standard.pm --- libtype-tiny-perl-1.000005/lib/Types/Standard.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/Standard.pm 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ BEGIN { $Types::Standard::AUTHORITY = 'cpan:TOBYINK'; - $Types::Standard::VERSION = '1.000005'; + $Types::Standard::VERSION = '1.004004'; } use Type::Library -base; @@ -33,12 +33,21 @@ return !!1 if exists $stash->{'ISA'}; return !!1 if exists $stash->{'VERSION'}; foreach my $globref (values %$stash) { - return !!1 if *{$globref}{CODE}; + return !!1 + if ref \$globref eq 'GLOB' + ? *{$globref}{CODE} + : ref $globref; # const or sub ref } return !!0; }; }; +my $HAS_RUXS = eval { + require Ref::Util::XS; + Ref::Util::XS::->VERSION(0.100); + 1; +}; + my $add_core_type = sub { my $meta = shift; my ($typedef) = @_; @@ -56,7 +65,7 @@ $xsub = Type::Tiny::XS::get_coderef_for($name); $xsubname = Type::Tiny::XS::get_subname_for($name); } - + elsif ( Type::Tiny::_USE_MOUSE and not ($name eq 'RegexpRef' or $name eq 'Int' or $name eq 'Object') ) { require Mouse::Util::TypeConstraints; @@ -64,6 +73,13 @@ $xsubname = "Mouse::Util::TypeConstraints::$name" if $xsub; } + if (Type::Tiny::_USE_XS + and Type::Tiny::XS->VERSION < 0.014 + and $name eq 'Bool') { + # Broken implementation of Bool + $xsub = $xsubname = undef; + } + $typedef->{compiled_type_constraint} = $xsub if $xsub; $typedef->{inlined} = sub { "$xsubname\($_[1])" } @@ -101,6 +117,7 @@ bless +{ code => $_[0] }; } +my $subname; sub LazyLoad ($$) { package #private @@ -117,6 +134,22 @@ my $f = $type->{$key}[1]; $type->{$key} = $class->can("__$f"); } + my $mm = $type->{my_methods} || {}; + for my $key (keys %$mm) + { + $subname = + eval { require Sub::Util } ? \&Sub::Util::set_subname : + eval { require Sub::Name } ? \&Sub::Name::subname : + 0 + if not defined $subname; + next unless ref($mm->{$key}) eq __PACKAGE__; + my $f = $mm->{$key}[1]; + $mm->{$key} = $class->can("__$f"); + $subname and $subname->( + sprintf("%s::my_%s", $type->qualified_name, $key), + $mm->{$key}, + ); + } return $class->can("__$function"); }; bless \@_; @@ -137,13 +170,15 @@ parent => $_any, }); -$meta->$add_core_type({ +my $_bool = $meta->$add_core_type({ name => "Bool", parent => $_item, - constraint => sub { !defined $_ or $_ eq q() or $_ eq '0' or $_ eq '1' }, - inlined => sub { "!defined $_[1] or $_[1] eq q() or $_[1] eq '0' or $_[1] eq '1'" }, + constraint => sub { !ref $_ and (!defined $_ or $_ eq q() or $_ eq '0' or $_ eq '1') }, + inlined => sub { "!ref $_[1] and (!defined $_[1] or $_[1] eq q() or $_[1] eq '0' or $_[1] eq '1')" }, }); +$_bool->coercion->add_type_coercions($_any, q{!!$_}); + my $_undef = $meta->$add_core_type({ name => "Undef", parent => $_item, @@ -156,8 +191,12 @@ parent => $_item, constraint => sub { defined $_ }, inlined => sub { "defined($_[1])" }, + complementary_type => $_undef, }); +# hackish, but eh +Scalar::Util::weaken($_undef->{complementary_type} ||= $_def); + my $_val = $meta->$add_core_type({ name => "Value", parent => $_def, @@ -216,7 +255,7 @@ name => "Int", parent => $_num, constraint => sub { /\A-?[0-9]+\z/ }, - inlined => sub { "defined $_[1] and $_[1] =~ /\\A-?[0-9]+\\z/" }, + inlined => sub { "do { my \$tmp = $_[1]; defined(\$tmp) and !ref(\$tmp) and \$tmp =~ /\\A-?[0-9]+\\z/ }" }, }); my $_classn = $meta->add_type({ @@ -276,32 +315,36 @@ name => "CodeRef", parent => $_ref, constraint => sub { ref $_ eq "CODE" }, - inlined => sub { "ref($_[1]) eq 'CODE'" }, + inlined => $HAS_RUXS + ? sub { "Ref::Util::XS::is_plain_coderef($_[1])" } + : sub { "ref($_[1]) eq 'CODE'" }, }); -$meta->$add_core_type({ +my $_regexp = $meta->$add_core_type({ name => "RegexpRef", parent => $_ref, - constraint => sub { ref($_) && !!re::is_regexp($_) }, - inlined => sub { "ref($_[1]) && !!re::is_regexp($_[1])" }, + constraint => sub { ref($_) && !!re::is_regexp($_) or blessed($_) && $_->isa('Regexp') }, + inlined => sub { my $v = $_[1]; "ref($v) && !!re::is_regexp($v) or Scalar::Util::blessed($v) && $v\->isa('Regexp')" }, }); $meta->$add_core_type({ name => "GlobRef", parent => $_ref, constraint => sub { ref $_ eq "GLOB" }, - inlined => sub { "ref($_[1]) eq 'GLOB'" }, + inlined => $HAS_RUXS + ? sub { "Ref::Util::XS::is_plain_globref($_[1])" } + : sub { "ref($_[1]) eq 'GLOB'" }, }); $meta->$add_core_type({ name => "FileHandle", parent => $_ref, constraint => sub { - (ref($_) eq "GLOB" && Scalar::Util::openhandle($_)) + (ref($_) && Scalar::Util::openhandle($_)) or (blessed($_) && $_->isa("IO::Handle")) }, inlined => sub { - "(ref($_[1]) eq \"GLOB\" && Scalar::Util::openhandle($_[1])) ". + "(ref($_[1]) && Scalar::Util::openhandle($_[1])) ". "or (Scalar::Util::blessed($_[1]) && $_[1]\->isa(\"IO::Handle\"))" }, }); @@ -310,7 +353,9 @@ name => "ArrayRef", parent => $_ref, constraint => sub { ref $_ eq "ARRAY" }, - inlined => sub { "ref($_[1]) eq 'ARRAY'" }, + inlined => $HAS_RUXS + ? sub { "Ref::Util::XS::is_plain_arrayref($_[1])" } + : sub { "ref($_[1]) eq 'ARRAY'" }, constraint_generator => LazyLoad(ArrayRef => 'constraint_generator'), inline_generator => LazyLoad(ArrayRef => 'inline_generator'), deep_explanation => LazyLoad(ArrayRef => 'deep_explanation'), @@ -321,28 +366,16 @@ name => "HashRef", parent => $_ref, constraint => sub { ref $_ eq "HASH" }, - inlined => sub { "ref($_[1]) eq 'HASH'" }, + inlined => $HAS_RUXS + ? sub { "Ref::Util::XS::is_plain_hashref($_[1])" } + : sub { "ref($_[1]) eq 'HASH'" }, constraint_generator => LazyLoad(HashRef => 'constraint_generator'), inline_generator => LazyLoad(HashRef => 'inline_generator'), deep_explanation => LazyLoad(HashRef => 'deep_explanation'), coercion_generator => LazyLoad(HashRef => 'coercion_generator'), my_methods => { - hashref_allows_key => sub { - my $self = shift; - Str()->check($_[0]); - }, - hashref_allows_value => sub { - my $self = shift; - my ($key, $value) = @_; - - return !!0 unless $self->my_hashref_allows_key($key); - return !!1 if $self==HashRef(); - - my $href = $self->find_parent(sub { $_->has_parent && $_->parent==HashRef() }); - my $param = $href->type_parameter; - - Str()->check($key) and $param->check($value); - }, + hashref_allows_key => LazyLoad(HashRef => 'hashref_allows_key'), + hashref_allows_value => LazyLoad(HashRef => 'hashref_allows_value'), }, }); @@ -361,7 +394,9 @@ name => "Object", parent => $_ref, constraint => sub { blessed $_ }, - inlined => sub { "Scalar::Util::blessed($_[1])" }, + inlined => $HAS_RUXS + ? sub { "Ref::Util::XS::is_blessed_ref($_[1])" } + : sub { "Scalar::Util::blessed($_[1])" }, }); $meta->$add_core_type({ @@ -444,30 +479,8 @@ deep_explanation => LazyLoad(Map => 'deep_explanation'), coercion_generator => LazyLoad(Map => 'coercion_generator'), my_methods => { - hashref_allows_key => sub { - my $self = shift; - my ($key) = @_; - - return Str()->check($key) if $self==Map(); - - my $map = $self->find_parent(sub { $_->has_parent && $_->parent==Map() }); - my ($kcheck, $vcheck) = @{ $map->parameters }; - - ($kcheck or Any())->check($key); - }, - hashref_allows_value => sub { - my $self = shift; - my ($key, $value) = @_; - - return !!0 unless $self->my_hashref_allows_key($key); - return !!1 if $self==Map(); - - my $map = $self->find_parent(sub { $_->has_parent && $_->parent==Map() }); - my ($kcheck, $vcheck) = @{ $map->parameters }; - - ($kcheck or Any())->check($key) - and ($vcheck or Any())->check($value); - }, + hashref_allows_key => LazyLoad(Map => 'hashref_allows_key'), + hashref_allows_value => LazyLoad(Map => 'hashref_allows_value'), }, }); @@ -530,6 +543,20 @@ }); $meta->add_type({ + name => "CycleTuple", + parent => $_arr, + name_generator => sub + { + my ($s, @a) = @_; + sprintf('%s[%s]', $s, join q[,], @a); + }, + constraint_generator => LazyLoad(CycleTuple => 'constraint_generator'), + inline_generator => LazyLoad(CycleTuple => 'inline_generator'), + deep_explanation => LazyLoad(CycleTuple => 'deep_explanation'), + coercion_generator => LazyLoad(CycleTuple => 'coercion_generator'), +}); + +$meta->add_type({ name => "Dict", parent => $_hash, name_generator => sub @@ -544,80 +571,9 @@ deep_explanation => LazyLoad(Dict => 'deep_explanation'), coercion_generator => LazyLoad(Dict => 'coercion_generator'), my_methods => { - dict_is_slurpy => sub - { - my $self = shift; - - return !!0 if $self==Dict(); - - my $dict = $self->find_parent(sub { $_->has_parent && $_->parent==Dict() }); - ref($dict->parameters->[-1]) eq q(HASH) - ? $dict->parameters->[-1]{slurpy} - : !!0 - }, - hashref_allows_key => sub - { - my $self = shift; - my ($key) = @_; - - return Str()->check($key) if $self==Dict(); - - my $dict = $self->find_parent(sub { $_->has_parent && $_->parent==Dict() }); - my %params; - my $slurpy = $dict->my_dict_is_slurpy; - if ($slurpy) - { - my @args = @{$dict->parameters}; - pop @args; - %params = @args; - } - else - { - %params = @{ $dict->parameters } - } - - return !!1 - if exists($params{$key}); - return !!0 - if !$slurpy; - return Str()->check($key) - if $slurpy==Any() || $slurpy==Item() || $slurpy==Defined() || $slurpy==Ref(); - return $slurpy->my_hashref_allows_key($key) - if $slurpy->is_a_type_of(HashRef()); - return !!0; - }, - hashref_allows_value => sub - { - my $self = shift; - my ($key, $value) = @_; - - return !!0 unless $self->my_hashref_allows_key($key); - return !!1 if $self==Dict(); - - my $dict = $self->find_parent(sub { $_->has_parent && $_->parent==Dict() }); - my %params; - my $slurpy = $dict->my_dict_is_slurpy; - if ($slurpy) - { - my @args = @{$dict->parameters}; - pop @args; - %params = @args; - } - else - { - %params = @{ $dict->parameters } - } - - return !!1 - if exists($params{$key}) && $params{$key}->check($value); - return !!0 - if !$slurpy; - return !!1 - if $slurpy==Any() || $slurpy==Item() || $slurpy==Defined() || $slurpy==Ref(); - return $slurpy->my_hashref_allows_value($key, $value) - if $slurpy->is_a_type_of(HashRef()); - return !!0; - }, + dict_is_slurpy => LazyLoad(Dict => 'dict_is_slurpy'), + hashref_allows_key => LazyLoad(Dict => 'hashref_allows_key'), + hashref_allows_value => LazyLoad(Dict => 'hashref_allows_value'), }, }); @@ -656,70 +612,11 @@ }, }); -our %_StrMatch; $meta->add_type({ name => "StrMatch", parent => $_str, - constraint_generator => sub - { - return $meta->get_type('StrMatch') unless @_; - - my ($regexp, $checker) = @_; - - ref($regexp) eq 'Regexp' - or _croak("First parameter to StrMatch[`a] expected to be a Regexp; got $regexp"); - - if (@_ > 1) - { - $checker = Types::TypeTiny::to_TypeTiny($checker); - Types::TypeTiny::TypeTiny->check($checker) - or _croak("Second parameter to StrMatch[`a] expected to be a type constraint; got $checker") - } - - $checker - ? sub { - my $value = shift; - return if ref($value); - my @m = ($value =~ $regexp); - $checker->check(\@m); - } - : sub { - my $value = shift; - !ref($value) and $value =~ $regexp; - } - ; - }, - inline_generator => sub - { - require B; - my ($regexp, $checker) = @_; - my $regexp_string = "$regexp"; - $_StrMatch{$regexp_string} = $regexp; - if ($checker) - { - return unless $checker->can_be_inlined; - return sub - { - my $v = $_[1]; - sprintf - "!ref($v) and do { my \$m = [$v =~ \$Types::Standard::_StrMatch{%s}]; %s }", - B::perlstring($regexp_string), - $checker->inline_check('$m'), - ; - }; - } - else - { - return sub - { - my $v = $_[1]; - sprintf - "!ref($v) and $v =~ \$Types::Standard::_StrMatch{%s}", - B::perlstring($regexp_string), - ; - }; - } - }, + constraint_generator => LazyLoad(StrMatch => 'constraint_generator'), + inline_generator => LazyLoad(StrMatch => 'inline_generator'), }); $meta->add_type({ @@ -769,45 +666,8 @@ } return sprintf("%s[%s]", $self, $param); }, - constraint_generator => sub - { - return $meta->get_type('Tied') unless @_; - - my $param = Types::TypeTiny::to_TypeTiny(shift); - unless (Types::TypeTiny::TypeTiny->check($param)) - { - Types::TypeTiny::StringLike->check($param) - or _croak("Parameter to Tied[`a] expected to be a class name; got $param"); - require Type::Tiny::Class; - $param = "Type::Tiny::Class"->new(class => "$param"); - } - - my $check = $param->compiled_check; - return sub { - $check->(tied(Scalar::Util::reftype($_) eq 'HASH' ? %{$_} : Scalar::Util::reftype($_) eq 'ARRAY' ? @{$_} : ${$_})); - }; - }, - inline_generator => sub { - my $param = Types::TypeTiny::to_TypeTiny(shift); - unless (Types::TypeTiny::TypeTiny->check($param)) - { - Types::TypeTiny::StringLike->check($param) - or _croak("Parameter to Tied[`a] expected to be a class name; got $param"); - require Type::Tiny::Class; - $param = "Type::Tiny::Class"->new(class => "$param"); - } - return unless $param->can_be_inlined; - - return sub { - require B; - my $var = $_[1]; - sprintf( - "%s and do { my \$TIED = tied(Scalar::Util::reftype($var) eq 'HASH' ? \%{$var} : Scalar::Util::reftype($var) eq 'ARRAY' ? \@{$var} : \${$var}); %s }", - Ref()->inline_check($var), - $param->inline_check('$TIED') - ); - }; - }, + constraint_generator => LazyLoad(Tied => 'constraint_generator'), + inline_generator => LazyLoad(Tied => 'inline_generator'), }); $meta->add_type({ @@ -1061,7 +921,8 @@ =item C<< RegexpRef >> -A value where C<< ref($value) eq "Regexp" >>. +A reference where C<< re::is_regexp($value) >> is true, or +a blessed reference where C<< $value->isa("Regexp") >> is true. =item C<< GlobRef >> @@ -1093,14 +954,14 @@ =item C<< Tuple[...] >> -Subtype of C, accepting an list of type constraints for +Subtype of C, accepting a list of type constraints for each slot in the array. C<< Tuple[Int, HashRef] >> would match C<< [1, {}] >> but not C<< [{}, 1] >>. =item C<< Dict[...] >> -Subtype of C, accepting an list of type constraints for +Subtype of C, accepting a list of type constraints for each slot in the hash. For example C<< Dict[name => Str, id => Int] >> allows @@ -1151,7 +1012,13 @@ In either C or C, C<< slurpy Any >> can be used to indicate that additional values are acceptable, but should not be constrained in -any way. (C<< slurpy Any >> is an optimized code path.) +any way. + +C<< slurpy Any >> is an optimized code path. Although the following are +essentially equivalent checks, the former should run a lot faster: + + Tuple[Int, slurpy Any] + Tuple[Int, slurpy ArrayRef] =begin trustme @@ -1263,6 +1130,23 @@ ], ]; +Here's an example using L: + + package Local::Host { + use Moose; + use Regexp::Common; + has ip_address => ( + is => 'ro', + required => 1. + isa => StrMatch[/^$RE{net}{IPv4}$/], + default => '127.0.0.1', + ); + } + +On certain versions of Perl, type constraints of the forms +C<< StrMatch[qr/../ >> and C<< StrMatch[qr/\A..\z/ >> with any number +of intervening dots can be optimized to simple length checks. + =item C<< Enum[`a] >> As per MooX::Types::MooseLike::Base: @@ -1292,12 +1176,48 @@ use C unless you specifically need an attribute which will accept things like "Inf". +=item C<< CycleTuple[`a] >> + +Similar to Tuple, but cyclical. + + CycleTuple[Int, HashRef] + +will allow C<< [1,{}] >> and C<< [1,{},2,{}] >> but disallow +C<< [1,{},2] >> and C<< [1,{},2,[]] >>. + +I think you understand CycleTuples already. + +Currently C and C parameters are forbidden. There are +fairly limited use cases for them, and it's not exactly clear what they +should mean. + +The following is an efficient way of checking for an even-sized arrayref: + + CycleTuple[Any, Any] + +The following is an arrayref which would be suitable for coercing to a +hashref: + + CycleTuple[Str, Any] + +All the examples so far have used two parameters, but the following is +also a possible CycleTuple: + + CycleTuple[Str, Int, HashRef] + +This will be an arrayref where the 0th, 3rd, 6th, etc values are +strings, the 1st, 4th, 7th, etc values are integers, and the 2nd, +5th, 8th, etc values are hashrefs. + =back =head2 Coercions -None of the types in this type library have any coercions by default. -However some standalone coercions may be exported. These can be combined +Most of the types in this type library have no coercions by default. +The exception is C as of Types::Standard 1.003_003, which coerces +from C via C<< !!$_ >>. + +Some standalone coercions may be exported. These can be combined with type constraints using the C<< plus_coercions >> method. =over @@ -1354,6 +1274,28 @@ =back +=head2 Environment + +=over + +=item C + +Switches to more strict regexp-based number checking instead of using +C. + +=item C + +If set to false, can be used to suppress the loading of XS implementions of +some type constraints. + +=item C + +If C does not exist, can be set to true to suppress XS +usage similarly. (Several other CPAN distributions also pay attention to this +environment variable.) + +=back + =begin private =item Stringable @@ -1393,7 +1335,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/lib/Types/TypeTiny.pm libtype-tiny-perl-1.004004/lib/Types/TypeTiny.pm --- libtype-tiny-perl-1.000005/lib/Types/TypeTiny.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/lib/Types/TypeTiny.pm 2019-01-08 18:26:35.000000000 +0000 @@ -4,7 +4,7 @@ use warnings; our $AUTHORITY = 'cpan:TOBYINK'; -our $VERSION = '1.000005'; +our $VERSION = '1.004004'; use Scalar::Util qw< blessed refaddr weaken >; @@ -12,18 +12,24 @@ my %cache; +# This `import` method is designed to avoid loading Exporter::Tiny. +# This is so that if you stick to only using the purely OO parts of +# Type::Tiny, you can skip loading the exporter. +# sub import { - # do the shuffle! - no warnings "redefine"; - our @ISA = qw( Exporter::Tiny ); - require Exporter::Tiny; - my $next = \&Exporter::Tiny::import; - *import = $next; - my $class = shift; - my $opts = { ref($_[0]) ? %{+shift} : () }; - $opts->{into} ||= scalar(caller); - return $class->$next($opts, @_); + # If this sub succeeds, it will replace itself. + # uncoverable subroutine + return unless @_ > 1; # uncoverable statement + no warnings "redefine"; # uncoverable statement + our @ISA = qw( Exporter::Tiny ); # uncoverable statement + require Exporter::Tiny; # uncoverable statement + my $next = \&Exporter::Tiny::import; # uncoverable statement + *import = $next; # uncoverable statement + my $class = shift; # uncoverable statement + my $opts = { ref($_[0]) ? %{+shift} : () }; # uncoverable statement + $opts->{into} ||= scalar(caller); # uncoverable statement + return $class->$next($opts, @_); # uncoverable statement } sub meta @@ -170,7 +176,7 @@ $opts{display_name} = $t->name; $opts{constraint} = $t->constraint; $opts{parent} = to_TypeTiny($t->parent) if $t->has_parent; - $opts{inlined} = sub { shift; $t->_inline_check(@_) } if $t->can_be_inlined; + $opts{inlined} = sub { shift; $t->_inline_check(@_) } if $t->can("can_be_inlined") && $t->can_be_inlined; $opts{message} = sub { $t->get_message($_) } if $t->has_message; $opts{moose_type} = $t; @@ -441,7 +447,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/LICENSE libtype-tiny-perl-1.004004/LICENSE --- libtype-tiny-perl-1.000005/LICENSE 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/LICENSE 2019-01-08 18:26:35.000000000 +0000 @@ -1,4 +1,4 @@ -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2019 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. @@ -12,7 +12,7 @@ --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2014 by Toby Inkster. +This software is Copyright (c) 2019 by Toby Inkster. This is free software, licensed under: @@ -272,7 +272,7 @@ --- The Artistic License 1.0 --- -This software is Copyright (c) 2014 by Toby Inkster. +This software is Copyright (c) 2019 by Toby Inkster. This is free software, licensed under: diff -Nru libtype-tiny-perl-1.000005/Makefile.PL libtype-tiny-perl-1.004004/Makefile.PL --- libtype-tiny-perl-1.000005/Makefile.PL 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/Makefile.PL 2019-01-08 18:27:21.000000000 +0000 @@ -7,7 +7,7 @@ "abstract" => "tiny, yet Moo(se)-compatible type constraint", "author" => ["Toby Inkster (TOBYINK) "], "dynamic_config" => 1, - "generated_by" => "Dist::Inkt::Profile::TOBYINK version 0.023, CPAN::Meta::Converter version 2.142690", + "generated_by" => "Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010", "keywords" => [ "Argument Checking", "Argument Validation", @@ -38,15 +38,17 @@ runtime => { conflicts => { "Kavorka" => "<= 0.013", "Types::ReadOnly" => "<= 0.001" }, recommends => { - "Devel::LexAlias" => 0.05, + "Devel::LexAlias" => 0.05, "Devel::StackTrace" => 0, - "perl" => 5.010001, - "Sub::Name" => 0, - "Type::Tie" => 0, - "Type::Tiny::XS" => "0.010", + "perl" => 5.010001, + "Ref::Util::XS" => "0.100", + "Regexp::Util" => 0.003, + "Sub::Util" => 0, + "Type::Tie" => 0, + "Type::Tiny::XS" => 0.011, }, - requires => { "Exporter::Tiny" => 0.026, "perl" => 5.006001 }, - suggests => { Moo => "1.000000", Moose => "2.0400", Mouse => "1.00", Reply => 0 }, + requires => { "Exporter::Tiny" => "0.040", "perl" => 5.006001 }, + suggests => { Moo => "1.006000", Moose => "2.0000", Mouse => "1.00", Reply => 0 }, }, test => { recommends => { "Test::Tester" => 0.109, "Test::Warnings" => 0 }, @@ -54,43 +56,46 @@ }, }, "provides" => { - "Devel::TypeTiny::Perl56Compat" => { file => "lib/Devel/TypeTiny/Perl56Compat.pm", version => 1.000005 }, - "Devel::TypeTiny::Perl58Compat" => { file => "lib/Devel/TypeTiny/Perl58Compat.pm", version => 1.000005 }, - "Error::TypeTiny" => { file => "lib/Error/TypeTiny.pm", version => 1.000005 }, - "Error::TypeTiny::Assertion" => { file => "lib/Error/TypeTiny/Assertion.pm", version => 1.000005 }, - "Error::TypeTiny::Compilation" => { file => "lib/Error/TypeTiny/Compilation.pm", version => 1.000005 }, + "Devel::TypeTiny::Perl56Compat" => { file => "lib/Devel/TypeTiny/Perl56Compat.pm", version => 1.004004 }, + "Devel::TypeTiny::Perl58Compat" => { file => "lib/Devel/TypeTiny/Perl58Compat.pm", version => 1.004004 }, + "Error::TypeTiny" => { file => "lib/Error/TypeTiny.pm", version => 1.004004 }, + "Error::TypeTiny::Assertion" => { file => "lib/Error/TypeTiny/Assertion.pm", version => 1.004004 }, + "Error::TypeTiny::Compilation" => { file => "lib/Error/TypeTiny/Compilation.pm", version => 1.004004 }, "Error::TypeTiny::WrongNumberOfParameters" => { file => "lib/Error/TypeTiny/WrongNumberOfParameters.pm", - version => 1.000005, + version => 1.004004, }, - "Eval::TypeTiny" => { file => "lib/Eval/TypeTiny.pm", version => 1.000005 }, - "Reply::Plugin::TypeTiny" => { file => "lib/Reply/Plugin/TypeTiny.pm", version => 1.000005 }, - "Test::TypeTiny" => { file => "lib/Test/TypeTiny.pm", version => 1.000005 }, - "Type::Coercion" => { file => "lib/Type/Coercion.pm", version => 1.000005 }, - "Type::Coercion::FromMoose" => { file => "lib/Type/Coercion/FromMoose.pm", version => 1.000005 }, - "Type::Coercion::Union" => { file => "lib/Type/Coercion/Union.pm", version => 1.000005 }, - "Type::Library" => { file => "lib/Type/Library.pm", version => 1.000005 }, - "Type::Params" => { file => "lib/Type/Params.pm", version => 1.000005 }, - "Type::Parser" => { file => "lib/Type/Parser.pm", version => 1.000005 }, - "Type::Registry" => { file => "lib/Type/Registry.pm", version => 1.000005 }, - "Type::Tiny" => { file => "lib/Type/Tiny.pm", version => 1.000005 }, - "Type::Tiny::Class" => { file => "lib/Type/Tiny/Class.pm", version => 1.000005 }, - "Type::Tiny::Duck" => { file => "lib/Type/Tiny/Duck.pm", version => 1.000005 }, - "Type::Tiny::Enum" => { file => "lib/Type/Tiny/Enum.pm", version => 1.000005 }, - "Type::Tiny::Intersection" => { file => "lib/Type/Tiny/Intersection.pm", version => 1.000005 }, - "Type::Tiny::Role" => { file => "lib/Type/Tiny/Role.pm", version => 1.000005 }, - "Type::Tiny::Union" => { file => "lib/Type/Tiny/Union.pm", version => 1.000005 }, - "Type::Utils" => { file => "lib/Type/Utils.pm", version => 1.000005 }, - "Types::Common::Numeric" => { file => "lib/Types/Common/Numeric.pm", version => 1.000005 }, - "Types::Common::String" => { file => "lib/Types/Common/String.pm", version => 1.000005 }, - "Types::Standard" => { file => "lib/Types/Standard.pm", version => 1.000005 }, - "Types::Standard::ArrayRef" => { file => "lib/Types/Standard/ArrayRef.pm", version => 1.000005 }, - "Types::Standard::Dict" => { file => "lib/Types/Standard/Dict.pm", version => 1.000005 }, - "Types::Standard::HashRef" => { file => "lib/Types/Standard/HashRef.pm", version => 1.000005 }, - "Types::Standard::Map" => { file => "lib/Types/Standard/Map.pm", version => 1.000005 }, - "Types::Standard::ScalarRef" => { file => "lib/Types/Standard/ScalarRef.pm", version => 1.000005 }, - "Types::Standard::Tuple" => { file => "lib/Types/Standard/Tuple.pm", version => 1.000005 }, - "Types::TypeTiny" => { file => "lib/Types/TypeTiny.pm", version => 1.000005 }, + "Eval::TypeTiny" => { file => "lib/Eval/TypeTiny.pm", version => 1.004004 }, + "Reply::Plugin::TypeTiny" => { file => "lib/Reply/Plugin/TypeTiny.pm", version => 1.004004 }, + "Test::TypeTiny" => { file => "lib/Test/TypeTiny.pm", version => 1.004004 }, + "Type::Coercion" => { file => "lib/Type/Coercion.pm", version => 1.004004 }, + "Type::Coercion::FromMoose" => { file => "lib/Type/Coercion/FromMoose.pm", version => 1.004004 }, + "Type::Coercion::Union" => { file => "lib/Type/Coercion/Union.pm", version => 1.004004 }, + "Type::Library" => { file => "lib/Type/Library.pm", version => 1.004004 }, + "Type::Params" => { file => "lib/Type/Params.pm", version => 1.004004 }, + "Type::Parser" => { file => "lib/Type/Parser.pm", version => 1.004004 }, + "Type::Registry" => { file => "lib/Type/Registry.pm", version => 1.004004 }, + "Type::Tiny" => { file => "lib/Type/Tiny.pm", version => 1.004004 }, + "Type::Tiny::Class" => { file => "lib/Type/Tiny/Class.pm", version => 1.004004 }, + "Type::Tiny::Duck" => { file => "lib/Type/Tiny/Duck.pm", version => 1.004004 }, + "Type::Tiny::Enum" => { file => "lib/Type/Tiny/Enum.pm", version => 1.004004 }, + "Type::Tiny::Intersection" => { file => "lib/Type/Tiny/Intersection.pm", version => 1.004004 }, + "Type::Tiny::Role" => { file => "lib/Type/Tiny/Role.pm", version => 1.004004 }, + "Type::Tiny::Union" => { file => "lib/Type/Tiny/Union.pm", version => 1.004004 }, + "Type::Utils" => { file => "lib/Type/Utils.pm", version => 1.004004 }, + "Types::Common::Numeric" => { file => "lib/Types/Common/Numeric.pm", version => 1.004004 }, + "Types::Common::String" => { file => "lib/Types/Common/String.pm", version => 1.004004 }, + "Types::Standard" => { file => "lib/Types/Standard.pm", version => 1.004004 }, + "Types::Standard::ArrayRef" => { file => "lib/Types/Standard/ArrayRef.pm", version => 1.004004 }, + "Types::Standard::CycleTuple" => { file => "lib/Types/Standard/CycleTuple.pm", version => 1.004004 }, + "Types::Standard::Dict" => { file => "lib/Types/Standard/Dict.pm", version => 1.004004 }, + "Types::Standard::HashRef" => { file => "lib/Types/Standard/HashRef.pm", version => 1.004004 }, + "Types::Standard::Map" => { file => "lib/Types/Standard/Map.pm", version => 1.004004 }, + "Types::Standard::ScalarRef" => { file => "lib/Types/Standard/ScalarRef.pm", version => 1.004004 }, + "Types::Standard::StrMatch" => { file => "lib/Types/Standard/StrMatch.pm", version => 1.004004 }, + "Types::Standard::Tied" => { file => "lib/Types/Standard/Tied.pm", version => 1.004004 }, + "Types::Standard::Tuple" => { file => "lib/Types/Standard/Tuple.pm", version => 1.004004 }, + "Types::TypeTiny" => { file => "lib/Types/TypeTiny.pm", version => 1.004004 }, }, "release_status" => "stable", "resources" => { @@ -103,8 +108,9 @@ web => "https://github.com/tobyink/p5-type-tiny", }, x_identifier => "http://purl.org/NET/cpan-uri/dist/Type-Tiny/project", + x_IRC => "irc://irc.perl.org/#moops", }, - "version" => 1.000005, + "version" => 1.004004, "x_breaks" => { "Kavorka" => "<= 0.013", "Types::ReadOnly" => "<= 0.001" }, "x_contributors" => [ "Diab Jerius (DJERIUS) ", @@ -119,6 +125,16 @@ "Alexander Hartmaier (ABRAXXA) ", "Dagfinn Ilmari Manns\xE5ker (ILMARI) ", "Gianni Ceccarelli (DAKKAR) ", + "Karen Etheridge (ETHER) ", + "Thomas Sibley (TSIBLEY) ", + "Peter Valdemar M\xF8rch ", + "Zoffix Znet ", + "Denis Ibaev ", + "Lucas Buchala ", + "Alexandr Ciornii ", + "Philippe Bruhat (BOOK) ", + "Robert Rothenberg (RRWO) ", + "Nelo Onyiah", ], }; diff -Nru libtype-tiny-perl-1.000005/MANIFEST libtype-tiny-perl-1.004004/MANIFEST --- libtype-tiny-perl-1.000005/MANIFEST 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/MANIFEST 2019-01-08 18:27:21.000000000 +0000 @@ -1,3 +1,4 @@ +CONTRIBUTING.pod COPYRIGHT CREDITS Changes @@ -13,11 +14,14 @@ TODO dist.ini doap.ttl -examples/benchmark-coercions.pl -examples/benchmark-constraints.pl -examples/benchmark-param-validation.pl +examples/benchmarking/benchmark-coercions.pl +examples/benchmarking/benchmark-constraints.pl +examples/benchmarking/benchmark-named-param-validation.pl +examples/benchmarking/benchmark-param-validation.pl +examples/benchmarking/versus-scalar-validation.pl examples/datetime-coercions.pl -examples/versus-scalar-validation.pl +examples/nonempty.pl +examples/page-numbers.pl inc/Test/Fatal.pm inc/Test/Requires.pm inc/Try/Tiny.pm @@ -60,10 +64,13 @@ lib/Types/Common/String.pm lib/Types/Standard.pm lib/Types/Standard/ArrayRef.pm +lib/Types/Standard/CycleTuple.pm lib/Types/Standard/Dict.pm lib/Types/Standard/HashRef.pm lib/Types/Standard/Map.pm lib/Types/Standard/ScalarRef.pm +lib/Types/Standard/StrMatch.pm +lib/Types/Standard/Tied.pm lib/Types/Standard/Tuple.pm lib/Types/TypeTiny.pm t/00-begin.t @@ -77,8 +84,11 @@ t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t t/20-unit/Error-TypeTiny/basic.t t/20-unit/Error-TypeTiny/stacktrace.t +t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t +t/20-unit/Eval-TypeTiny/aliases-native.t +t/20-unit/Eval-TypeTiny/aliases-padwalker.t +t/20-unit/Eval-TypeTiny/aliases-tie.t t/20-unit/Eval-TypeTiny/basic.t -t/20-unit/Eval-TypeTiny/fallback-aliases.t t/20-unit/Eval-TypeTiny/lexical-subs.t t/20-unit/Test-TypeTiny/basic.t t/20-unit/Test-TypeTiny/extended.t @@ -94,6 +104,7 @@ t/20-unit/Type-Coercion/smartmatch.t t/20-unit/Type-Coercion/typetiny-constructor.t t/20-unit/Type-Library/assert.t +t/20-unit/Type-Library/deprecation.t t/20-unit/Type-Library/errors.t t/20-unit/Type-Library/inheritance.t t/20-unit/Type-Library/is.t @@ -102,6 +113,11 @@ t/20-unit/Type-Params/badsigs.t t/20-unit/Type-Params/carping.t t/20-unit/Type-Params/coerce.t +t/20-unit/Type-Params/compile-named-bless.t +t/20-unit/Type-Params/compile-named-oo.t +t/20-unit/Type-Params/compile-named.t +t/20-unit/Type-Params/defaults.t +t/20-unit/Type-Params/hashorder.t t/20-unit/Type-Params/methods.t t/20-unit/Type-Params/mixednamed.t t/20-unit/Type-Params/multisig.t @@ -130,10 +146,14 @@ t/20-unit/Type-Tiny-Role/errors.t t/20-unit/Type-Tiny-Union/basic.t t/20-unit/Type-Tiny-Union/errors.t +t/20-unit/Type-Tiny-Union/relationships.t +t/20-unit/Type-Tiny-_HalfOp/double-union.t t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t t/20-unit/Type-Tiny/arithmetic.t t/20-unit/Type-Tiny/basic.t t/20-unit/Type-Tiny/coercion-modifiers.t +t/20-unit/Type-Tiny/constraint-strings.t +t/20-unit/Type-Tiny/deprecation.t t/20-unit/Type-Tiny/esoteric.t t/20-unit/Type-Tiny/my-methods.t t/20-unit/Type-Tiny/parameterization.t @@ -149,11 +169,15 @@ t/20-unit/Type-Utils/match-on-type.t t/20-unit/Type-Utils/warnings.t t/20-unit/Types-Common-Numeric/basic.t +t/20-unit/Types-Common-Numeric/ranges.t t/20-unit/Types-Common-String/basic.t t/20-unit/Types-Common-String/coerce.t +t/20-unit/Types-Common-String/strlength.t t/20-unit/Types-Common-String/unicode.t t/20-unit/Types-Standard/basic.t +t/20-unit/Types-Standard/cycletuple.t t/20-unit/Types-Standard/deep-coercions.t +t/20-unit/Types-Standard/filehandle.t t/20-unit/Types-Standard/lockdown.t t/20-unit/Types-Standard/mxtmlb-alike.t t/20-unit/Types-Standard/optlist.t @@ -164,11 +188,14 @@ t/20-unit/Types-TypeTiny/basic.t t/20-unit/Types-TypeTiny/coercion.t t/20-unit/Types-TypeTiny/meta.t +t/20-unit/Types-TypeTiny/moosemouse.t +t/20-unit/Types-TypeTiny/progressiveexporter.t t/30-integration/Class-InsideOut/basic.t t/30-integration/Exporter-Tiny/basic.t t/30-integration/Exporter-Tiny/installer.t t/30-integration/Exporter-Tiny/role-conflict.t t/30-integration/Function-Parameters/basic.t +t/30-integration/Kavorka/80returntype.t t/30-integration/Kavorka/basic.t t/30-integration/Moo/basic.t t/30-integration/Moo/coercion-inlining-avoidance.t @@ -180,6 +207,7 @@ t/30-integration/Moops/library-keyword.t t/30-integration/Moose/accept-moose-types.t t/30-integration/Moose/basic.t +t/30-integration/Moose/coercion-more.t t/30-integration/Moose/coercion.t t/30-integration/Moose/inflate-then-inline.t t/30-integration/Moose/native-attribute-traits.t @@ -194,6 +222,7 @@ t/30-integration/Object-Accessor/basic.t t/30-integration/Return-Type/basic.t t/30-integration/Sub-Quote/basic.t +t/30-integration/Sub-Quote/delayed-quoting.t t/30-integration/Sub-Quote/unquote-coercions.t t/30-integration/Sub-Quote/unquote-constraints.t t/30-integration/Switcheroo/basic.t @@ -204,6 +233,9 @@ t/40-regression/73f51e2d.pl t/40-regression/73f51e2d.t t/40-regression/gh1.t +t/40-regression/gh14.t +t/40-regression/rt125132.t +t/40-regression/rt125765.t t/40-regression/rt85911.t t/40-regression/rt86004.t t/40-regression/rt86233.t diff -Nru libtype-tiny-perl-1.000005/META.json libtype-tiny-perl-1.004004/META.json --- libtype-tiny-perl-1.000005/META.json 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/META.json 2019-01-08 18:27:21.000000000 +0000 @@ -4,7 +4,7 @@ "Toby Inkster (TOBYINK) " ], "dynamic_config" : 1, - "generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.023, CPAN::Meta::Converter version 2.142690", + "generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010", "keywords" : [ "Argument Checking", "Argument Validation", @@ -59,18 +59,20 @@ "recommends" : { "Devel::LexAlias" : "0.05", "Devel::StackTrace" : "0", - "Sub::Name" : "0", + "Ref::Util::XS" : "0.100", + "Regexp::Util" : "0.003", + "Sub::Util" : "0", "Type::Tie" : "0", - "Type::Tiny::XS" : "0.010", + "Type::Tiny::XS" : "0.011", "perl" : "5.010001" }, "requires" : { - "Exporter::Tiny" : "0.026", + "Exporter::Tiny" : "0.040", "perl" : "5.006001" }, "suggests" : { - "Moo" : "1.000000", - "Moose" : "2.0400", + "Moo" : "1.006000", + "Moose" : "2.0000", "Mouse" : "1.00", "Reply" : "0" } @@ -88,139 +90,151 @@ "provides" : { "Devel::TypeTiny::Perl56Compat" : { "file" : "lib/Devel/TypeTiny/Perl56Compat.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Devel::TypeTiny::Perl58Compat" : { "file" : "lib/Devel/TypeTiny/Perl58Compat.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Error::TypeTiny" : { "file" : "lib/Error/TypeTiny.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Error::TypeTiny::Assertion" : { "file" : "lib/Error/TypeTiny/Assertion.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Error::TypeTiny::Compilation" : { "file" : "lib/Error/TypeTiny/Compilation.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Error::TypeTiny::WrongNumberOfParameters" : { "file" : "lib/Error/TypeTiny/WrongNumberOfParameters.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Eval::TypeTiny" : { "file" : "lib/Eval/TypeTiny.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Reply::Plugin::TypeTiny" : { "file" : "lib/Reply/Plugin/TypeTiny.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Test::TypeTiny" : { "file" : "lib/Test/TypeTiny.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Coercion" : { "file" : "lib/Type/Coercion.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Coercion::FromMoose" : { "file" : "lib/Type/Coercion/FromMoose.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Coercion::Union" : { "file" : "lib/Type/Coercion/Union.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Library" : { "file" : "lib/Type/Library.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Params" : { "file" : "lib/Type/Params.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Parser" : { "file" : "lib/Type/Parser.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Registry" : { "file" : "lib/Type/Registry.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny" : { "file" : "lib/Type/Tiny.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny::Class" : { "file" : "lib/Type/Tiny/Class.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny::Duck" : { "file" : "lib/Type/Tiny/Duck.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny::Enum" : { "file" : "lib/Type/Tiny/Enum.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny::Intersection" : { "file" : "lib/Type/Tiny/Intersection.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny::Role" : { "file" : "lib/Type/Tiny/Role.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Tiny::Union" : { "file" : "lib/Type/Tiny/Union.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Type::Utils" : { "file" : "lib/Type/Utils.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Common::Numeric" : { "file" : "lib/Types/Common/Numeric.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Common::String" : { "file" : "lib/Types/Common/String.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Standard" : { "file" : "lib/Types/Standard.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Standard::ArrayRef" : { "file" : "lib/Types/Standard/ArrayRef.pm", - "version" : "1.000005" + "version" : "1.004004" + }, + "Types::Standard::CycleTuple" : { + "file" : "lib/Types/Standard/CycleTuple.pm", + "version" : "1.004004" }, "Types::Standard::Dict" : { "file" : "lib/Types/Standard/Dict.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Standard::HashRef" : { "file" : "lib/Types/Standard/HashRef.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Standard::Map" : { "file" : "lib/Types/Standard/Map.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::Standard::ScalarRef" : { "file" : "lib/Types/Standard/ScalarRef.pm", - "version" : "1.000005" + "version" : "1.004004" + }, + "Types::Standard::StrMatch" : { + "file" : "lib/Types/Standard/StrMatch.pm", + "version" : "1.004004" + }, + "Types::Standard::Tied" : { + "file" : "lib/Types/Standard/Tied.pm", + "version" : "1.004004" }, "Types::Standard::Tuple" : { "file" : "lib/Types/Standard/Tuple.pm", - "version" : "1.000005" + "version" : "1.004004" }, "Types::TypeTiny" : { "file" : "lib/Types/TypeTiny.pm", - "version" : "1.000005" + "version" : "1.004004" } }, "release_status" : "stable", @@ -237,9 +251,10 @@ "url" : "git://github.com/tobyink/p5-type-tiny.git", "web" : "https://github.com/tobyink/p5-type-tiny" }, + "x_IRC" : "irc://irc.perl.org/#moops", "x_identifier" : "http://purl.org/NET/cpan-uri/dist/Type-Tiny/project" }, - "version" : "1.000005", + "version" : "1.004004", "x_breaks" : { "Kavorka" : "<= 0.013", "Types::ReadOnly" : "<= 0.001" @@ -256,6 +271,17 @@ "Peter Karman (KARMAN) ", "Alexander Hartmaier (ABRAXXA) ", "Dagfinn Ilmari Mannsåker (ILMARI) ", - "Gianni Ceccarelli (DAKKAR) " - ] + "Gianni Ceccarelli (DAKKAR) ", + "Karen Etheridge (ETHER) ", + "Thomas Sibley (TSIBLEY) ", + "Peter Valdemar Mørch ", + "Zoffix Znet ", + "Denis Ibaev ", + "Lucas Buchala ", + "Alexandr Ciornii ", + "Philippe Bruhat (BOOK) ", + "Robert Rothenberg (RRWO) ", + "Nelo Onyiah" + ], + "x_serialization_backend" : "JSON::PP version 2.27400_02" } diff -Nru libtype-tiny-perl-1.000005/META.yml libtype-tiny-perl-1.004004/META.yml --- libtype-tiny-perl-1.000005/META.yml 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/META.yml 2019-01-08 18:27:21.000000000 +0000 @@ -10,7 +10,7 @@ Kavorka: '<= 0.013' Types::ReadOnly: '<= 0.001' dynamic_config: 1 -generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.023, CPAN::Meta::Converter version 2.142690' +generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.024, CPAN::Meta::Converter version 2.150010' keywords: - 'Argument Checking' - 'Argument Validation' @@ -40,123 +40,135 @@ provides: Devel::TypeTiny::Perl56Compat: file: lib/Devel/TypeTiny/Perl56Compat.pm - version: '1.000005' + version: '1.004004' Devel::TypeTiny::Perl58Compat: file: lib/Devel/TypeTiny/Perl58Compat.pm - version: '1.000005' + version: '1.004004' Error::TypeTiny: file: lib/Error/TypeTiny.pm - version: '1.000005' + version: '1.004004' Error::TypeTiny::Assertion: file: lib/Error/TypeTiny/Assertion.pm - version: '1.000005' + version: '1.004004' Error::TypeTiny::Compilation: file: lib/Error/TypeTiny/Compilation.pm - version: '1.000005' + version: '1.004004' Error::TypeTiny::WrongNumberOfParameters: file: lib/Error/TypeTiny/WrongNumberOfParameters.pm - version: '1.000005' + version: '1.004004' Eval::TypeTiny: file: lib/Eval/TypeTiny.pm - version: '1.000005' + version: '1.004004' Reply::Plugin::TypeTiny: file: lib/Reply/Plugin/TypeTiny.pm - version: '1.000005' + version: '1.004004' Test::TypeTiny: file: lib/Test/TypeTiny.pm - version: '1.000005' + version: '1.004004' Type::Coercion: file: lib/Type/Coercion.pm - version: '1.000005' + version: '1.004004' Type::Coercion::FromMoose: file: lib/Type/Coercion/FromMoose.pm - version: '1.000005' + version: '1.004004' Type::Coercion::Union: file: lib/Type/Coercion/Union.pm - version: '1.000005' + version: '1.004004' Type::Library: file: lib/Type/Library.pm - version: '1.000005' + version: '1.004004' Type::Params: file: lib/Type/Params.pm - version: '1.000005' + version: '1.004004' Type::Parser: file: lib/Type/Parser.pm - version: '1.000005' + version: '1.004004' Type::Registry: file: lib/Type/Registry.pm - version: '1.000005' + version: '1.004004' Type::Tiny: file: lib/Type/Tiny.pm - version: '1.000005' + version: '1.004004' Type::Tiny::Class: file: lib/Type/Tiny/Class.pm - version: '1.000005' + version: '1.004004' Type::Tiny::Duck: file: lib/Type/Tiny/Duck.pm - version: '1.000005' + version: '1.004004' Type::Tiny::Enum: file: lib/Type/Tiny/Enum.pm - version: '1.000005' + version: '1.004004' Type::Tiny::Intersection: file: lib/Type/Tiny/Intersection.pm - version: '1.000005' + version: '1.004004' Type::Tiny::Role: file: lib/Type/Tiny/Role.pm - version: '1.000005' + version: '1.004004' Type::Tiny::Union: file: lib/Type/Tiny/Union.pm - version: '1.000005' + version: '1.004004' Type::Utils: file: lib/Type/Utils.pm - version: '1.000005' + version: '1.004004' Types::Common::Numeric: file: lib/Types/Common/Numeric.pm - version: '1.000005' + version: '1.004004' Types::Common::String: file: lib/Types/Common/String.pm - version: '1.000005' + version: '1.004004' Types::Standard: file: lib/Types/Standard.pm - version: '1.000005' + version: '1.004004' Types::Standard::ArrayRef: file: lib/Types/Standard/ArrayRef.pm - version: '1.000005' + version: '1.004004' + Types::Standard::CycleTuple: + file: lib/Types/Standard/CycleTuple.pm + version: '1.004004' Types::Standard::Dict: file: lib/Types/Standard/Dict.pm - version: '1.000005' + version: '1.004004' Types::Standard::HashRef: file: lib/Types/Standard/HashRef.pm - version: '1.000005' + version: '1.004004' Types::Standard::Map: file: lib/Types/Standard/Map.pm - version: '1.000005' + version: '1.004004' Types::Standard::ScalarRef: file: lib/Types/Standard/ScalarRef.pm - version: '1.000005' + version: '1.004004' + Types::Standard::StrMatch: + file: lib/Types/Standard/StrMatch.pm + version: '1.004004' + Types::Standard::Tied: + file: lib/Types/Standard/Tied.pm + version: '1.004004' Types::Standard::Tuple: file: lib/Types/Standard/Tuple.pm - version: '1.000005' + version: '1.004004' Types::TypeTiny: file: lib/Types/TypeTiny.pm - version: '1.000005' + version: '1.004004' recommends: Devel::LexAlias: '0.05' Devel::StackTrace: '0' - Sub::Name: '0' + Ref::Util::XS: '0.100' + Regexp::Util: '0.003' + Sub::Util: '0' Type::Tie: '0' - Type::Tiny::XS: '0.010' + Type::Tiny::XS: '0.011' perl: '5.010001' requires: - Exporter::Tiny: '0.026' + Exporter::Tiny: '0.040' perl: '5.006001' resources: + IRC: irc://irc.perl.org/#moops Identifier: http://purl.org/NET/cpan-uri/dist/Type-Tiny/project bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=Type-Tiny homepage: https://metacpan.org/release/Type-Tiny license: http://dev.perl.org/licenses/ repository: git://github.com/tobyink/p5-type-tiny.git -version: '1.000005' +version: '1.004004' x_breaks: Kavorka: '<= 0.013' Types::ReadOnly: '<= 0.001' @@ -173,3 +185,14 @@ - 'Alexander Hartmaier (ABRAXXA) ' - 'Dagfinn Ilmari Mannsåker (ILMARI) ' - 'Gianni Ceccarelli (DAKKAR) ' + - 'Karen Etheridge (ETHER) ' + - 'Thomas Sibley (TSIBLEY) ' + - 'Peter Valdemar Mørch ' + - 'Zoffix Znet ' + - 'Denis Ibaev ' + - 'Lucas Buchala ' + - 'Alexandr Ciornii ' + - 'Philippe Bruhat (BOOK) ' + - 'Robert Rothenberg (RRWO) ' + - 'Nelo Onyiah' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libtype-tiny-perl-1.000005/NEWS libtype-tiny-perl-1.004004/NEWS --- libtype-tiny-perl-1.000005/NEWS 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/NEWS 2019-01-08 18:26:35.000000000 +0000 @@ -4,28 +4,6 @@ changes in development releases, see the "Changes" file instead. ======================================================================= -2014-03-17 Type-Tiny version 0.040 released! - - - Deprecated module Exporter::TypeTiny is now gone. - - Restructure and expand test suite. - - Coercion bugfixes. - - Improvements to overloaded operations on parameterized types. - - Fix problems with threaded Perl 5.18.x. - -2014-04-02 Type-Tiny version 0.042 released! - - - One year since Type-Tiny 0.000_01 was uploaded to CPAN. - - No more overloaded addition operator on Type::Tiny/Type::Coercion. - -2014-06-03 Type-Tiny version 0.044 released! - - - Lots of bugfixes, tests, and documentation improvements. - -2014-07-18 Type-Tiny version 0.046 released! - - - Support for Type::Tiny::XS. - - Test case improvements. - 2014-08-16 Type-Tiny version 1.000000 released! - Enhanced support for Type::Tiny::XS. @@ -35,3 +13,30 @@ - Better behaviour of non-frozen coercions. (For example, they are no longer considered to be inlineable.) - Better integration between Type::Library and Type::Registry. + +2017-06-01 Type-Tiny version 1.002000 released! + + - Type::Params now has `compile_named` and `validate_named`. + - Type::Tiny's `constraint` parameter may be a string of code. + - Types::Standard::CycleTuple added. + - Types::Standard::RegexpRef now accepts blessed objects where + $object->isa('Regexp'). This plays better with re::engine::* + pragmas. + - Fixed bug where Types::Standard::Int would *sometimes* accept + an overloaded object. (It never should.) + - Various performance enhancements and bug fixes. + +2018-07-27 Type-Tiny version 1.004000 released! + + - Types::Standard::FileHandle has a looser definition, more consistent with + Mouse and Type::Tiny::XS. + - Types::Standard::Bool has a stricter definition, but also has a built-in + coercion from a very loose definition. + - Type::Params now has `compile_named_oo`. + - Type::Params supports defaults for missing parameters. + - Types::Common::Numeric includes IntRange and NumRange. + - Types::Common::String includes StrLength. + - Type::Tiny now allows types to be marked as deprecated. + - Improvements to Eval::TypeTiny. + - Various bug fixes. + - Improved test suite. diff -Nru libtype-tiny-perl-1.000005/README libtype-tiny-perl-1.004004/README --- libtype-tiny-perl-1.000005/README 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/README 2019-01-08 18:26:35.000000000 +0000 @@ -78,8 +78,8 @@ which Test::Fatal depends on) are bundled with Type::Tiny in the `inc` directory, so you do not need to install them separately. - If using Type::Tiny in conjunction with Moo, then at least Moo 1.001000 is - recommended. If using Type::Tiny with Moose, then at least Moose 2.0600 is + If using Type::Tiny in conjunction with Moo, then at least Moo 1.000000 is + recommended. If using Type::Tiny with Moose, then at least Moose 2.0000 is recommended. If using Type::Tiny with Mouse, then at least Mouse 1.00 is recommended. Type::Tiny is mostly untested against older versions of these packages. @@ -128,7 +128,7 @@ Toby Inkster . COPYRIGHT AND LICENCE - This software is copyright (c) 2013-2014 by Toby Inkster. + This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/SIGNATURE libtype-tiny-perl-1.004004/SIGNATURE --- libtype-tiny-perl-1.000005/SIGNATURE 2014-10-25 19:06:55.000000000 +0000 +++ libtype-tiny-perl-1.004004/SIGNATURE 2019-01-08 18:27:21.000000000 +0000 @@ -1,5 +1,5 @@ This file contains message digests of all files listed in MANIFEST, -signed via the Module::Signature module, version 0.73. +signed via the Module::Signature module, version 0.81. To verify the content in this distribution, first make sure you have Module::Signature installed, then type: @@ -14,235 +14,266 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -SHA1 f2f783878895905728904e8097c1771d3443a9c6 COPYRIGHT -SHA1 b1f67a8983d34d3cfe1bfa5a5aeae93db92deb67 CREDITS -SHA1 93b828d8c702b14e42e7fc5e31c2f7809c40e890 Changes +SHA1 15a805330dc3d2941f8b81435b519c36e0e68e9f CONTRIBUTING.pod +SHA1 18eca1827ac992f794a4d0e8ef8a5b6eabaaf1fb COPYRIGHT +SHA1 b8ca9fb4d4c8b691b3f1e24347fdbb87924a41a5 CREDITS +SHA1 c810d57a1ef327e2ee1b01b9d4cecf1be4fab8b6 Changes SHA1 ad40a11542937daa751b38225d43868322a073cc INSTALL -SHA1 34f5e12514b91055de4b164a1f2327ef5c30ba53 LICENSE -SHA1 e578c72b89156a593ab399c43fbc74afa2061f50 MANIFEST -SHA1 2f3a5432e3c2ca383d575740ce33c15563055383 META.json -SHA1 95fc2af08abf8b8c5d400dccdbf4f7332ff4791c META.yml -SHA1 41bf88907a6f932920cd3035317e041ad8dd8bfb Makefile.PL -SHA1 6a37e192c7f990678cfac5902bdc4c0ab22bcabb NEWS -SHA1 618818969d163bfaff6515c6d8bfca8b208ef4f3 README -SHA1 dfcf31f0d8a975af5299a3e869bbb983edf2605d TODO +SHA1 529a6c89bb1ec1ab70f21730c345dcbda3871ed8 LICENSE +SHA1 34fcd6df3a426e9716d7c13ce32b4fc6129be70f MANIFEST +SHA1 83bf953e63be88bc968375ca8657b34cc001c198 META.json +SHA1 2734cf744c69787a93c6357301a9bfcd2cf15b56 META.yml +SHA1 29e33733f68a11dc4f5283a71cdd05c7d8a056ee Makefile.PL +SHA1 bab8f3b75f1f3993684874a81723f1799f4a05dc NEWS +SHA1 1fba411e97ff604dd87488661f3bdcd3c94439f4 README +SHA1 3aec728b79f3cee9bf2976f8672b9150b4184ed0 TODO SHA1 eeed84a123dd7a29ae3be4700cd6d1daeb6c1c68 dist.ini -SHA1 4fdedc492703d62c38835dfbc9f969564e5b2484 doap.ttl -SHA1 8287b47d25816131e3cc423250538c5565f89407 examples/benchmark-coercions.pl -SHA1 e9b329c6285d83681bff3e4c2ecbb56089999d57 examples/benchmark-constraints.pl -SHA1 83ba80a1a71b01fa18933c1e0f97de9eba965247 examples/benchmark-param-validation.pl +SHA1 e5e3456949a83d708e1f5ea31618776845edd21e doap.ttl +SHA1 f6a5ed85dc02d9af3f31ea901639f0a65fa4bdd5 examples/benchmarking/benchmark-coercions.pl +SHA1 b041788e5c5bf1074370d629b0464e5cf8c9a6cf examples/benchmarking/benchmark-constraints.pl +SHA1 da374658c1f1c58c1373803c291c47746eb35ebf examples/benchmarking/benchmark-named-param-validation.pl +SHA1 332983839592f605647dd52ff2a6f689c0e5fde4 examples/benchmarking/benchmark-param-validation.pl +SHA1 2aacb4150fc74604496079f9ac21968325ac5f3b examples/benchmarking/versus-scalar-validation.pl SHA1 f25058eef51dac107e9aa72ec62272aec62f7e94 examples/datetime-coercions.pl -SHA1 2aacb4150fc74604496079f9ac21968325ac5f3b examples/versus-scalar-validation.pl +SHA1 6ed5c7a93aa23cf9c5c71004d6f9216826f6f3fa examples/nonempty.pl +SHA1 55e7ca7fc7520290472eea6e252b25cc77049c1e examples/page-numbers.pl SHA1 8b3c5d366a0a716096617c9e14a100c1948fd159 inc/Test/Fatal.pm SHA1 95d4da14025622f3a45f5e9b75b7b6860148f415 inc/Test/Requires.pm SHA1 e7088f7483bdffb64be359be205927c3d6639ffe inc/Try/Tiny.pm -SHA1 317b9ea61e77bcfaa28aee83007c7ee6d249c522 lib/Devel/TypeTiny/Perl56Compat.pm -SHA1 e27f0bef509e8ff334d363fa6477191edb6762e0 lib/Devel/TypeTiny/Perl58Compat.pm -SHA1 24a7137a39d0939ff6f9fdd7a354820e28dd98a5 lib/Error/TypeTiny.pm -SHA1 de936bd37a482b7613f8e6a8c1f94b1fc2da4185 lib/Error/TypeTiny/Assertion.pm -SHA1 0fd914169c6fc08447c5596184f37fad44c3d1aa lib/Error/TypeTiny/Compilation.pm -SHA1 25b741c4a7f35bc84cd699f99515fbf91388e025 lib/Error/TypeTiny/WrongNumberOfParameters.pm -SHA1 694252b371e4f6cfecd9824a311a6d1b7edaa98d lib/Eval/TypeTiny.pm -SHA1 edd3438c5e8fdfb5a13b16ef7366ccde7c5e1fd5 lib/Reply/Plugin/TypeTiny.pm -SHA1 907d5257aee4897a4d21088294904309f3ff8c52 lib/Test/TypeTiny.pm -SHA1 dc85e56b27c642c1e0f02e8e8f9962038d631688 lib/Type/Coercion.pm -SHA1 07038e3e1c14fe81937b45e67ddc8a171b890b8d lib/Type/Coercion/FromMoose.pm -SHA1 f0b9223ebf65f7bf528b9802b1572531677f6655 lib/Type/Coercion/Union.pm -SHA1 0daabb70400507205fa1903783ae3e89a3bf3a53 lib/Type/Library.pm -SHA1 d2d0cb5c7d203f8d40c13fbde5157a9d83cea7eb lib/Type/Params.pm -SHA1 254b60dd36c491a6ec8af38d1bc9cf15146ef736 lib/Type/Parser.pm -SHA1 21d54221104ce5312b60b307678081e4ea086a80 lib/Type/Registry.pm -SHA1 4375dead71e85090b639b6575fb79f8833654c4e lib/Type/Tiny.pm -SHA1 3636ba8cc2f660b543a12c34ddc2598b2113729e lib/Type/Tiny/Class.pm -SHA1 9696df09017ece318ed0506d768cce128b26d3bc lib/Type/Tiny/Duck.pm -SHA1 1196a079b5a57a37e0177ce4e3138e15f62da02b lib/Type/Tiny/Enum.pm -SHA1 fc2bbe65a71c3c1eeeb5327ebdef44a6a1977cc2 lib/Type/Tiny/Intersection.pm -SHA1 76f16ec3fba03876fc35d6dcb2ffc57891e22ec9 lib/Type/Tiny/Manual.pod -SHA1 1ee6304527dbb89bb7e5ba1312ea36ffe5a6dc83 lib/Type/Tiny/Manual/Coercions.pod -SHA1 aa6d56fb6fc50a9293948ea4f03995f017ece254 lib/Type/Tiny/Manual/Libraries.pod -SHA1 4008a036c434a8bf07c9e360e8db37d244b8cab6 lib/Type/Tiny/Manual/Optimization.pod -SHA1 89f7da04e7b2d1c8363df659e063eab69ee55200 lib/Type/Tiny/Manual/Params.pod -SHA1 097bf4e31a8241107ee4f11993788728f243ecfa lib/Type/Tiny/Manual/Policies.pod -SHA1 ef827a774088d9cb5b0cb0543ce932ef11f369dd lib/Type/Tiny/Manual/UsingWithMoo.pod -SHA1 6bd074644a4d5e67c9fed91f9e24283ae1416c06 lib/Type/Tiny/Manual/UsingWithMoose.pod -SHA1 e96e186ad4afcd2f980282bd510b42a9bca9a863 lib/Type/Tiny/Manual/UsingWithMouse.pod -SHA1 ba5d7e9bcd7cffc7708f272be40a229bdbc8e19b lib/Type/Tiny/Manual/UsingWithOther.pod -SHA1 db9094f4277e20cc3964ecdf14c1210d5c3c5bee lib/Type/Tiny/Role.pm -SHA1 ae802e9082fbfe35066ed4019b9281e7f58f6510 lib/Type/Tiny/Union.pm -SHA1 5c26ae1a7d22f23a6b9d60efb9e5698427efe2f0 lib/Type/Tiny/_HalfOp.pm -SHA1 6c5c1323cbf9090a3ac494d49ca3692e14023637 lib/Type/Utils.pm -SHA1 91452b00b186cadfcf55c37b78be9df3cabfd0e4 lib/Types/Common/Numeric.pm -SHA1 0ea04e398aa159f4b6ea0696f0aa6310df810eb6 lib/Types/Common/String.pm -SHA1 01ab4e6fc9203d63978c72f67a2ec1c40946f239 lib/Types/Standard.pm -SHA1 1917a2e95b9862ceea9776f89cc8a5ef1afeac17 lib/Types/Standard/ArrayRef.pm -SHA1 a635df2a2641347a757282ae9fe480b40a3be3e4 lib/Types/Standard/Dict.pm -SHA1 7a1d9e696fc0dad748b3df3dfb666233df6cb999 lib/Types/Standard/HashRef.pm -SHA1 505ded4a9c7e4b6bdf6b8d1f50cffe37f92b51b2 lib/Types/Standard/Map.pm -SHA1 a1d581409e8cf465588f7507e7ca79d8cd652ffc lib/Types/Standard/ScalarRef.pm -SHA1 0c2a779edb986172bd2d820fc270482fdd872d2c lib/Types/Standard/Tuple.pm -SHA1 bc2ad3c807c11b3f11974312b574880243271ee4 lib/Types/TypeTiny.pm -SHA1 b9af35d9d0a3328fedc80c5824da06ca69409589 t/00-begin.t -SHA1 d3f403cf1bde842588e66107eeae2c34290dab72 t/01-compile.t -SHA1 6424dbcb52e79c715b37ccc836fea197525f057e t/02-api.t -SHA1 d515317dbf547309e22a09ecca20065daa0c90f1 t/03-leak.t -SHA1 f28068b49527681dc4e147b3bd2ca7a163545e40 t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t -SHA1 15d9987525dbb2c590d66323ef2e9ad4a999574f t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t -SHA1 29486c881392c8490d490e26bcfb7a6b4eb1604e t/20-unit/Error-TypeTiny-Assertion/basic.t -SHA1 39f0f71c9be77b40f1174c0ae6257bc6a60d6874 t/20-unit/Error-TypeTiny-Compilation/basic.t -SHA1 1eeb57ce0471f659c8b90d9e2eb8c3d0f538593b t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t -SHA1 bb0ae0fd87fc2a2ec8aca23567e495eb986b9b9f t/20-unit/Error-TypeTiny/basic.t -SHA1 192e65901959094b96beb2731c60923c2544e914 t/20-unit/Error-TypeTiny/stacktrace.t -SHA1 602d3df196ea4cdc237bf89213b15548e4c639b1 t/20-unit/Eval-TypeTiny/basic.t -SHA1 fffe0d31c3eb71550a4ba560fcbb90fccad2bcb3 t/20-unit/Eval-TypeTiny/fallback-aliases.t -SHA1 bf9eddf28b323a1e232ea5622ece38874ed89770 t/20-unit/Eval-TypeTiny/lexical-subs.t -SHA1 0d8906c13806cca3440c8d11722684395cfeb1d7 t/20-unit/Test-TypeTiny/basic.t -SHA1 d44c2c0b0ed1d69aaba0436b1a67a44844628015 t/20-unit/Test-TypeTiny/extended.t -SHA1 b3f07e91d85e8d2d684d9ebb53e512476003db0f t/20-unit/Test-TypeTiny/matchfor.t -SHA1 1a78fcc51393c259dde6eaf249bc57389330e25c t/20-unit/Type-Coercion-FromMoose/basic.t -SHA1 7a0614fbc420168e74d45f5934367713dc9c9db1 t/20-unit/Type-Coercion-FromMoose/errors.t -SHA1 be157f6de3fccb8e3fe0cb43e367f78cb15506c8 t/20-unit/Type-Coercion-Union/basic.t -SHA1 f1732e8387b6bee8b3dd67715e2fec5a5ed9680b t/20-unit/Type-Coercion/basic.t -SHA1 2b3cddf2d148e9ec07c68cf50bfc2cece7910d09 t/20-unit/Type-Coercion/esoteric.t -SHA1 f3565174f11f4215e3810df27cab2b8b2b1d721f t/20-unit/Type-Coercion/frozen.t -SHA1 c9f55d2a715fabff47b460843c5b619d1001f389 t/20-unit/Type-Coercion/inlining.t -SHA1 672c7389629fa0594eabdf12e837466f1d96cdcf t/20-unit/Type-Coercion/parameterized.t -SHA1 e37cb0ada698107dbf9f8d759118e09e463df60d t/20-unit/Type-Coercion/smartmatch.t -SHA1 0879a2be4fb9874357da7d0aa089f1d09296d976 t/20-unit/Type-Coercion/typetiny-constructor.t -SHA1 6759ca9e9deb9e8ac8715335fae7f51e7c8c2abd t/20-unit/Type-Library/assert.t -SHA1 886da2841b0caf78935d0e2a571265021b5b83db t/20-unit/Type-Library/errors.t -SHA1 886f03eb374a0bc88c992ddabd47e0ab9af90937 t/20-unit/Type-Library/inheritance.t -SHA1 50e5ea609b05e8952dfe6aaa2dd6809280e742a3 t/20-unit/Type-Library/is.t -SHA1 87442dc6543236325ba1faae9eeaea485f36c709 t/20-unit/Type-Library/to.t -SHA1 dc29b410e47a63cde1963cc348d8ac8369a9d196 t/20-unit/Type-Library/types.t -SHA1 11acc7e236d64cca8a9ac7ab910570ed38fabee5 t/20-unit/Type-Params/badsigs.t -SHA1 899c98198fbf752ddeeccb373637da17a60a60d8 t/20-unit/Type-Params/carping.t -SHA1 b2c905090b590861050061b46f2b9c920dba342b t/20-unit/Type-Params/coerce.t -SHA1 16314f96dcabec21727864b82016e2581bd970fd t/20-unit/Type-Params/methods.t -SHA1 2a8a9b74440c74b53391ba5b4e7854bd1738321e t/20-unit/Type-Params/mixednamed.t -SHA1 327c1e582d30793ff3393f518d135efc33156522 t/20-unit/Type-Params/multisig.t -SHA1 426ee447807557dad96cad50742db68ba4919881 t/20-unit/Type-Params/named.t -SHA1 dde47da443721ff3de875f54caf3d28ba65a175b t/20-unit/Type-Params/noninline.t -SHA1 c9448d6a10b48482190b539654a99c045f5a78b0 t/20-unit/Type-Params/optional.t -SHA1 c8e9a92b55d3736b30b1d4047e09f5aea6643004 t/20-unit/Type-Params/positional.t -SHA1 50a6fd10075064da20c3c005e8d3fc6c40f4c240 t/20-unit/Type-Params/slurpy.t -SHA1 bbd2de4c0d54ace67af445284ad4dedd6b58e885 t/20-unit/Type-Parser/basic.t -SHA1 01c99c359538df250677906ec24fd931b82dcbd1 t/20-unit/Type-Parser/moosextypes.t -SHA1 54d85a0f70376b9e3a33c082761bec19899cedf2 t/20-unit/Type-Registry/automagic.t -SHA1 9dad0a098f5a4cb7aca03635ee433879e059a0cd t/20-unit/Type-Registry/basic.t -SHA1 e9acc3dd2f3725aae2f6e1a595cf539e3859e6d9 t/20-unit/Type-Registry/methods.t -SHA1 68718858d922cf4a29b336b62deac4dc633a8c56 t/20-unit/Type-Registry/moosextypes.t -SHA1 b73f649e5c0d8f2f04cdde86b773c7c5a9032ccd t/20-unit/Type-Registry/mousextypes.t -SHA1 66efbf7eca5461b0095c666dfd4eac176f59635b t/20-unit/Type-Tiny-Class/basic.t -SHA1 1a002c09cfd1caeca119f27eecd3b2bfa6879964 t/20-unit/Type-Tiny-Class/errors.t -SHA1 0a98e4346d8b9a1a5d14af125993b3f736f7c867 t/20-unit/Type-Tiny-Class/plus-constructors.t -SHA1 b88ba9eb584600968e619a44a65c18a4d1b20e8a t/20-unit/Type-Tiny-Duck/basic.t -SHA1 3cc021195613ebfce2cfcc32a3743424e8a02a5c t/20-unit/Type-Tiny-Duck/errors.t -SHA1 bfffdecee9d0a12409bea19ce9507b9b8d854b11 t/20-unit/Type-Tiny-Enum/basic.t -SHA1 7f1bb58f8a5e88cad2a523bddf204caca49885a9 t/20-unit/Type-Tiny-Enum/errors.t -SHA1 45c500be061cd42c4c02dfac61c2383b987f40f4 t/20-unit/Type-Tiny-Intersection/basic.t -SHA1 8ed66d9acd422a938871961c2a6fd1eafab7b669 t/20-unit/Type-Tiny-Intersection/errors.t -SHA1 f623b85e99fc36c7c283fa14ad41d8118919370c t/20-unit/Type-Tiny-Role/basic.t -SHA1 628ddc8d8e93268d3c1854caf98ca211d4ad0cd9 t/20-unit/Type-Tiny-Role/errors.t -SHA1 03410ff163c28be50b95ba9325c7440f56d7adff t/20-unit/Type-Tiny-Union/basic.t -SHA1 6f69c07f5b99a38f1e9088380d58a69fb6fc984a t/20-unit/Type-Tiny-Union/errors.t -SHA1 b0705b77cfe293525446e9aa79144ac84f3f04c3 t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t -SHA1 df16fe134295effc5036420bdc407d80d0a6403c t/20-unit/Type-Tiny/arithmetic.t -SHA1 1d56dc5b4112e2de4f128ca045d2f3886774be70 t/20-unit/Type-Tiny/basic.t -SHA1 eb3bfba613971feca8d1f30585595c2fad99e560 t/20-unit/Type-Tiny/coercion-modifiers.t -SHA1 4ddded9517e95ecb5eea6e5a8e2c0ed8f3dda3ce t/20-unit/Type-Tiny/esoteric.t -SHA1 2c1f75c14004e3ffae61ef294be1d20ba9c91cfc t/20-unit/Type-Tiny/my-methods.t -SHA1 927a852aaa2e1c80afd5d03ee6edb23b0e1eb5e8 t/20-unit/Type-Tiny/parameterization.t -SHA1 c01cf834a245e606a7569bdec8f51e17b54e6eba t/20-unit/Type-Tiny/shortcuts.t -SHA1 a56a1abe29695eb063ad482dddd29818f1748d94 t/20-unit/Type-Tiny/smartmatch.t -SHA1 32a791e182958f527ae9384355b381a491022986 t/20-unit/Type-Tiny/syntax.t -SHA1 b3b6d756f3888455aacd3a4ad1b27cd5a0045e8d t/20-unit/Type-Tiny/to-moose.t -SHA1 1004f06ab52204fa69b2c684dc6d93525222d608 t/20-unit/Type-Tiny/to-mouse.t -SHA1 37075ba176c4c90ae099c132e59d3fa7219f8f46 t/20-unit/Type-Utils/classifier.t -SHA1 61c6207df4de8e5d6aa026820a97869705235b22 t/20-unit/Type-Utils/dwim-both.t -SHA1 eed7bdd2e497d6285318ce375205b03260c3028d t/20-unit/Type-Utils/dwim-moose.t -SHA1 dbaa2fe138a7c91a374db618460c0003c18ff9e6 t/20-unit/Type-Utils/dwim-mouse.t -SHA1 9f312fa1e087e47f3dc192bde67292d4b0b66f9c t/20-unit/Type-Utils/match-on-type.t -SHA1 1178864691872ccabfd32e45882eeb03b1c09d0d t/20-unit/Type-Utils/warnings.t -SHA1 092fba41d4a128243f1da35230cd63c46c31de87 t/20-unit/Types-Common-Numeric/basic.t -SHA1 9db6707d3d6247034aa5d96ba63a0ce2041ac410 t/20-unit/Types-Common-String/basic.t -SHA1 5a1d2ef80a0cb1c559e1d86a563accdefb1daa58 t/20-unit/Types-Common-String/coerce.t -SHA1 60f0d8924f3556227c07f024b5ea3526c46d2bf3 t/20-unit/Types-Common-String/unicode.t -SHA1 027d9dfecffac07c9e6eb69319db284f49245557 t/20-unit/Types-Standard/basic.t -SHA1 236ad778e85654668486ab2070a0c4f7b7c26b2f t/20-unit/Types-Standard/deep-coercions.t -SHA1 0947699d805cd4a131b49f38bce5131bb4e27704 t/20-unit/Types-Standard/lockdown.t -SHA1 f4b67b87104d6514cf85c7018ca4451e8c35accf t/20-unit/Types-Standard/mxtmlb-alike.t -SHA1 03eb0e84983981fc9698771a8e6d963090681a1e t/20-unit/Types-Standard/optlist.t -SHA1 8a438f687b9e8d6c3f122d36f445a66b324ac83b t/20-unit/Types-Standard/overload.t -SHA1 218c975320897284ad68d0b6306de0ad74bb8b1b t/20-unit/Types-Standard/strmatch.t -SHA1 5f97f99204d0c83648eb6b85d6698da1bec184ab t/20-unit/Types-Standard/structured.t -SHA1 04702d1353ffc8bdd1f8ac0e3dc59f634164f9f0 t/20-unit/Types-Standard/tied.t -SHA1 dd68680d4e149181579832b05218ad2aa314f462 t/20-unit/Types-TypeTiny/basic.t -SHA1 531a4458fafc17a527b1ff3d10b5a31d6c87b78e t/20-unit/Types-TypeTiny/coercion.t -SHA1 72236fa1570495cec069673674af7908f3ab8b60 t/20-unit/Types-TypeTiny/meta.t -SHA1 413782c8873d62d6e45da8e62624cbd345cfefbb t/30-integration/Class-InsideOut/basic.t -SHA1 cfd04b3ad67cfda0758e1ec3ecb676c3c42938a3 t/30-integration/Exporter-Tiny/basic.t -SHA1 14ccfb84a3c2c395d5a58183911dfde5be6ad2ef t/30-integration/Exporter-Tiny/installer.t -SHA1 606f48474abc21958b2fa5e32c967785d25bafc6 t/30-integration/Exporter-Tiny/role-conflict.t -SHA1 39722c2c0a8ce312becc65445be4d28f6a261f8f t/30-integration/Function-Parameters/basic.t -SHA1 ff1a7204d6f1fb93b01d499e0c6866b812617a9e t/30-integration/Kavorka/basic.t -SHA1 14573cd911424f9711f9fdb2858b563e00f55137 t/30-integration/Moo/basic.t -SHA1 64219d6e017330e6547f1a7fb51295b74b51564e t/30-integration/Moo/coercion-inlining-avoidance.t -SHA1 0a55f5788d5ce6a16008b158c9dbb4e1f0ce6bf5 t/30-integration/Moo/coercion.t -SHA1 202cfb5c7a76e96636c952e337a9dc5b338ead30 t/30-integration/Moo/exceptions.t -SHA1 b72ff074358e50986a2d1e7f5d26ca0dbda1ba1c t/30-integration/Moo/inflation.t -SHA1 df69edc34cd4df6ea0e104253b21c8d513fcda0c t/30-integration/Moo/inflation2.t -SHA1 6e067c04404fbebac67fa17a6e7f124422875abb t/30-integration/Moops/basic.t -SHA1 8a6d2bd6f88e623ee3a8097225ba3188a91a1c89 t/30-integration/Moops/library-keyword.t -SHA1 951474159fd17f57ddcab49d41ee9f3c3dc61911 t/30-integration/Moose/accept-moose-types.t -SHA1 b94d883181d5e2a8dd008410ab173ef018d53400 t/30-integration/Moose/basic.t -SHA1 251dd8e32e97e0ed0bc8a0b2249a09ba6b91be48 t/30-integration/Moose/coercion.t -SHA1 5bd0d931433a4722cefdb925aeade6a52d0262f9 t/30-integration/Moose/inflate-then-inline.t -SHA1 29707d7c79ba1b14cc806229366ba481e8e83b4c t/30-integration/Moose/native-attribute-traits.t -SHA1 39f4c0ef1a0317b301380fd3ba9cf067f157b15c t/30-integration/MooseX-Getopt/coercion.t -SHA1 ce9128d67dd493d8a098b43a79d621a68ef44690 t/30-integration/MooseX-Types/basic.t -SHA1 4e8cc262d34fa2512765d5583ce714c9e4e60ccd t/30-integration/MooseX-Types/extending.t -SHA1 b793a8fe0ba551eb6edce4371e7e09d2f06434b0 t/30-integration/MooseX-Types/more.t -SHA1 9fed63a8e9a7ea72157a6501c48ba469503da774 t/30-integration/Mouse/basic.t -SHA1 cf8dcebdda2a29f747d7c979ef1ef2f97f2830d3 t/30-integration/Mouse/coercion.t -SHA1 9d2e7e9da13a8e8dbf128ca87c895dbf45cdb6e8 t/30-integration/MouseX-Types/basic.t -SHA1 c9d06d12b6a935049aac9024177170691c5ad1cf t/30-integration/MouseX-Types/extending.t -SHA1 2d52fab2ca400eca0bdae8d10fd16285ca7c30d6 t/30-integration/Object-Accessor/basic.t -SHA1 3b3749e2f00dfce5376b07b20029f172050ba755 t/30-integration/Return-Type/basic.t -SHA1 eec7ea7d3ce9cfc49063685d669418a200174048 t/30-integration/Sub-Quote/basic.t -SHA1 be5d3c59c8d3b53a87aff8299851699755d6a476 t/30-integration/Sub-Quote/unquote-coercions.t -SHA1 13db0be12e9af963331ea7057342012cde749726 t/30-integration/Sub-Quote/unquote-constraints.t -SHA1 b410fb9dfcfaa6c5999484e00553ec11360bd2f0 t/30-integration/Switcheroo/basic.t -SHA1 0d2e5f7cd72335c0688784f8dfc11084c268872c t/30-integration/Type-Tie/basic.t -SHA1 cc1d3f967bb3478579cc8de38446bc8feb01d06b t/30-integration/Validation-Class-Simple/archaic.t -SHA1 d04fc6f2c2e585a4f7cc2b2459f4e03d13d89226 t/30-integration/Validation-Class-Simple/basic.t -SHA1 352549247763ed90c90fb194530e2682641e3aa2 t/30-integration/match-simple/basic.t -SHA1 ca18e0558abf6d9313a0ebd18be6ca579d64cfde t/40-regression/73f51e2d.pl -SHA1 80ba6d01ea1bac1f28417f999f91749b664a8723 t/40-regression/73f51e2d.t -SHA1 fec03ab3152c2865970ba2a19a4e4edbd178f8cc t/40-regression/gh1.t -SHA1 cc6257770c25469f0016cde3473844e08890e27d t/40-regression/rt85911.t -SHA1 f258801a42bc55bd396500255a3a41b44fa5a57d t/40-regression/rt86004.t -SHA1 0831ca9eec77f6e7e80b98ff5aa59c0f25d50eac t/40-regression/rt86233.t -SHA1 87c998cd74ca53ad8279b122dc4b172854945f18 t/40-regression/rt86239.t -SHA1 480a150a01bb6fdd1a46841abb6f5ac4a7e3f27e t/40-regression/rt90096-2.t -SHA1 6f876719e9482078f55b3a2eeb3f189cf93ad2c5 t/40-regression/rt90096.t -SHA1 9791a5aa341784fc57dcc7dfc2533ae9cfbe94d5 t/40-regression/rt92571-2.t -SHA1 20bb1229a9a799a7318512fa3a36deb5556c6164 t/40-regression/rt92571.t -SHA1 e4ee707028a14d165f76ef59ab4fd4e88ab363f1 t/40-regression/rt92591.t -SHA1 003f455af6a50189c396b50471c7a5ab39428936 t/40-regression/rt94196.t -SHA1 f7bcc3760616e86c777ea05335546294b1e2c340 t/40-regression/rt97684.t -SHA1 bd8073cd5c11cc68d3564d078f0e46bdd044f4c5 t/40-regression/rt98113.t -SHA1 a4e1390ef920c38e1b5e48ae589d77b34b0075c8 t/40-regression/ttxs-gh1.t -SHA1 d23515f31e91fe975cca99e82458feceaa80e065 t/99-moose-std-types-test.t +SHA1 cfbc2b1356a3066aa213fffaa2e1ad3fa32c7047 lib/Devel/TypeTiny/Perl56Compat.pm +SHA1 daf27fd04269e5eac81f65094c72e95b84ba3f10 lib/Devel/TypeTiny/Perl58Compat.pm +SHA1 81266aeb2f7d3332534787ab228734f8e8a7c53f lib/Error/TypeTiny.pm +SHA1 694fe19ffed4e5ef890f17758808e33724c7c735 lib/Error/TypeTiny/Assertion.pm +SHA1 d37ab13e24cbcf6967266c8b86aac1dcdcd79e03 lib/Error/TypeTiny/Compilation.pm +SHA1 a859cfacef296a52f9e5db71c39f0ac9e91bc01c lib/Error/TypeTiny/WrongNumberOfParameters.pm +SHA1 188f101e823d5dc2434cb34794da95243f8ebc1c lib/Eval/TypeTiny.pm +SHA1 c616f8c2c5a456ba27078a873118cc12e1350018 lib/Reply/Plugin/TypeTiny.pm +SHA1 d09c1697dbc8e3f7d9712eea9b5b92a29b36753e lib/Test/TypeTiny.pm +SHA1 65c1ebc4715fcdfda381bba62647f1d6d17fe2b8 lib/Type/Coercion.pm +SHA1 d6b09e2957b9fc7f1fd0796d7b38d5aa94e9cce8 lib/Type/Coercion/FromMoose.pm +SHA1 3219205c75fdd4a9bb85e56239edf743dbbaed0b lib/Type/Coercion/Union.pm +SHA1 1f0aa131e06ecc730f126cceda71d8f524c5335f lib/Type/Library.pm +SHA1 b311c3ecb83d9590587d7480b5b2abaea7b9356d lib/Type/Params.pm +SHA1 05d7a528de11158676baf05d3f5c5bd821b898b5 lib/Type/Parser.pm +SHA1 d5c18ce189c9e9a82f181b077d1e17a8b016f552 lib/Type/Registry.pm +SHA1 aa7cd8ccba3ecd3ef6a513ffc076dda0d18a59a8 lib/Type/Tiny.pm +SHA1 91dc669d18c9565b807e100f1276eefc934e480f lib/Type/Tiny/Class.pm +SHA1 00c748a4258d15e6836f95bbf67006eb1ea1be3f lib/Type/Tiny/Duck.pm +SHA1 35872c3d4da87e4fa8fd73acc784fc9c8e910900 lib/Type/Tiny/Enum.pm +SHA1 ef23069cd09ae044f644613b9e5566df7b3fadfa lib/Type/Tiny/Intersection.pm +SHA1 ce613ceaaeaa644a848cd187f02b7fdaa51767c2 lib/Type/Tiny/Manual.pod +SHA1 7af794631e5e35955c12476a00a19250218fffe6 lib/Type/Tiny/Manual/Coercions.pod +SHA1 218b6f785e95235b31f575c2fea2287e6ca24d72 lib/Type/Tiny/Manual/Libraries.pod +SHA1 7d72c32f41ec8f8e9e68a95b891a70cc39c6a750 lib/Type/Tiny/Manual/Optimization.pod +SHA1 012c93e94bb37ebebae6a2628b19f1d799469433 lib/Type/Tiny/Manual/Params.pod +SHA1 882a46debb7466d6bda3dc0111a022f40d1fc123 lib/Type/Tiny/Manual/Policies.pod +SHA1 0258ddbf9922ca1f73c4f0350fbe6d02cf697c2b lib/Type/Tiny/Manual/UsingWithMoo.pod +SHA1 c7324f53425ea425c5569e056f49ee3d8b661d70 lib/Type/Tiny/Manual/UsingWithMoose.pod +SHA1 0c9a1022abbece2aff07577f807c744e18e62caa lib/Type/Tiny/Manual/UsingWithMouse.pod +SHA1 306135d6354dece6e48e88a99c1e191eec213ee5 lib/Type/Tiny/Manual/UsingWithOther.pod +SHA1 4785e2b7bba72d7e1876a2c4ae586c2133d35e38 lib/Type/Tiny/Role.pm +SHA1 e9dab602ac91fc7611ed54e1edb3a26cdf609af9 lib/Type/Tiny/Union.pm +SHA1 2e2bb1ad6c9fc74bf6f3af378bf69bb54ab222d8 lib/Type/Tiny/_HalfOp.pm +SHA1 22c8fdce21abe236c5ee3ea14239c5ebc00a5070 lib/Type/Utils.pm +SHA1 a871b2af724acef94e019696aa51ebc349b8a6c2 lib/Types/Common/Numeric.pm +SHA1 624a93a19d2620b36d6a8b859ba94bb7a0127ea1 lib/Types/Common/String.pm +SHA1 eedbac1bdcacd453b4db2fa7fb63eaaa41f673f5 lib/Types/Standard.pm +SHA1 4b9c6330bfb7150b0a8fc5512628bfe48fb45772 lib/Types/Standard/ArrayRef.pm +SHA1 a5e7b087b3bfd5eca9cb928742b2417b85b99a8c lib/Types/Standard/CycleTuple.pm +SHA1 763a0293731a76cacba6aada32cfe8f1253d06a1 lib/Types/Standard/Dict.pm +SHA1 9d2c1bff817045b3ecb7f1679f633ed2cd4b5a6f lib/Types/Standard/HashRef.pm +SHA1 d9a60fb8e6f138adbd1d853ca493b1f6109224a3 lib/Types/Standard/Map.pm +SHA1 4e79c5358a6501ed261e9dd40fee83d384793e4e lib/Types/Standard/ScalarRef.pm +SHA1 1068bfe527bfa497e9774bc12c478b4358c52a1d lib/Types/Standard/StrMatch.pm +SHA1 781234d1befb16b20b377dd9836afa1bff95ad62 lib/Types/Standard/Tied.pm +SHA1 5eb432c8e5bfe827b7fdac962f9cd304c0d832fe lib/Types/Standard/Tuple.pm +SHA1 4a2a3e5feffd3038c1df5729c3bfd3cacd11f339 lib/Types/TypeTiny.pm +SHA1 8a7c0526e14664f30b246426b954aa3d1f8670c5 t/00-begin.t +SHA1 cfa2a0bed6527d11eef26af095a24c69333a566e t/01-compile.t +SHA1 85efb97a068c9f37357f9a5fb67d80a65718a341 t/02-api.t +SHA1 ca9db215d19ab0128d503afc927a61dfd09e858e t/03-leak.t +SHA1 898b390e44f1f31d3a60b511c953cc259362376d t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t +SHA1 692c5fce637ab658275df03af729d79a6314e52b t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t +SHA1 a367e6ea1eeaac8012ef7d8a89c95f269c8a2d69 t/20-unit/Error-TypeTiny-Assertion/basic.t +SHA1 832360c7c21cc440c0b0a3278946aa4ac5dbf7fc t/20-unit/Error-TypeTiny-Compilation/basic.t +SHA1 78220dedcb7ed2bb7dad482e963ac44d2e56622b t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t +SHA1 ba679db043018ca1e550129f49b8e9039079c5f8 t/20-unit/Error-TypeTiny/basic.t +SHA1 68d7ea4d4743ccedd3a8aef8b71099e8269096d5 t/20-unit/Error-TypeTiny/stacktrace.t +SHA1 5c49558633e6d7e3cb6f1cd6c1d05b27df2f06e7 t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t +SHA1 79e1ace4ea9907274c4c06585828204116e1b70a t/20-unit/Eval-TypeTiny/aliases-native.t +SHA1 d1af9299148a1ad323535bd82045b81947c19326 t/20-unit/Eval-TypeTiny/aliases-padwalker.t +SHA1 200550f5a0b6f5a1b94793bb097e67307470cf0d t/20-unit/Eval-TypeTiny/aliases-tie.t +SHA1 db89279f96660a409d9e78c571a63cdf23a51221 t/20-unit/Eval-TypeTiny/basic.t +SHA1 4db7dd8adc1d891997c820c4bc4d533b2264e9f6 t/20-unit/Eval-TypeTiny/lexical-subs.t +SHA1 41111889947ce264e3f0b3af7073cad7d0af2a8f t/20-unit/Test-TypeTiny/basic.t +SHA1 d84e873dbe65c652cb3de395c5469517ce180860 t/20-unit/Test-TypeTiny/extended.t +SHA1 af849a269e184cb883f9f516a0a1d6ddbf071118 t/20-unit/Test-TypeTiny/matchfor.t +SHA1 123f12cae7c7e69a2f98f48d98359f63a2710e55 t/20-unit/Type-Coercion-FromMoose/basic.t +SHA1 1f4bcbb4018b0a5852822c012ddd4013c56fea7f t/20-unit/Type-Coercion-FromMoose/errors.t +SHA1 dcd2e2741f483c67a67f26392f12e7ddd2663433 t/20-unit/Type-Coercion-Union/basic.t +SHA1 c6e69f266f50446f92a8cb948a4aeaf9e9e8d44a t/20-unit/Type-Coercion/basic.t +SHA1 ee283d4552b8ee1606c41df8685a4f3500614785 t/20-unit/Type-Coercion/esoteric.t +SHA1 90c4df2f7e27f68246592fac9b0581df2b15feaa t/20-unit/Type-Coercion/frozen.t +SHA1 a866456cd31be459ae9396eba0e5d37ec7c23f0d t/20-unit/Type-Coercion/inlining.t +SHA1 0ad827afa1f1c182c4a3537ff64a1e04fe0bd905 t/20-unit/Type-Coercion/parameterized.t +SHA1 929fd679c361987f5295a7e1fac34f5b8f45a2ef t/20-unit/Type-Coercion/smartmatch.t +SHA1 90d9a5dd647ab6eece7dc9c2935a6a8fcfa74434 t/20-unit/Type-Coercion/typetiny-constructor.t +SHA1 4a841be83c28d8970d7a62159b538494ddbbee56 t/20-unit/Type-Library/assert.t +SHA1 f9d61595b9c8619816bc380b82fd05bd0293af93 t/20-unit/Type-Library/deprecation.t +SHA1 d1e50728120b4ce8ac59e35fd1c50955a9140b71 t/20-unit/Type-Library/errors.t +SHA1 2a29f08a539f78a9a6ea364fd8333b0d11a4a342 t/20-unit/Type-Library/inheritance.t +SHA1 84b9fa6c5e3cf16ed1ede0e187f2306eac6a3867 t/20-unit/Type-Library/is.t +SHA1 0a59f3df7267c0044402f5ce0c94f3fc1e9fd434 t/20-unit/Type-Library/to.t +SHA1 2cc2a24b24438e79d40c0bd9dbd2a9f149b94d87 t/20-unit/Type-Library/types.t +SHA1 4166cf42b0319cfa318b61ae82068a76bc5c33af t/20-unit/Type-Params/badsigs.t +SHA1 5a70971c08ec2f3ad2253cc59315ba1015bba00f t/20-unit/Type-Params/carping.t +SHA1 dec89114dc828b9069dbd7ef164f2c7118cdda8d t/20-unit/Type-Params/coerce.t +SHA1 ee7ec07c67357ef2a1addb4b65e2caf10dd2e900 t/20-unit/Type-Params/compile-named-bless.t +SHA1 9130e1160ab9abd895957ab8b47013c6ac724be8 t/20-unit/Type-Params/compile-named-oo.t +SHA1 05447046ff7b32c566dfff4540b578a09b7eb9a2 t/20-unit/Type-Params/compile-named.t +SHA1 97b35153622671837c2a3e5d3ef77ed5e65a41f3 t/20-unit/Type-Params/defaults.t +SHA1 81366a6c029c71b16220eca04a9a1a811fd2e3d6 t/20-unit/Type-Params/hashorder.t +SHA1 2dacd86d6fcccb33310d3394999adb62e267ddf3 t/20-unit/Type-Params/methods.t +SHA1 001a31a9ea40ee88a7ddfd2fc77c0d17280dfc08 t/20-unit/Type-Params/mixednamed.t +SHA1 b09bb25ae756415e2efbd15c9ddfb5b68911677f t/20-unit/Type-Params/multisig.t +SHA1 40dbbe1c4753a5fb9818214d458349a9f19601dd t/20-unit/Type-Params/named.t +SHA1 01effa9103609863fc5ee3c16f33fa1e3bacdb74 t/20-unit/Type-Params/noninline.t +SHA1 8ab0f36b61ebea574319de25507468b35717e842 t/20-unit/Type-Params/optional.t +SHA1 2743745a191563b3e0e91e73ee138e9c6d4528f2 t/20-unit/Type-Params/positional.t +SHA1 766e12bf2a02d666fb678b0d915be02fbd7dc2b6 t/20-unit/Type-Params/slurpy.t +SHA1 aa7008e12574d169595e0ddf970ddd400f10558e t/20-unit/Type-Parser/basic.t +SHA1 77356cb84c36e7db1878ba7a29c86f9474344a19 t/20-unit/Type-Parser/moosextypes.t +SHA1 4db30ef50f229e6eaba72180a79709d31a7a8917 t/20-unit/Type-Registry/automagic.t +SHA1 67bfb23dfa1dfe5c72672bd77d31490d54efcf65 t/20-unit/Type-Registry/basic.t +SHA1 86381e82a3319440c1ecb254e805d3c7aeb3e988 t/20-unit/Type-Registry/methods.t +SHA1 77a7ca84f5a963a073b1b8c09b32907989b8a9ec t/20-unit/Type-Registry/moosextypes.t +SHA1 47fc97be5287c5bca54d8d6f7e442c16edb960bc t/20-unit/Type-Registry/mousextypes.t +SHA1 f3e2f2769751aa37d50f109ebb9e121037bf3f0e t/20-unit/Type-Tiny-Class/basic.t +SHA1 c26c4f94a49519558731d3501cc95b47caf89bae t/20-unit/Type-Tiny-Class/errors.t +SHA1 0a2a7e7bd6828e4265696d49bb35ff64b41a9dc8 t/20-unit/Type-Tiny-Class/plus-constructors.t +SHA1 5700c722a8b8e0d8f317ea58bd101953fe24e68d t/20-unit/Type-Tiny-Duck/basic.t +SHA1 57ad9aaff2f797c327dca723c85b77c70f48b260 t/20-unit/Type-Tiny-Duck/errors.t +SHA1 ed24e84e2b0f15425a5100d688727aec90f7003f t/20-unit/Type-Tiny-Enum/basic.t +SHA1 d42fa04da9f983a8fe5ce30d505ada0a3ec25f9e t/20-unit/Type-Tiny-Enum/errors.t +SHA1 bf0dac0ba290573fed35472817dc2d2196a66625 t/20-unit/Type-Tiny-Intersection/basic.t +SHA1 32d6a5afc79f116983227f628d413fbe7d51cfdf t/20-unit/Type-Tiny-Intersection/errors.t +SHA1 69fcc53208857dfd5168e6d3ce489be7d2b555dc t/20-unit/Type-Tiny-Role/basic.t +SHA1 f2175ca4e3a227497877b53a274ef0931026f4e0 t/20-unit/Type-Tiny-Role/errors.t +SHA1 fcef30f29568935fd626f5199bf6dc43584326af t/20-unit/Type-Tiny-Union/basic.t +SHA1 5eaa50f63c67bfdd4aa6981f0d580874e9ad5cdf t/20-unit/Type-Tiny-Union/errors.t +SHA1 a45472846f306ba2d93250b3c4c4e7c159d3a827 t/20-unit/Type-Tiny-Union/relationships.t +SHA1 2511acb797ab2474cd9f3e8a310d19bfa116c7fc t/20-unit/Type-Tiny-_HalfOp/double-union.t +SHA1 30269ce94dade136835f5b496265186694662f00 t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t +SHA1 858afc5056029409cc24dea9c3229282d1b73df5 t/20-unit/Type-Tiny/arithmetic.t +SHA1 3babc50c65f27cc1c0b5733a6756892bc6c5aedb t/20-unit/Type-Tiny/basic.t +SHA1 296564b79a984de294885715b828c7d75846549a t/20-unit/Type-Tiny/coercion-modifiers.t +SHA1 6024a11f91cc48253f53bb32549166a77fc90576 t/20-unit/Type-Tiny/constraint-strings.t +SHA1 3c95289453ab6a5966e60b3d899bfd1bb584e2c1 t/20-unit/Type-Tiny/deprecation.t +SHA1 17bd18b8469f86ba7d99261053e915fce1b3fb64 t/20-unit/Type-Tiny/esoteric.t +SHA1 d30dc6d283539f829750d80a94a3d761480b7e1d t/20-unit/Type-Tiny/my-methods.t +SHA1 8f8fa9f6b5ea2f642c2b069b27a1dfd9703b2c43 t/20-unit/Type-Tiny/parameterization.t +SHA1 6fe14e193d28a48082eb3a8b521137a8dd28f696 t/20-unit/Type-Tiny/shortcuts.t +SHA1 536c23aaea9c7349fa092b6b3725133307e954f7 t/20-unit/Type-Tiny/smartmatch.t +SHA1 25250c1d28756a1250d1144413f8a7cc93951fb4 t/20-unit/Type-Tiny/syntax.t +SHA1 467f5e785bf18d3a34780828c12c5bf5d8f43422 t/20-unit/Type-Tiny/to-moose.t +SHA1 9932ee7e14b60983f886e3d0f3fa3dfbe16bbd02 t/20-unit/Type-Tiny/to-mouse.t +SHA1 2953d5fe3621254e8958ae4a7d3d8e14b47f5666 t/20-unit/Type-Utils/classifier.t +SHA1 8df95acd148d9820ba965072df78e17fd01a48a0 t/20-unit/Type-Utils/dwim-both.t +SHA1 6498a1a21d0f5327f97b713fc4608ea44e087f46 t/20-unit/Type-Utils/dwim-moose.t +SHA1 567a89845dccdb2b63e0dbb8b025696e63509860 t/20-unit/Type-Utils/dwim-mouse.t +SHA1 8693b3a63b254b6fc537701a3efaae673e34db38 t/20-unit/Type-Utils/match-on-type.t +SHA1 c7b8dbfd1586f2d48ac796f0c6864366a23e94b4 t/20-unit/Type-Utils/warnings.t +SHA1 bec3d4502759de12abb7cdcbb5d00fbc5f53dc57 t/20-unit/Types-Common-Numeric/basic.t +SHA1 e297cc92685cdb9601467e09fc93fd6f6fdf3444 t/20-unit/Types-Common-Numeric/ranges.t +SHA1 3e21b675526daab01614d14044f33ae6387bee11 t/20-unit/Types-Common-String/basic.t +SHA1 ea89dd9e2e5610ad3f0db6b586ae49be5f9da333 t/20-unit/Types-Common-String/coerce.t +SHA1 11937d18f2c3d3bbd39464440a80ae6eb604c054 t/20-unit/Types-Common-String/strlength.t +SHA1 cc22547b3d69a16bb53f39d416dadeb697c84225 t/20-unit/Types-Common-String/unicode.t +SHA1 72e625fded435bdd47ac03a3c30675fd0ab99adb t/20-unit/Types-Standard/basic.t +SHA1 ecf33d43c2b97f8f3a94e50f5e80d6628ef1ebc1 t/20-unit/Types-Standard/cycletuple.t +SHA1 b56af353f1e372e19ba323d1dd02ef41af6c64d7 t/20-unit/Types-Standard/deep-coercions.t +SHA1 99e45188e60d666156000197f34570ea6c836828 t/20-unit/Types-Standard/filehandle.t +SHA1 18548c8e46740279b90487528bce70da5f5d326f t/20-unit/Types-Standard/lockdown.t +SHA1 3af9781e7ff8ae7c1ab6e89d4eae0c969cd30493 t/20-unit/Types-Standard/mxtmlb-alike.t +SHA1 9ce7ef316d777bc2437caf9f4604102fbf0b4603 t/20-unit/Types-Standard/optlist.t +SHA1 c8de92b24126e71d384c1de6cad6053e992fe7cd t/20-unit/Types-Standard/overload.t +SHA1 eb623a75fb824e1a31d2f8755e9f0537f52edcec t/20-unit/Types-Standard/strmatch.t +SHA1 befb135ee4c71eb8aa5b6697011c58f526c69a41 t/20-unit/Types-Standard/structured.t +SHA1 cf6aa2956b2ea9a623ec3c0d7aad411fcf7f3cf6 t/20-unit/Types-Standard/tied.t +SHA1 5ecd2d29f7110a12123a38920d65bdb4e8100c48 t/20-unit/Types-TypeTiny/basic.t +SHA1 59e053dd80bee3a76bc9c4d50de1e4eac499bb88 t/20-unit/Types-TypeTiny/coercion.t +SHA1 08198462ff0f589b6189607a380c135fbf4cd57c t/20-unit/Types-TypeTiny/meta.t +SHA1 d9908e946e9e7a9ce14eaa0c313a52e3c30f9431 t/20-unit/Types-TypeTiny/moosemouse.t +SHA1 39bf09e8ac523a5732ff98e526e7652a67846a6d t/20-unit/Types-TypeTiny/progressiveexporter.t +SHA1 4694a821a2bc3f5f3950b4bb4691941af5553a10 t/30-integration/Class-InsideOut/basic.t +SHA1 2078fd9bc6c511fafab8af6df0297420a368cf4d t/30-integration/Exporter-Tiny/basic.t +SHA1 b30e87b452e7adb3d185d895944a2666cc3623e0 t/30-integration/Exporter-Tiny/installer.t +SHA1 04caf8f6f67030516a85cbac7294e85828b2ac39 t/30-integration/Exporter-Tiny/role-conflict.t +SHA1 1491038068a1e06f4e91b546c83e4280980bb6b9 t/30-integration/Function-Parameters/basic.t +SHA1 8ad9f76fbcf7ae2b6e0a9c8ca7878b46929c7076 t/30-integration/Kavorka/80returntype.t +SHA1 cd9ea12320bfeb5cb7c7d146d45d1dcd6f598858 t/30-integration/Kavorka/basic.t +SHA1 5c7c702347a9dab5f7492dd4db7585c148b21cd7 t/30-integration/Moo/basic.t +SHA1 3731dedd989c0d86e8e6c2f111fbdb0eb4d339e3 t/30-integration/Moo/coercion-inlining-avoidance.t +SHA1 b35eec6913d8321f68903cbefa459bb520fa9a5c t/30-integration/Moo/coercion.t +SHA1 bd50d51649a0965ee2acb73b1e83cbb00db079fa t/30-integration/Moo/exceptions.t +SHA1 78d71aeabec2ad833b9027efbe41f04397ba897f t/30-integration/Moo/inflation.t +SHA1 d72321a77591788234436e7d71fc62084ffce7ad t/30-integration/Moo/inflation2.t +SHA1 7de87d2e331abeab96febfcf6ddc3dc60a2b1c37 t/30-integration/Moops/basic.t +SHA1 2f94b07907acfbdccae55eaa42af4ccc6e6166ce t/30-integration/Moops/library-keyword.t +SHA1 78ffc4207e533810ca3f727397449e64e1d1a1a5 t/30-integration/Moose/accept-moose-types.t +SHA1 7d30e29b789c097b6b280889e1bd42d214b6da60 t/30-integration/Moose/basic.t +SHA1 4b19373f987563a2887a603bf622d0dd81f221f4 t/30-integration/Moose/coercion-more.t +SHA1 eaa060a8d758b28956d7840bc59a49a1f910821f t/30-integration/Moose/coercion.t +SHA1 ab8fc4959832809da9ee9dee88ecabe6c68a1b15 t/30-integration/Moose/inflate-then-inline.t +SHA1 bfb366a5fcdf02a5ef244b41acc1f3970fa13307 t/30-integration/Moose/native-attribute-traits.t +SHA1 9de45f0e01ef6e0c0c0856be1844d00e7b32ec99 t/30-integration/MooseX-Getopt/coercion.t +SHA1 735ce04a0dbb2b2757ab3a2b136fd2195f656ac6 t/30-integration/MooseX-Types/basic.t +SHA1 e206628620da4cd85f94b7f8bbf2ad5cd4b31b50 t/30-integration/MooseX-Types/extending.t +SHA1 d25d6ffaecfb46a929505a5f120bfceb46bfbf66 t/30-integration/MooseX-Types/more.t +SHA1 e1202d59919cfd802d92f7a217bc774bac368436 t/30-integration/Mouse/basic.t +SHA1 f35e4c96fb39e4b131ff4ee2faef29ad76570e4c t/30-integration/Mouse/coercion.t +SHA1 31287e2f8b69103d725dceede580b0b4a222f5a5 t/30-integration/MouseX-Types/basic.t +SHA1 47c06a3103c54d8260d3868663e36bd565c7bf9d t/30-integration/MouseX-Types/extending.t +SHA1 7e2199928d24ba24f93a67f04c564e6c3c4e4880 t/30-integration/Object-Accessor/basic.t +SHA1 63d5ea7db6c6472c79fb104a296448ccb9252309 t/30-integration/Return-Type/basic.t +SHA1 e75874e705342f2d2e16b4d37521a361ab28e770 t/30-integration/Sub-Quote/basic.t +SHA1 a07b479c34f9ba657251e43fd8c0373c2a940007 t/30-integration/Sub-Quote/delayed-quoting.t +SHA1 88ff03739395d05ce83efaf52b74ffb06c1fb21c t/30-integration/Sub-Quote/unquote-coercions.t +SHA1 3a20b273774d094dff85a085093e32a0936cfc13 t/30-integration/Sub-Quote/unquote-constraints.t +SHA1 f0bce793948eb5057c0cfe698929e425c5feb295 t/30-integration/Switcheroo/basic.t +SHA1 692007217c152e4d9e44caa329fba91a5d636483 t/30-integration/Type-Tie/basic.t +SHA1 af325bad320a8c2b13cb2a0b85a7d78ad1f3c2d7 t/30-integration/Validation-Class-Simple/archaic.t +SHA1 b0e452cfbce478d2471c1e76c523f57284145eee t/30-integration/Validation-Class-Simple/basic.t +SHA1 67c07bbccdc038f8c85f1bb9304324e5e8e69979 t/30-integration/match-simple/basic.t +SHA1 348e6638d01ab2a27f84d2dc07d2fd8453c2c860 t/40-regression/73f51e2d.pl +SHA1 a95d6fa08f1a918a803dfe39965de589579e1ad6 t/40-regression/73f51e2d.t +SHA1 3988131e95a6ad2b3356d9148fda6b6a20c1f2f1 t/40-regression/gh1.t +SHA1 f8469367fc7b37f37d13c36f58fb07eef0ebbd77 t/40-regression/gh14.t +SHA1 c5eb0a5437a71a9b48ba1ba6b6abe9c2fe9c0612 t/40-regression/rt125132.t +SHA1 cf59e8ed2b5c0974df8bb5b8f6b116041ad95058 t/40-regression/rt125765.t +SHA1 34647559f25eecf00d89fcf6f0bb601480d69558 t/40-regression/rt85911.t +SHA1 132cc5c6ad5389ebe60208c6147205a70916550b t/40-regression/rt86004.t +SHA1 ad1af0a1be5dd66cdc42b27433c48f995af48f3a t/40-regression/rt86233.t +SHA1 0c634206114654a92597139bee64483652d1fb96 t/40-regression/rt86239.t +SHA1 dc26edd8b37f89fa8613312aaa23ff23278161e6 t/40-regression/rt90096-2.t +SHA1 453e5b4ba0e571ace39132b02ea061ced84cd11a t/40-regression/rt90096.t +SHA1 92fdf0e0e29255f411542f30e8fa3325524d96fb t/40-regression/rt92571-2.t +SHA1 a6285e0268f0968f6b28fbc3432316125ee57bee t/40-regression/rt92571.t +SHA1 44251a0b577942c7404eec9a19b8beed3f609e3f t/40-regression/rt92591.t +SHA1 69baa9461c9caba6d55afcaf0f28e439639e8815 t/40-regression/rt94196.t +SHA1 80f3b799470cdb309c5911778004b5af0d7c6059 t/40-regression/rt97684.t +SHA1 3ba5522cc505e8af82a11674d98e754f7c7b704b t/40-regression/rt98113.t +SHA1 16ec6b79b764003501381666cb5a5c8706b61a53 t/40-regression/ttxs-gh1.t +SHA1 5ecaa3902549ce044c5313dc18bf0458f7ded01c t/99-moose-std-types-test.t SHA1 f765f14abcbe280da09d0d3aacca0337760b0683 t/README SHA1 83c445cac3ab13ffe427ec7bf21287ef2824ff8f t/TODO -SHA1 14e9cbe972a219046ba8eca18f6b7730714d5078 t/lib/BiggerLib.pm -SHA1 620f21a99269ade5cc91c73a7f9df97ee9cbb8e2 t/lib/DemoLib.pm +SHA1 4dc83d20450446ac368b3ecdaaaa6e9d4518f163 t/lib/BiggerLib.pm +SHA1 dc18ede02d4b7790ca0c6b0dd2549ba4753ca607 t/lib/DemoLib.pm SHA1 3eb4a7ac4357ce37ee83611ecccd32dab0a6d5a1 t/mk-test-manifest.pl SHA1 f846fa57aa90c0c55aeee735368cb9dd4015b77a t/not-covered.pl -----BEGIN PGP SIGNATURE----- -Version: GnuPG v1 -iEYEARECAAYFAlRL9M8ACgkQzr+BKGoqfTm6PQCgq78tji2x+TeelGnUgZsYel/k -mSoAnRMTFMm89evDz90q5SNJC1j8S5xO -=PpjE +iF0EARECAB0WIQRVJKj/4+s6z4WzNujOv4Eoaip9OQUCXDTriQAKCRDOv4Eoaip9 +OZPKAJ9GENu163qysxhR+ydPeMXPA1SA0QCfZGAEjGWbg4igod/agGAHN1ACGkw= +=B797 -----END PGP SIGNATURE----- diff -Nru libtype-tiny-perl-1.000005/t/00-begin.t libtype-tiny-perl-1.004004/t/00-begin.t --- libtype-tiny-perl-1.000005/t/00-begin.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/00-begin.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -27,11 +27,16 @@ sub diag_version { my ($module, $version) = @_; - $version = eval "require $module; $module->VERSION" unless defined $version; + + unless (defined $version) { + eval "use $module ()"; + $version = $module->VERSION; + } return diag sprintf(' %-30s undef', $module) unless defined $version; my ($major, $rest) = split /\./, $version; + $major =~ s/^v//; return diag sprintf(' %-30s % 4d.%s', $module, $major, $rest); } diff -Nru libtype-tiny-perl-1.000005/t/01-compile.t libtype-tiny-perl-1.004004/t/01-compile.t --- libtype-tiny-perl-1.000005/t/01-compile.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/01-compile.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/02-api.t libtype-tiny-perl-1.004004/t/02-api.t --- libtype-tiny-perl-1.000005/t/02-api.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/02-api.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -24,7 +24,11 @@ use warnings; use Test::More; -my $HAVE_MOOSE = eval { require Moose }; +my $HAVE_MOOSE = eval { + require Moose; + Moose->VERSION('2.000'); + 1; # return true +}; my @MOOSE_WANTS = qw( _actually_compile_type_constraint @@ -34,9 +38,7 @@ _compiled_type_constraint _default_message _has_compiled_type_constraint - _has_inlined_type_constraint _inline_check - _inline_environment _new _package_defined_in _set_constraint diff -Nru libtype-tiny-perl-1.000005/t/03-leak.t libtype-tiny-perl-1.004004/t/03-leak.t --- libtype-tiny-perl-1.000005/t/03-leak.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/03-leak.t 2019-01-08 18:26:35.000000000 +0000 @@ -32,7 +32,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t libtype-tiny-perl-1.004004/t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Devel-TypeTiny-Perl56Compat/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t libtype-tiny-perl-1.004004/t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Devel-TypeTiny-Perl58Compat/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny/basic.t libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny/stacktrace.t libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny/stacktrace.t --- libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny/stacktrace.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny/stacktrace.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny-Assertion/basic.t libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny-Assertion/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny-Assertion/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny-Assertion/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -31,6 +31,11 @@ use Scalar::Util qw(refaddr); use Types::Standard slurpy => -types; +require Error::TypeTiny::Assertion; + +my $tmp = Error::TypeTiny::Assertion->new(value => 1.1, type => Int, varname => '$bob'); +is($tmp->message, "Value \"1.1\" did not pass type constraint \"Int\" (in \$bob)", "autogeneration of \$e->message"); + my $supernum = Types::Standard::STRICTNUM ? "StrictNum" : "LaxNum"; my $v = []; @@ -89,11 +94,11 @@ ); is_deeply( - (exception { (ArrayRef[Int])->({}) })->explain, + [ @{ (exception { (ArrayRef[Int])->({}) })->explain }[0..1] ], [ '"ArrayRef[Int]" is a subtype of "ArrayRef"', 'Reference {} did not pass type constraint "ArrayRef"', - '"ArrayRef" is defined as: (ref($_) eq \'ARRAY\')', +# '"ArrayRef" is defined as: (ref($_) eq \'ARRAY\')', ], 'ArrayRef[Int] deep explanation, given {}', ); @@ -175,7 +180,7 @@ 'Reference {1 => "1.1","2.2" => "2.3","3.3" => "3.4"} did not pass type constraint "Map[Int,Num]"', '"Map[Int,Num]" constrains each key in the hash with "Int"', 'Value "2.2" did not pass type constraint "Int" (in key $_->{"2.2"})', - '"Int" is defined as: (defined $_ and $_ =~ /\A-?[0-9]+\z/)', + '"Int" is defined as: (do { my $tmp = $_; defined($tmp) and !ref($tmp) and $tmp =~ /\A-?[0-9]+\z/ })', ], 'Map[Int,Num] deep explanation, given {1=>1.1,2.2=>2.3,3.3=>3.4}', ); @@ -236,6 +241,20 @@ '$TupleOf1 explanation, given [1,2]', ); +my $CTuple = CycleTuple[ Int, ArrayRef ]; + +is_deeply( + (exception { $CTuple->([1,"Foo"]) })->explain, + [ + 'Reference [1,"Foo"] did not pass type constraint "CycleTuple[Int,ArrayRef]"', + '"CycleTuple[Int,ArrayRef]" constrains value at index 1 of array with "ArrayRef"', + '"ArrayRef" is a subtype of "Ref"', + 'Value "Foo" did not pass type constraint "Ref" (in $_->[1])', + '"Ref" is defined as: (!!ref($_))', + ], + '$CTuple explanation, given [1,"Foo"]', +); + TODO: { require Data::Dumper; local $TODO = diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny-Compilation/basic.t libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny-Compilation/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny-Compilation/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny-Compilation/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -13,7 +13,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Error-TypeTiny-WrongNumberOfParameters/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-devel-lexalias.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,243 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Tests L supports alias=>1 using L +implementation. + +=head1 DEPENDENCIES + +Requires Devel::LexAlias. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::Requires 'Devel::LexAlias'; + +use Eval::TypeTiny; + +Eval::TypeTiny::_force_implementation( Eval::TypeTiny::IMPLEMENTATION_DEVEL_LEXALIAS ); + +my %env = ( + '$foo' => do { my $x = "foo"; \$x }, + '@bar' => [ "bar" ], + '%baz' => { "baz" => "1" }, +); + +my $source = <<'SRC'; +sub { + if (!@_) { + return defined tied($foo); + } + return $foo if $_[0] eq '$foo'; + return @bar if $_[0] eq '@bar'; + return %baz if $_[0] eq '%baz'; + return; +} +SRC + +my $closure = eval_closure(source => $source, environment => \%env, alias => 1); + +ok( + ! $closure->(), + 'tied implementation was not used', +); + +is_deeply( + [ $closure->('$foo') ], + [ 'foo' ], + 'closure over scalar', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'bar' ], + 'closure over array', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'baz' => 1 ], + 'closure over hash', +); + +${ $env{'$foo'} } = 'FOO'; +@{ $env{'@bar'} } = ('BAR'); +%{ $env{'%baz'} } = ('BAZ' => 99); + +is_deeply( + [ $closure->('$foo') ], + [ 'FOO' ], + 'closure over scalar - worked', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'BAR' ], + 'closure over array - worked', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'BAZ' => 99 ], + 'closure over hash - worked', +); + + +my $external = 40; +my $closure2 = eval_closure( + source => 'sub { $xxx += 2 }', + environment => { '$xxx' => \$external }, + alias => 1, +); + +$closure2->(); +is($external, 42, 'closing over variables really really really works!'); + +{ + my $destroyed = 0; + + { + package MyIndicator; + sub DESTROY { $destroyed++ } + } + + { + my $number = bless \(my $foo), "MyIndicator"; + $$number = 40; + my $closure = eval_closure( + source => 'sub { $$xxx += 2 }', + environment => { '$xxx' => \$number }, + alias => 1, + ); + + $closure->(); + + is($$number, 42); + is($destroyed, 0); + } + + is($destroyed, 1, 'closed over variables disappear on cue'); +} + +if (0) { # BROKEN + my @store; + + { + package MyTie; + use Tie::Scalar (); + our @ISA = 'Tie::StdScalar'; + sub STORE { + my $self = shift; + push @store, $_[0]; + $self->SUPER::STORE(@_); + } + sub method_of_mine { 42 } + } + + tie(my($var), 'MyTie'); + + $var = 1; + + my $closure = eval_closure( + source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); + $closure->(3); + + my $nother_closure = eval_closure( + source => 'sub { tied($xxx)->can(@_) }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + ok( $nother_closure->('method_of_mine'), '... can'); + ok(!$nother_closure->('your_method'), '... !can'); + + is_deeply( + \@store, + [ 1 .. 3], + '... tie still works', + ); + + { + package OtherTie; + our @ISA = 'MyTie'; + sub method_of_mine { 666 } + } + + tie($var, 'OtherTie'); + is($closure->(4), 666, '... can be retied'); + + untie($var); + my $e = exception { $closure->(5) }; + like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); +} + +if (0) { # ALSO BROKEN + my $e = exception { eval_closure(source => 'sub { 1 ]') }; + + isa_ok( + $e, + 'Error::TypeTiny::Compilation', + '$e', + ); + + like( + $e, + qr{^Failed to compile source because: syntax error}, + 'throw exception when code does not compile', + ); + + like( + $e->errstr, + qr{^syntax error}, + '$e->errstr', + ); + + like( + $e->code, + qr{sub \{ 1 \]}, + '$e->code', + ); + + my $c1 = eval_closure(source => 'sub { die("BANG") }', description => 'test1'); + my $e1 = exception { $c1->() }; + + like( + $e1, + qr{^BANG at test1 line 1}, + '"description" option works', + ); + + my $c2 = eval_closure(source => 'sub { die("BANG") }', description => 'test2', line => 222); + my $e2 = exception { $c2->() }; + + like( + $e2, + qr{^BANG at test2 line 222}, + '"line" option works', + ); +} + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-native.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-native.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-native.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-native.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,242 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Tests L supports alias=>1 using Perl refaliasing. + +=head1 DEPENDENCIES + +Requires Perl 5.22. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::Requires 'v5.22'; + +use Eval::TypeTiny; + +Eval::TypeTiny::_force_implementation( Eval::TypeTiny::IMPLEMENTATION_NATIVE ); + +my %env = ( + '$foo' => do { my $x = "foo"; \$x }, + '@bar' => [ "bar" ], + '%baz' => { "baz" => "1" }, +); + +my $source = <<'SRC'; +sub { + if (!@_) { + return defined tied($foo); + } + return $foo if $_[0] eq '$foo'; + return @bar if $_[0] eq '@bar'; + return %baz if $_[0] eq '%baz'; + return; +} +SRC + +my $closure = eval_closure(source => $source, environment => \%env, alias => 1); + +ok( + ! $closure->(), + 'tied implementation was not used', +); + +is_deeply( + [ $closure->('$foo') ], + [ 'foo' ], + 'closure over scalar', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'bar' ], + 'closure over array', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'baz' => 1 ], + 'closure over hash', +); + +${ $env{'$foo'} } = 'FOO'; +@{ $env{'@bar'} } = ('BAR'); +%{ $env{'%baz'} } = ('BAZ' => 99); + +is_deeply( + [ $closure->('$foo') ], + [ 'FOO' ], + 'closure over scalar - worked', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'BAR' ], + 'closure over array - worked', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'BAZ' => 99 ], + 'closure over hash - worked', +); + + +my $external = 40; +my $closure2 = eval_closure( + source => 'sub { $xxx += 2 }', + environment => { '$xxx' => \$external }, + alias => 1, +); + +$closure2->(); +is($external, 42, 'closing over variables really really really works!'); + +{ + my $destroyed = 0; + + { + package MyIndicator; + sub DESTROY { $destroyed++ } + } + + { + my $number = bless \(my $foo), "MyIndicator"; + $$number = 40; + my $closure = eval_closure( + source => 'sub { $$xxx += 2 }', + environment => { '$xxx' => \$number }, + alias => 1, + ); + + $closure->(); + + is($$number, 42); + is($destroyed, 0); + } + + is($destroyed, 1, 'closed over variables disappear on cue'); +} + +if (0) { # BROKEN + my @store; + + { + package MyTie; + use Tie::Scalar (); + our @ISA = 'Tie::StdScalar'; + sub STORE { + my $self = shift; + push @store, $_[0]; + $self->SUPER::STORE(@_); + } + sub method_of_mine { 42 } + } + + tie(my($var), 'MyTie'); + + $var = 1; + + my $closure = eval_closure( + source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); + $closure->(3); + + my $nother_closure = eval_closure( + source => 'sub { tied($xxx)->can(@_) }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + ok( $nother_closure->('method_of_mine'), '... can'); + ok(!$nother_closure->('your_method'), '... !can'); + + is_deeply( + \@store, + [ 1 .. 3], + '... tie still works', + ); + + { + package OtherTie; + our @ISA = 'MyTie'; + sub method_of_mine { 666 } + } + + tie($var, 'OtherTie'); + is($closure->(4), 666, '... can be retied'); + + untie($var); + my $e = exception { $closure->(5) }; + like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); +} + +if (0) { # ALSO BROKEN + my $e = exception { eval_closure(source => 'sub { 1 ]') }; + + isa_ok( + $e, + 'Error::TypeTiny::Compilation', + '$e', + ); + + like( + $e, + qr{^Failed to compile source because: syntax error}, + 'throw exception when code does not compile', + ); + + like( + $e->errstr, + qr{^syntax error}, + '$e->errstr', + ); + + like( + $e->code, + qr{sub \{ 1 \]}, + '$e->code', + ); + + my $c1 = eval_closure(source => 'sub { die("BANG") }', description => 'test1'); + my $e1 = exception { $c1->() }; + + like( + $e1, + qr{^BANG at test1 line 1}, + '"description" option works', + ); + + my $c2 = eval_closure(source => 'sub { die("BANG") }', description => 'test2', line => 222); + my $e2 = exception { $c2->() }; + + like( + $e2, + qr{^BANG at test2 line 222}, + '"line" option works', + ); +} + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-padwalker.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-padwalker.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-padwalker.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-padwalker.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,243 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Tests L supports alias=>1 using L +implementation. + +=head1 DEPENDENCIES + +Requires PadWalker. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::Requires 'PadWalker'; + +use Eval::TypeTiny; + +Eval::TypeTiny::_force_implementation( Eval::TypeTiny::IMPLEMENTATION_PADWALKER ); + +my %env = ( + '$foo' => do { my $x = "foo"; \$x }, + '@bar' => [ "bar" ], + '%baz' => { "baz" => "1" }, +); + +my $source = <<'SRC'; +sub { + if (!@_) { + return defined tied($foo); + } + return $foo if $_[0] eq '$foo'; + return @bar if $_[0] eq '@bar'; + return %baz if $_[0] eq '%baz'; + return; +} +SRC + +my $closure = eval_closure(source => $source, environment => \%env, alias => 1); + +ok( + ! $closure->(), + 'tied implementation was not used', +); + +is_deeply( + [ $closure->('$foo') ], + [ 'foo' ], + 'closure over scalar', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'bar' ], + 'closure over array', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'baz' => 1 ], + 'closure over hash', +); + +${ $env{'$foo'} } = 'FOO'; +@{ $env{'@bar'} } = ('BAR'); +%{ $env{'%baz'} } = ('BAZ' => 99); + +is_deeply( + [ $closure->('$foo') ], + [ 'FOO' ], + 'closure over scalar - worked', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'BAR' ], + 'closure over array - worked', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'BAZ' => 99 ], + 'closure over hash - worked', +); + + +my $external = 40; +my $closure2 = eval_closure( + source => 'sub { $xxx += 2 }', + environment => { '$xxx' => \$external }, + alias => 1, +); + +$closure2->(); +is($external, 42, 'closing over variables really really really works!'); + +{ + my $destroyed = 0; + + { + package MyIndicator; + sub DESTROY { $destroyed++ } + } + + { + my $number = bless \(my $foo), "MyIndicator"; + $$number = 40; + my $closure = eval_closure( + source => 'sub { $$xxx += 2 }', + environment => { '$xxx' => \$number }, + alias => 1, + ); + + $closure->(); + + is($$number, 42); + is($destroyed, 0); + } + + is($destroyed, 1, 'closed over variables disappear on cue'); +} + +if (0) { # BROKEN + my @store; + + { + package MyTie; + use Tie::Scalar (); + our @ISA = 'Tie::StdScalar'; + sub STORE { + my $self = shift; + push @store, $_[0]; + $self->SUPER::STORE(@_); + } + sub method_of_mine { 42 } + } + + tie(my($var), 'MyTie'); + + $var = 1; + + my $closure = eval_closure( + source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); + $closure->(3); + + my $nother_closure = eval_closure( + source => 'sub { tied($xxx)->can(@_) }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + ok( $nother_closure->('method_of_mine'), '... can'); + ok(!$nother_closure->('your_method'), '... !can'); + + is_deeply( + \@store, + [ 1 .. 3], + '... tie still works', + ); + + { + package OtherTie; + our @ISA = 'MyTie'; + sub method_of_mine { 666 } + } + + tie($var, 'OtherTie'); + is($closure->(4), 666, '... can be retied'); + + untie($var); + my $e = exception { $closure->(5) }; + like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); +} + +if (0) { # ALSO BROKEN + my $e = exception { eval_closure(source => 'sub { 1 ]') }; + + isa_ok( + $e, + 'Error::TypeTiny::Compilation', + '$e', + ); + + like( + $e, + qr{^Failed to compile source because: syntax error}, + 'throw exception when code does not compile', + ); + + like( + $e->errstr, + qr{^syntax error}, + '$e->errstr', + ); + + like( + $e->code, + qr{sub \{ 1 \]}, + '$e->code', + ); + + my $c1 = eval_closure(source => 'sub { die("BANG") }', description => 'test1'); + my $e1 = exception { $c1->() }; + + like( + $e1, + qr{^BANG at test1 line 1}, + '"description" option works', + ); + + my $c2 = eval_closure(source => 'sub { die("BANG") }', description => 'test2', line => 222); + my $e2 = exception { $c2->() }; + + like( + $e2, + qr{^BANG at test2 line 222}, + '"line" option works', + ); +} + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-tie.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-tie.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/aliases-tie.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/aliases-tie.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,237 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Tests L supports alias=>1 using C implementation. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; + +use Eval::TypeTiny; + +Eval::TypeTiny::_force_implementation( Eval::TypeTiny::IMPLEMENTATION_TIE ); + +my %env = ( + '$foo' => do { my $x = "foo"; \$x }, + '@bar' => [ "bar" ], + '%baz' => { "baz" => "1" }, +); + +my $source = <<'SRC'; +sub { + if (!@_) { + return defined tied($foo); + } + return $foo if $_[0] eq '$foo'; + return @bar if $_[0] eq '@bar'; + return %baz if $_[0] eq '%baz'; + return; +} +SRC + +my $closure = eval_closure(source => $source, environment => \%env, alias => 1); + +ok( + $closure->(), + 'tied implementation was loaded', +); + +is_deeply( + [ $closure->('$foo') ], + [ 'foo' ], + 'closure over scalar', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'bar' ], + 'closure over array', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'baz' => 1 ], + 'closure over hash', +); + +${ $env{'$foo'} } = 'FOO'; +@{ $env{'@bar'} } = ('BAR'); +%{ $env{'%baz'} } = ('BAZ' => 99); + +is_deeply( + [ $closure->('$foo') ], + [ 'FOO' ], + 'closure over scalar - worked', +); + +is_deeply( + [ $closure->('@bar') ], + [ 'BAR' ], + 'closure over array - worked', +); + +is_deeply( + [ $closure->('%baz') ], + [ 'BAZ' => 99 ], + 'closure over hash - worked', +); + + +my $external = 40; +my $closure2 = eval_closure( + source => 'sub { $xxx += 2 }', + environment => { '$xxx' => \$external }, + alias => 1, +); + +$closure2->(); +is($external, 42, 'closing over variables really really really works!'); + +{ + my $destroyed = 0; + + { + package MyIndicator; + sub DESTROY { $destroyed++ } + } + + { + my $number = bless \(my $foo), "MyIndicator"; + $$number = 40; + my $closure = eval_closure( + source => 'sub { $$xxx += 2 }', + environment => { '$xxx' => \$number }, + alias => 1, + ); + + $closure->(); + + is($$number, 42); + is($destroyed, 0); + } + + is($destroyed, 1, 'closed over variables disappear on cue'); +} + +if (0) { # BROKEN + my @store; + + { + package MyTie; + use Tie::Scalar (); + our @ISA = 'Tie::StdScalar'; + sub STORE { + my $self = shift; + push @store, $_[0]; + $self->SUPER::STORE(@_); + } + sub method_of_mine { 42 } + } + + tie(my($var), 'MyTie'); + + $var = 1; + + my $closure = eval_closure( + source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); + $closure->(3); + + my $nother_closure = eval_closure( + source => 'sub { tied($xxx)->can(@_) }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + ok( $nother_closure->('method_of_mine'), '... can'); + ok(!$nother_closure->('your_method'), '... !can'); + + is_deeply( + \@store, + [ 1 .. 3], + '... tie still works', + ); + + { + package OtherTie; + our @ISA = 'MyTie'; + sub method_of_mine { 666 } + } + + tie($var, 'OtherTie'); + is($closure->(4), 666, '... can be retied'); + + untie($var); + my $e = exception { $closure->(5) }; + like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); +} + +if (0) { # ALSO BROKEN + my $e = exception { eval_closure(source => 'sub { 1 ]') }; + + isa_ok( + $e, + 'Error::TypeTiny::Compilation', + '$e', + ); + + like( + $e, + qr{^Failed to compile source because: syntax error}, + 'throw exception when code does not compile', + ); + + like( + $e->errstr, + qr{^syntax error}, + '$e->errstr', + ); + + like( + $e->code, + qr{sub \{ 1 \]}, + '$e->code', + ); + + my $c1 = eval_closure(source => 'sub { die("BANG") }', description => 'test1'); + my $e1 = exception { $c1->() }; + + like( + $e1, + qr{^BANG at test1 line 1}, + '"description" option works', + ); + + my $c2 = eval_closure(source => 'sub { die("BANG") }', description => 'test2', line => 222); + my $e2 = exception { $c2->() }; + + like( + $e2, + qr{^BANG at test2 line 222}, + '"line" option works', + ); +} + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/basic.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -28,13 +28,27 @@ use Eval::TypeTiny; -my %env = ( - '$foo' => do { my $x = "foo"; \$x }, - '@bar' => [ "bar" ], - '%baz' => { "baz" => "1" }, -); +subtest "constants exist" => sub { + my @constants = qw( + HAS_LEXICAL_VARS + HAS_LEXICAL_SUBS + ALIAS_IMPLEMENTATION + IMPLEMENTATION_DEVEL_LEXALIAS + IMPLEMENTATION_PADWALKER + IMPLEMENTATION_NATIVE + IMPLEMENTATION_TIE + ); + for my $c (@constants) { + subtest "constant $c" => sub { + my $can = Eval::TypeTiny->can($c); + ok $can, "constant $c exists"; + is exception { $can->() }, undef, "... and doesn't throw an error"; + is $can->(undef), $can->(999), "... and seems to be constant"; + }; + } +}; -my $source = <<'SRC'; +my $s = <<'SRC'; sub { return $foo if $_[0] eq '$foo'; return @bar if $_[0] eq '@bar'; @@ -43,25 +57,38 @@ } SRC -my $closure = eval_closure(source => $source, environment => \%env); +my %sources = (string => $s, arrayref => [split /\n/, $s]); -is_deeply( - [ $closure->('$foo') ], - [ 'foo' ], - 'closure over scalar', -); +foreach my $key (reverse sort keys %sources) { + subtest "compiling $key source" => sub { + my %env = ( + '$foo' => do { my $x = "foo"; \$x }, + '@bar' => [ "bar" ], + '%baz' => { "baz" => "1" }, + ); -is_deeply( - [ $closure->('@bar') ], - [ 'bar' ], - 'closure over array', -); + my $source = $sources{$key}; + my $closure = eval_closure(source => $source, environment => \%env); -is_deeply( - [ $closure->('%baz') ], - [ 'baz' => 1 ], - 'closure over hash', -); + is_deeply( + [ $closure->('$foo') ], + [ 'foo' ], + 'closure over scalar', + ); + + is_deeply( + [ $closure->('@bar') ], + [ 'bar' ], + 'closure over array', + ); + + is_deeply( + [ $closure->('%baz') ], + [ 'baz' => 1 ], + 'closure over hash', + ); + }; +} my $external = 40; my $closure2 = eval_closure( @@ -75,33 +102,37 @@ { my $destroyed = 0; - { package MyIndicator; sub DESTROY { $destroyed++ } } - - { - my $number = bless \(my $foo), "MyIndicator"; - $$number = 40; - my $closure = eval_closure( - source => 'sub { $$xxx += 2 }', - environment => { '$xxx' => \$number }, - alias => 1, - ); - $closure->(); + subtest 'closed over variables disappear on cue' => sub { - is($$number, 42); - is($destroyed, 0); - } - - is($destroyed, 1, 'closed over variables disappear on cue'); + { + my $number = bless \(my $foo), "MyIndicator"; + $$number = 40; + my $closure = eval_closure( + source => 'sub { $$xxx += 2 }', + environment => { '$xxx' => \$number }, + alias => 1, + ); + + $closure->(); + + is($$number, 42, 'closure works'); + is($destroyed, 0, 'closed over variable still exists'); + } + + is($destroyed, 1, 'closed over variable destroyed once closure has been destroyed'); + }; } { my @store; + Eval::TypeTiny::_force_implementation( Eval::TypeTiny::IMPLEMENTATION_TIE ); + { package MyTie; use Tie::Scalar (); @@ -114,46 +145,49 @@ sub method_of_mine { 42 } } - tie(my($var), 'MyTie'); - - $var = 1; - - my $closure = eval_closure( - source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', - environment => { '$xxx' => \$var }, - alias => 1, - ); - - is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); - $closure->(3); - - my $nother_closure = eval_closure( - source => 'sub { tied($xxx)->can(@_) }', - environment => { '$xxx' => \$var }, - alias => 1, - ); - - ok( $nother_closure->('method_of_mine'), '... can'); - ok(!$nother_closure->('your_method'), '... !can'); - - is_deeply( - \@store, - [ 1 .. 3], - '... tie still works', - ); - { package OtherTie; our @ISA = 'MyTie'; sub method_of_mine { 666 } } - tie($var, 'OtherTie'); - is($closure->(4), 666, '... can be retied'); + tie(my($var), 'MyTie'); + + $var = 1; + + subtest "tied variables can be closed over (even with tied alias implementation)" => sub { + + my $closure = eval_closure( + source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); + $closure->(3); + + my $nother_closure = eval_closure( + source => 'sub { tied($xxx)->can(@_) }', + environment => { '$xxx' => \$var }, + alias => 1, + ); + + ok( $nother_closure->('method_of_mine'), '... can'); + ok(!$nother_closure->('your_method'), '... !can'); - untie($var); - my $e = exception { $closure->(5) }; - like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); + is_deeply( + \@store, + [ 1 .. 3], + '... tie still works', + ); + + tie($var, 'OtherTie'); + is($closure->(4), 666, '... can be retied'); + + untie($var); + my $e = exception { $closure->(5) }; + like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); + }; } my $c1 = eval_closure(source => 'sub { die("BANG") }', description => 'test1'); @@ -174,4 +208,29 @@ '"line" option works', ); +subtest "exception for syntax error" => sub { + my $e3 = exception { eval_closure source => 'sub {' }; + ok( $e3->isa('Error::TypeTiny::Compilation'), 'proper exceptions thrown for compilation errors' ); + is( $e3->code, 'sub {', '$exception->code' ); + like( $e3->errstr, qr/Missing right curly/, '$exception->errstr' ); + is( ref $e3->context, 'HASH', '$exception->context' ); +}; + +subtest "exception for syntax error (given arrayref)" => sub { + my $e3 = exception { eval_closure source => ['sub {', ''] }; + ok( $e3->isa('Error::TypeTiny::Compilation'), 'proper exceptions thrown for compilation errors' ); + is( $e3->code, "sub {\n", '$exception->code' ); + like( $e3->errstr, qr/Missing right curly/, '$exception->errstr' ); + is( ref $e3->context, 'HASH', '$exception->context' ); +}; + +subtest "exception for wrong reference type" => sub { + my $e3 = exception { eval_closure source => 'sub {', environment => { '%foo' => [] } }; + ok($e3->isa('Error::TypeTiny'), 'exception was thrown'); + if (Eval::TypeTiny::_EXTENDED_TESTING) { + like($e3->message, qr/^Expected a variable name and ref/, 'correct exception message'); + } +}; + + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/fallback-aliases.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/fallback-aliases.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/fallback-aliases.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/fallback-aliases.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -=pod - -=encoding utf-8 - -=head1 PURPOSE - -Tests L supports alias=>1 even when L -is unavailable. - -=head1 DEPENDENCIES - -Requires L. - -=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 lib qw( ./lib ./t/lib ../inc ./inc ); - -use Test::More; - -BEGIN { plan skip_all => "test currently not working (TODO)" }; - -use Test::Requires 'Test::Without::Module'; -use Test::Without::Module 'Devel::LexAlias'; - -use Eval::TypeTiny; - -my %env = ( - '$foo' => do { my $x = "foo"; \$x }, - '@bar' => [ "bar" ], - '%baz' => { "baz" => "1" }, -); - -my $source = <<'SRC'; -sub { - return $foo if $_[0] eq '$foo'; - return @bar if $_[0] eq '@bar'; - return %baz if $_[0] eq '%baz'; - return; -} -SRC - -my $closure = eval_closure(source => $source, environment => \%env); - -is_deeply( - [ $closure->('$foo') ], - [ 'foo' ], - 'closure over scalar', -); - -is_deeply( - [ $closure->('@bar') ], - [ 'bar' ], - 'closure over array', -); - -is_deeply( - [ $closure->('%baz') ], - [ 'baz' => 1 ], - 'closure over hash', -); - -my $external = 40; -my $closure2 = eval_closure( - source => 'sub { $xxx += 2 }', - environment => { '$xxx' => \$external }, - alias => 1, -); - -$closure2->(); -is($external, 42, 'closing over variables really really really works!'); - -{ - my $destroyed = 0; - - { - package MyIndicator; - sub DESTROY { $destroyed++ } - } - - { - my $number = bless \(my $foo), "MyIndicator"; - $$number = 40; - my $closure = eval_closure( - source => 'sub { $$xxx += 2 }', - environment => { '$xxx' => \$number }, - alias => 1, - ); - - $closure->(); - - is($$number, 42); - is($destroyed, 0); - } - - is($destroyed, 1, 'closed over variables disappear on cue'); -} - -{ - my @store; - - { - package MyTie; - use Tie::Scalar (); - our @ISA = 'Tie::StdScalar'; - sub STORE { - my $self = shift; - push @store, $_[0]; - $self->SUPER::STORE(@_); - } - sub method_of_mine { 42 } - } - - tie(my($var), 'MyTie'); - - $var = 1; - - my $closure = eval_closure( - source => 'sub { $xxx = $_[0]; tied($xxx)->method_of_mine }', - environment => { '$xxx' => \$var }, - alias => 1, - ); - - is($closure->(2), 42, 'can close over tied variables ... AUTOLOAD stuff'); - $closure->(3); - - my $nother_closure = eval_closure( - source => 'sub { tied($xxx)->can(@_) }', - environment => { '$xxx' => \$var }, - alias => 1, - ); - - ok( $nother_closure->('method_of_mine'), '... can'); - ok(!$nother_closure->('your_method'), '... !can'); - - is_deeply( - \@store, - [ 1 .. 3], - '... tie still works', - ); - - { - package OtherTie; - our @ISA = 'MyTie'; - sub method_of_mine { 666 } - } - - tie($var, 'OtherTie'); - is($closure->(4), 666, '... can be retied'); - - untie($var); - my $e = exception { $closure->(5) }; - like($e, qr{^Can't call method "method_of_mine" on an undefined value}, '... can be untied'); -} - -my $e = exception { eval_closure(source => 'sub { 1 ]') }; - -isa_ok( - $e, - 'Error::TypeTiny::Compilation', - '$e', -); - -like( - $e, - qr{^Failed to compile source because: syntax error}, - 'throw exception when code does not compile', -); - -like( - $e->errstr, - qr{^syntax error}, - '$e->errstr', -); - -like( - $e->code, - qr{sub \{ 1 \]}, - '$e->code', -); - -my $c1 = eval_closure(source => 'sub { die("BANG") }', description => 'test1'); -my $e1 = exception { $c1->() }; - -like( - $e1, - qr{^BANG at test1 line 1}, - '"description" option works', -); - -my $c2 = eval_closure(source => 'sub { die("BANG") }', description => 'test2', line => 222); -my $e2 = exception { $c2->() }; - -like( - $e2, - qr{^BANG at test2 line 222}, - '"line" option works', -); - -done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/lexical-subs.t libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/lexical-subs.t --- libtype-tiny-perl-1.000005/t/20-unit/Eval-TypeTiny/lexical-subs.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Eval-TypeTiny/lexical-subs.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -40,6 +40,7 @@ my $source = <<'SRC'; sub { + package Kill::La::NonLexikill; return $foo if $_[0] eq '$foo'; return @bar if $_[0] eq '@bar'; return %baz if $_[0] eq '%baz'; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Test-TypeTiny/basic.t libtype-tiny-perl-1.004004/t/20-unit/Test-TypeTiny/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Test-TypeTiny/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Test-TypeTiny/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Test-TypeTiny/extended.t libtype-tiny-perl-1.004004/t/20-unit/Test-TypeTiny/extended.t --- libtype-tiny-perl-1.000005/t/20-unit/Test-TypeTiny/extended.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Test-TypeTiny/extended.t 2019-01-08 18:26:35.000000000 +0000 @@ -20,7 +20,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Test-TypeTiny/matchfor.t libtype-tiny-perl-1.004004/t/20-unit/Test-TypeTiny/matchfor.t --- libtype-tiny-perl-1.000005/t/20-unit/Test-TypeTiny/matchfor.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Test-TypeTiny/matchfor.t 2019-01-08 18:26:35.000000000 +0000 @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -38,7 +38,7 @@ if (eval { require Test::Tester }) { require Test::More; - Test::Tester->import(tests => 24); + Test::Tester->import(tests => 6); } else { @@ -49,53 +49,96 @@ use Test::TypeTiny qw(matchfor); -check_test( - sub { - Test::More::is( - "Hello world", - matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), - 'Yahoo', - ); - }, - { - ok => 1, - name => 'Yahoo', - diag => '', - type => '', - }, - 'successful matchfor(qr//)', -); - -check_test( - sub { - Test::More::is( - "Hiya world", - matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), - 'Yahoo', - ); - }, - { - ok => 1, - name => 'Yahoo', - diag => '', - type => '', - }, - 'successful matchfor(qr//)', -); - -check_test( - sub { - Test::More::is( - bless({}, "Greeting::Global"), - matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), - 'Yahoo', - ); - }, - { - ok => 1, - name => 'Yahoo', - diag => '', - type => '', - }, - 'successful matchfor(CLASS)', -); +my $mf = matchfor("foo", "bar"); +Test::More::is("$mf", "foo", "stringification"); + +Test::More::subtest "successful matchfor(qr//)" => sub { + check_test( + sub { + Test::More::is( + "Hello world", + matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), + 'ONE', + ); + }, + { + ok => 1, + name => 'ONE', + diag => '', + type => '', + }, + 'successful matchfor(qr//)', + ); +}; + +Test::More::subtest "successful matchfor(qr//) 2" => sub { + check_test( + sub { + Test::More::is( + "Hiya world", + matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), + 'TWO', + ); + }, + { + ok => 1, + name => 'TWO', + diag => '', + type => '', + }, + 'successful matchfor(qr//)', + ); +}; + +Test::More::subtest 'unsuccessful matchfor(qr//)' => sub { + check_test( + sub { + Test::More::is( + "Booooooooooooooo", + matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), + 'THREE', + ); + }, + { + ok => 0, + name => 'THREE', + }, + 'unsuccessful matchfor(qr//)', + ); +}; + +Test::More::subtest 'successful matchfor(CLASS)' => sub { + check_test( + sub { + Test::More::is( + bless({}, "Greeting::Global"), + matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), + 'FOUR', + ); + }, + { + ok => 1, + name => 'FOUR', + diag => '', + type => '', + }, + 'successful matchfor(CLASS)', + ); +}; + +Test::More::subtest 'unsuccessful successful matchfor(CLASS)' => sub { + check_test( + sub { + Test::More::is( + bless({}, "Greeting::Local"), + matchfor(qr/hello/i, qr/hiya/i, "Greeting::Global"), + 'FIVE', + ); + }, + { + ok => 0, + name => 'FIVE', + }, + 'unsuccessful successful matchfor(CLASS)', + ); +}; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -181,4 +181,28 @@ is($arrayref_from_piped->coercibles, $arrayref_from_piped->coercibles, '$arrayref_from_piped->coercibles == $arrayref_from_piped->coercibles'); +# ensure that add_type_coercion can handle Type::Coercions +subtest 'add a Type::Coercion to a Type::Coercion' => sub { + + my $coercion = Type::Coercion->new; + ok( + !$coercion->has_coercion_for_type( Str ), + "empty coercion can't coerce a Str" + ); + + is( exception { $coercion->add_type_coercions( ArrayRefFromPiped ) }, + undef, "add a coercion from Str" ); + + ok( + $coercion->has_coercion_for_type( Str ), + "check that coercion was added" + ); + + # now see if coercion actually works + my $arrayref_from_piped = ArrayRef->plus_coercions($coercion); + my $coercibles = $arrayref_from_piped->coercibles; + should_pass('1|2|3', $coercibles, "can coerce from a Str"); +}; + + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/esoteric.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/esoteric.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/esoteric.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/esoteric.t 2019-01-08 18:26:35.000000000 +0000 @@ -15,7 +15,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/frozen.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/frozen.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/frozen.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/frozen.t 2019-01-08 18:26:35.000000000 +0000 @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/inlining.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/inlining.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/inlining.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/inlining.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/parameterized.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/parameterized.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/parameterized.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/parameterized.t 2019-01-08 18:26:35.000000000 +0000 @@ -13,7 +13,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/smartmatch.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/smartmatch.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/smartmatch.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/smartmatch.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -24,18 +24,19 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; +use Type::Tiny (); BEGIN { - $] < 5.010001 ? plan(skip_all => "Perl too old") : - $] >= 5.021000 ? plan(skip_all => "Perl too new") : - $] >= 5.018000 ? warnings->unimport('experimental::smartmatch') : - (); -}; + Type::Tiny::SUPPORT_SMARTMATCH + or plan skip_all => 'smartmatch support not available for this version or Perl'; +} use Types::Standard qw( Num Int ); my $type = Int->plus_coercions( Num, sub{+int} ); +no warnings; #!! + ok ( 3.1 ~~ $type->coercion ); ok not ( [ ] ~~ $type->coercion ); diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/typetiny-constructor.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/typetiny-constructor.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion/typetiny-constructor.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion/typetiny-constructor.t 2019-01-08 18:26:35.000000000 +0000 @@ -13,7 +13,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion-FromMoose/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion-FromMoose/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion-FromMoose/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion-FromMoose/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -8,7 +8,7 @@ =head1 DEPENDENCIES -Moose 2.0600; otherwise skipped. +Moose 2.0000; otherwise skipped. =head1 AUTHOR @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -28,7 +28,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { Moose => '2.0600' }; +use Test::Requires { Moose => '2.0000' }; use Test::TypeTiny; use Moose::Util::TypeConstraints; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion-FromMoose/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion-FromMoose/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion-FromMoose/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion-FromMoose/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -8,7 +8,7 @@ =head1 DEPENDENCIES -Moose 2.0600; otherwise skipped. +Moose 2.0000; otherwise skipped. =head1 AUTHOR @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -28,7 +28,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { Moose => '2.0600' }; +use Test::Requires { Moose => '2.0000' }; use Test::Fatal; use Types::Standard -types; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion-Union/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion-Union/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Coercion-Union/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Coercion-Union/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/assert.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/assert.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/assert.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/assert.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/deprecation.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/deprecation.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/deprecation.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/deprecation.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,75 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks Type::Library warns about deprecated types. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::Fatal; +use Test::TypeTiny; + +use Type::Tiny; + +BEGIN { + package Local::Library; + use Type::Library -base; + my $t1 = Type::Tiny->new(name => "Base"); + my $t2 = Type::Tiny->new(name => "Derived_1", parent => $t1); + my $t3 = Type::Tiny->new(name => "Derived_2", parent => $t1, deprecated => 1); + my $t4 = Type::Tiny->new(name => "Double_Derived_1", parent => $t3); + my $t5 = Type::Tiny->new(name => "Double_Derived_2", parent => $t3, deprecated => 0); + __PACKAGE__->meta->add_type($_) for $t1, $t2, $t3, $t4, $t5; + $INC{'Local/Library.pm'} = __FILE__; +}; + +{ + my @WARNINGS; + sub get_warnings { [@WARNINGS] } + sub reset_warnings { @WARNINGS = () } + $SIG{__WARN__} = sub { push @WARNINGS, $_[0] }; +}; + +reset_warnings(); +eval q{ + package Local::Example1; + use Local::Library qw(Derived_1); + 1; +} or die($@); +is_deeply(get_warnings(), []); + +reset_warnings(); +eval q{ + package Local::Example2; + use Local::Library qw(Derived_2); + 1; +} or die($@); +like(get_warnings()->[0], qr/^Exporting deprecated type Derived_2 to package Local::Example2/); + +reset_warnings(); +eval q{ + package Local::Example3; + use Local::Library -allow_deprecated, qw(Derived_2); + 1; +} or die($@); +is_deeply(get_warnings(), []); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/inheritance.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/inheritance.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/inheritance.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/inheritance.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/is.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/is.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/is.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/is.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/to.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/to.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/to.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/to.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Library/types.t libtype-tiny-perl-1.004004/t/20-unit/Type-Library/types.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Library/types.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Library/types.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/badsigs.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/badsigs.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/badsigs.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/badsigs.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/carping.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/carping.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/carping.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/carping.t 2019-01-08 18:26:35.000000000 +0000 @@ -14,7 +14,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/coerce.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/coerce.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/coerce.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/coerce.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/compile-named-bless.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/compile-named-bless.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/compile-named-bless.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/compile-named-bless.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,363 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test L' brand spanking new C function. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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::Fatal; + +use Type::Params qw(compile_named validate_named); +use Types::Standard -types, "slurpy"; +use Type::Utils; +use Scalar::Util qw(refaddr); + +{ + package # hide + Type::Tiny::_Test::Blessed; + sub new { bless $_[1], 'Type::Tiny::_Test::Constructed' } + sub new2 { bless $_[1], 'Type::Tiny::_Test::Constructed2' } +} + +sub simple_test { + my ($name, @spec) = @_; + unshift @spec, my $opts = {}; + my $expected_class = undef; + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name => sub { + subtest "bless => CLASS" => sub { + %$opts = (bless => 'Type::Tiny::_Test::Blessed'); + $expected_class = 'Type::Tiny::_Test::Blessed'; + _simple_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _simple_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + subtest "class => CLASS" => sub { + %$opts = (class => 'Type::Tiny::_Test::Blessed'); + $expected_class = 'Type::Tiny::_Test::Constructed'; + _simple_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _simple_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + subtest "class => [CLASS, METHOD]" => sub { + %$opts = (class => ['Type::Tiny::_Test::Blessed', 'new2']); + $expected_class = 'Type::Tiny::_Test::Constructed2'; + _simple_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _simple_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + subtest "class => CLASS, constructor METHOD" => sub { + %$opts = (class => 'Type::Tiny::_Test::Blessed', constructor => 'new2'); + $expected_class = 'Type::Tiny::_Test::Constructed2'; + _simple_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _simple_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + }; +} + +sub slurpy_test { + my ($name, @spec) = @_; + unshift @spec, my $opts = {}; + my $expected_class = undef; + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name => sub { + subtest "bless => CLASS" => sub { + %$opts = (bless => 'Type::Tiny::_Test::Blessed'); + $expected_class = 'Type::Tiny::_Test::Blessed'; + _slurpy_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _slurpy_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + subtest "class => CLASS" => sub { + %$opts = (class => 'Type::Tiny::_Test::Blessed'); + $expected_class = 'Type::Tiny::_Test::Constructed'; + _slurpy_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _slurpy_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + subtest "class => [CLASS, METHOD]" => sub { + %$opts = (class => ['Type::Tiny::_Test::Blessed', 'new2']); + $expected_class = 'Type::Tiny::_Test::Constructed2'; + _slurpy_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _slurpy_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + subtest "class => CLASS, constructor METHOD" => sub { + %$opts = (class => 'Type::Tiny::_Test::Blessed', constructor => 'new2'); + $expected_class = 'Type::Tiny::_Test::Constructed2'; + _slurpy_test( validate_named => $expected_class, sub { validate_named(\@_, $opts, @spec) } ); + _slurpy_test( compile_named => $expected_class, compile_named($opts, @spec) ); + }; + }; +} + +sub _simple_test { + my ($name, $expected_class, $check) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name, sub + { + is_deeply( + $check->( foo => 3, bar => 42 ), + bless({ foo => 3, bar => 42 }, $expected_class), + 'accept a hash', + ); + + is_deeply( + $check->( foo => 3, bar => 42, baz => [1..3] ), + bless({ foo => 3, bar => 42, baz => [1..3] }, $expected_class), + 'accept a hash, with optional parameter', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42 ), + bless({ foo => 3, bar => 42 }, $expected_class), + 'accept a hash, and coerce', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42, baz => [1..3, 4.2] ), + bless({ foo => 3, bar => 42, baz => [1..4] }, $expected_class), + 'accept a hash, with optional parameter, and coerce', + ); + + is_deeply( + $check->({ foo => 3, bar => 42 }), + bless({ foo => 3, bar => 42 }, $expected_class), + 'accept a hashref', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, baz => [1..3] }), + bless({ foo => 3, bar => 42, baz => [1..3] }, $expected_class), + 'accept a hashref, with optional parameter', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42 }), + bless({ foo => 3, bar => 42 }, $expected_class), + 'accept a hashref, and coerce', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42, baz => [1..3, 4.2] }), + bless({ foo => 3, bar => 42, baz => [1..4] }, $expected_class), + 'accept a hashref, with optional parameter, and coerce', + ); + + like( + exception { $check->({ foo => [], bar => 42 }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "foo" parameter', + ); + + like( + exception { $check->({ foo => 3, bar => [] }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "bar" parameter', + ); + + like( + exception { $check->({ foo => {}, bar => [] }) }, + qr/^Reference \{\} did not pass type constraint/, + 'two bad parameters; "foo" throws before "bar" gets a chance', + ); + + like( + exception { $check->({ foo => 3, bar => 42, baz => {} }) }, + qr/^Reference \{\} did not pass type constraint/, + 'bad optional "baz" parameter', + ); + + like( + exception { $check->({ foo => 3, bar => 42, xxx => 1 }) }, + qr/^Unrecognized parameter: xxx/, + 'additional parameter', + ); + + like( + exception { $check->({ foo => 3, bar => 42, xxx => 1, yyy => 2, zzz => 3 }) }, + qr/^Unrecognized parameters: xxx, yyy, and zzz/, + 'additional parameters', + ); + + like( + exception { $check->({ }) }, + qr/^Missing required parameter: foo/, + 'missing parameter', + ); + }; +} + +sub _slurpy_test { + my ($name, $expected_class, $check) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name, sub + { + is_deeply( + $check->( foo => 3, bar => 42 ), + bless({ XXX => {}, foo => 3, bar => 42 }, $expected_class), + 'accept a hash', + ); + + is_deeply( + $check->( foo => 3, bar => 42, baz => [1..3] ), + bless({ XXX => {}, foo => 3, bar => 42, baz => [1..3] }, $expected_class), + 'accept a hash, with optional parameter', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42 ), + bless({ XXX => {}, foo => 3, bar => 42 }, $expected_class), + 'accept a hash, and coerce', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42, baz => [1..3, 4.2] ), + bless({ XXX => {}, foo => 3, bar => 42, baz => [1..4] }, $expected_class), + 'accept a hash, with optional parameter, and coerce', + ); + + is_deeply( + $check->({ foo => 3, bar => 42 }), + bless({ XXX => {}, foo => 3, bar => 42 }, $expected_class), + 'accept a hashref', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, baz => [1..3] }), + bless({ XXX => {}, foo => 3, bar => 42, baz => [1..3] }, $expected_class), + 'accept a hashref, with optional parameter', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42 }), + bless({ XXX => {}, foo => 3, bar => 42 }, $expected_class), + 'accept a hashref, and coerce', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42, baz => [1..3, 4.2] }), + bless({ XXX => {}, foo => 3, bar => 42, baz => [1..4] }, $expected_class), + 'accept a hashref, with optional parameter, and coerce', + ); + + like( + exception { $check->({ foo => [], bar => 42 }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "foo" parameter', + ); + + like( + exception { $check->({ foo => 3, bar => [] }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "bar" parameter', + ); + + like( + exception { $check->({ foo => {}, bar => [] }) }, + qr/^Reference \{\} did not pass type constraint/, + 'two bad parameters; "foo" throws before "bar" gets a chance', + ); + + like( + exception { $check->({ foo => 3, bar => 42, baz => {} }) }, + qr/^Reference \{\} did not pass type constraint/, + 'bad optional "baz" parameter', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, xxx => 1 }), + { XXX => { xxx => 1 }, foo => 3, bar => 42 }, + 'additional parameter', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, xxx => 1, yyy => 2, zzz => 3 }), + { XXX => { xxx => 1, yyy => 2, zzz => 3 }, foo => 3, bar => 42 }, + 'additional parameters', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, xxx => 1.1, yyy => 2.2, zzz => 3 }), + { XXX => { xxx => 1, yyy => 2, zzz => 3 }, foo => 3, bar => 42 }, + 'coercion of additional parameters', + ); + + like( + exception { $check->({ }) }, + qr/^Missing required parameter: foo/, + 'missing parameter', + ); + }; +} + + +my $Rounded; + +$Rounded = Int->plus_coercions(Num, q{ int($_) }); +simple_test( + "simple test with everything inlineable", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], +); + +$Rounded = Int->plus_coercions(Num, sub { int($_) }); +simple_test( + "simple test with inlineable types, but non-inlineable coercion", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], +); + +$Rounded = Int->where(sub { !!1 })->plus_coercions(Num, sub { int($_) }); +simple_test( + "simple test with everything non-inlineable", + foo => $Rounded, + bar => Int->where(sub { !!1 }), + baz => Optional[ArrayRef->of($Rounded)], +); + +$Rounded = Int->plus_coercions(Num, q{ int($_) }); +slurpy_test( + "slurpy test with everything inlineable", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], + XXX => slurpy HashRef[$Rounded], +); + +$Rounded = Int->plus_coercions(Num, sub { int($_) }); +slurpy_test( + "slurpy test with inlineable types, but non-inlineable coercion", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], + XXX => slurpy HashRef[$Rounded], +) if 0; + +$Rounded = Int->where(sub { !!1 })->plus_coercions(Num, sub { int($_) }); +slurpy_test( + "slurpy test with everything non-inlineable", + foo => $Rounded, + bar => Int->where(sub { !!1 }), + baz => Optional[ArrayRef->of($Rounded)], + XXX => slurpy HashRef[$Rounded], +) if 0; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/compile-named-oo.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/compile-named-oo.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/compile-named-oo.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/compile-named-oo.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,86 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test L C function. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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::Fatal; + +use Type::Params qw( compile_named_oo ); +use Types::Standard qw( -types ); + + +my $coderef = compile_named_oo( + foo => Int, + bar => Optional[Int], + baz => Optional[HashRef], { getter => 'bazz', predicate => 'haz' }, +); + +ok(CodeRef->check($coderef), 'compile_named_oo returns a coderef'); + +my @object; +$object[0] = $coderef->( foo => 42, bar => 69, baz => { quux => 666 } ); +$object[1] = $coderef->({ foo => 42, bar => 69, baz => { quux => 666 } }); +$object[2] = $coderef->( foo => 42 ); +$object[3] = $coderef->({ foo => 42 }); + +for my $i (0 .. 1) { + ok(Object->check($object[$i]), "\$object[$i] is an object"); + can_ok($object[$i], qw( foo bar has_bar bazz haz )); + is($object[$i]->foo, 42, "\$object[$i]->foo == 42"); + is($object[$i]->bar, 69, "\$object[$i]->bar == 69"); + is($object[$i]->bazz->{quux}, 666, "\$object[$i]->bazz->{quux} == 666"); + ok($object[$i]->has_bar, "\$object[$i]->has_bar"); + ok($object[$i]->haz, "\$object[$i]->haz"); + ok(! $object[$i]->can("has_foo"), 'no has_foo method'); + ok(! $object[$i]->can("has_baz"), 'no has_baz method'); +} + +for my $i (2 .. 3) { + ok(Object->check($object[$i]), "\$object[$i] is an object"); + can_ok($object[$i], qw( foo bar has_bar bazz haz )); + is($object[$i]->foo, 42, "\$object[$i]->foo == 42"); + is($object[$i]->bar, undef, "not defined \$object[$i]->bar"); + is($object[$i]->bazz, undef, "not defined \$object[$i]->bazz"); + ok(! $object[$i]->has_bar, "!\$object[$i]->has_bar"); + ok(! $object[$i]->haz, "!\$object[$i]->haz"); + ok(! $object[$i]->can("has_foo"), 'no has_foo method'); + ok(! $object[$i]->can("has_baz"), 'no has_baz method'); +} + + +my $e = exception { + compile_named_oo( 999 => Int ); +}; +ok(Object->check($e), 'exception thrown for bad accessor name'); +like($e->message, qr/bad accessor name/i, 'correct message'); + + +my $coderef2 = compile_named_oo( + bar => Optional[ArrayRef], + baz => Optional[CodeRef], { getter => 'bazz', predicate => 'haz' }, + foo => Num, +); +my $coderef2obj = $coderef2->(foo => 1.1, bar => []); +is(ref($object[0]), ref($coderef2obj), 'packages reused when possible'); + + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/compile-named.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/compile-named.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/compile-named.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/compile-named.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,318 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test L' brand spanking new C function. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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::Fatal; + +use Type::Params qw(compile_named validate_named); +use Types::Standard -types, "slurpy"; +use Type::Utils; +use Scalar::Util qw(refaddr); + + +{ + package + Type::Tiny::_Test::X; + sub new { bless $_[1], $_[0] } +} + +sub simple_test { + my ($name, @spec) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name => sub { + _simple_test( validate_named => sub { validate_named(\@_, @spec) } ); + _simple_test( compile_named => compile_named(@spec) ); + }; +} + +sub slurpy_test { + my ($name, @spec) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name => sub { + _slurpy_test( validate_named => sub { validate_named(\@_, @spec) } ); + _slurpy_test( compile_named => compile_named(@spec) ); + }; +} + +sub _simple_test { + my ($name, $check) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name, sub + { + is_deeply( + $check->( foo => 3, bar => 42 ), + { foo => 3, bar => 42 }, + 'accept a hash', + ); + + is_deeply( + $check->( foo => 3, bar => 42, baz => [1..3] ), + { foo => 3, bar => 42, baz => [1..3] }, + 'accept a hash, with optional parameter', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42 ), + { foo => 3, bar => 42 }, + 'accept a hash, and coerce', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42, baz => [1..3, 4.2] ), + { foo => 3, bar => 42, baz => [1..4] }, + 'accept a hash, with optional parameter, and coerce', + ); + + is_deeply( + $check->({ foo => 3, bar => 42 }), + { foo => 3, bar => 42 }, + 'accept a hashref', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, baz => [1..3] }), + { foo => 3, bar => 42, baz => [1..3] }, + 'accept a hashref, with optional parameter', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42 }), + { foo => 3, bar => 42 }, + 'accept a hashref, and coerce', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42, baz => [1..3, 4.2] }), + { foo => 3, bar => 42, baz => [1..4] }, + 'accept a hashref, with optional parameter, and coerce', + ); + + like( + exception { $check->({ foo => [], bar => 42 }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "foo" parameter', + ); + + like( + exception { $check->({ foo => 3, bar => [] }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "bar" parameter', + ); + + like( + exception { $check->({ foo => {}, bar => [] }) }, + qr/^Reference \{\} did not pass type constraint/, + 'two bad parameters; "foo" throws before "bar" gets a chance', + ); + + like( + exception { $check->({ foo => 3, bar => 42, baz => {} }) }, + qr/^Reference \{\} did not pass type constraint/, + 'bad optional "baz" parameter', + ); + + like( + exception { $check->({ foo => 3, bar => 42, xxx => 1 }) }, + qr/^Unrecognized parameter: xxx/, + 'additional parameter', + ); + + like( + exception { $check->({ foo => 3, bar => 42, xxx => 1, yyy => 2, zzz => 3 }) }, + qr/^Unrecognized parameters: xxx, yyy, and zzz/, + 'additional parameters', + ); + + like( + exception { $check->({ }) }, + qr/^Missing required parameter: foo/, + 'missing parameter', + ); + }; +} + +sub _slurpy_test { + my ($name, $check) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; + subtest $name, sub + { + is_deeply( + $check->( foo => 3, bar => 42 ), + { XXX => {}, foo => 3, bar => 42 }, + 'accept a hash', + ); + + is_deeply( + $check->( foo => 3, bar => 42, baz => [1..3] ), + { XXX => {}, foo => 3, bar => 42, baz => [1..3] }, + 'accept a hash, with optional parameter', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42 ), + { XXX => {}, foo => 3, bar => 42 }, + 'accept a hash, and coerce', + ); + + is_deeply( + $check->( foo => 3.1, bar => 42, baz => [1..3, 4.2] ), + { XXX => {}, foo => 3, bar => 42, baz => [1..4] }, + 'accept a hash, with optional parameter, and coerce', + ); + + is_deeply( + $check->({ foo => 3, bar => 42 }), + { XXX => {}, foo => 3, bar => 42 }, + 'accept a hashref', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, baz => [1..3] }), + { XXX => {}, foo => 3, bar => 42, baz => [1..3] }, + 'accept a hashref, with optional parameter', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42 }), + { XXX => {}, foo => 3, bar => 42 }, + 'accept a hashref, and coerce', + ); + + is_deeply( + $check->({ foo => 3.1, bar => 42, baz => [1..3, 4.2] }), + { XXX => {}, foo => 3, bar => 42, baz => [1..4] }, + 'accept a hashref, with optional parameter, and coerce', + ); + + like( + exception { $check->({ foo => [], bar => 42 }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "foo" parameter', + ); + + like( + exception { $check->({ foo => 3, bar => [] }) }, + qr/^Reference \[\] did not pass type constraint/, + 'bad "bar" parameter', + ); + + like( + exception { $check->({ foo => {}, bar => [] }) }, + qr/^Reference \{\} did not pass type constraint/, + 'two bad parameters; "foo" throws before "bar" gets a chance', + ); + + like( + exception { $check->({ foo => 3, bar => 42, baz => {} }) }, + qr/^Reference \{\} did not pass type constraint/, + 'bad optional "baz" parameter', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, xxx => 1 }), + { XXX => { xxx => 1 }, foo => 3, bar => 42 }, + 'additional parameter', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, xxx => 1, yyy => 2, zzz => 3 }), + { XXX => { xxx => 1, yyy => 2, zzz => 3 }, foo => 3, bar => 42 }, + 'additional parameters', + ); + + is_deeply( + $check->({ foo => 3, bar => 42, xxx => 1.1, yyy => 2.2, zzz => 3 }), + { XXX => { xxx => 1, yyy => 2, zzz => 3 }, foo => 3, bar => 42 }, + 'coercion of additional parameters', + ); + + like( + exception { $check->({ }) }, + qr/^Missing required parameter: foo/, + 'missing parameter', + ); + }; +} + + +my $Rounded; + +$Rounded = Int->plus_coercions(Num, q{ int($_) }); +simple_test( + "simple test with everything inlineable", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], +); + +$Rounded = Int->plus_coercions(Num, sub { int($_) }); +simple_test( + "simple test with inlineable types, but non-inlineable coercion", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], +); + +$Rounded = Int->where(sub { !!1 })->plus_coercions(Num, sub { int($_) }); +simple_test( + "simple test with everything non-inlineable", + foo => $Rounded, + bar => Int->where(sub { !!1 }), + baz => Optional[ArrayRef->of($Rounded)], +); + +$Rounded = Int->plus_coercions(Num, q{ int($_) }); +slurpy_test( + "slurpy test with everything inlineable", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], + XXX => slurpy HashRef[$Rounded], +); + +$Rounded = Int->plus_coercions(Num, sub { int($_) }); +slurpy_test( + "slurpy test with inlineable types, but non-inlineable coercion", + foo => $Rounded, + bar => Int, + baz => Optional[ArrayRef->of($Rounded)], + XXX => slurpy HashRef[$Rounded], +); + +$Rounded = Int->where(sub { !!1 })->plus_coercions(Num, sub { int($_) }); +slurpy_test( + "slurpy test with everything non-inlineable", + foo => $Rounded, + bar => Int->where(sub { !!1 }), + baz => Optional[ArrayRef->of($Rounded)], + XXX => slurpy HashRef[$Rounded], +); + + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/defaults.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/defaults.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/defaults.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/defaults.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,137 @@ +use Test::More; +use Test::Fatal; +use Types::Standard -types; +use Type::Params qw( compile compile_named ); + +my @rv; +is( + exception { @rv = compile(Int, { default => 42 } )->() }, + undef, + 'compile: no exception thrown because of defaulted argument' +); + +is_deeply( + \@rv, + [42], + 'compile: default applied correctly' +); + +@rv = (); +is( + exception { @rv = compile(Int, { default => sub { 42 } } )->() }, + undef, + 'compile: no exception thrown because of defaulted argument via coderef' +); + +is_deeply( + \@rv, + [42], + 'compile: default applied correctly via coderef' +); + +@rv = (); +is( + exception { @rv = compile(ArrayRef, { default => [] } )->() }, + undef, + 'compile: no exception thrown because of defaulted argument via arrayref' +); + +is_deeply( + \@rv, + [[]], + 'compile: default applied correctly via arrayref' +); + +@rv = (); +is( + exception { @rv = compile(HashRef, { default => {} } )->() }, + undef, + 'compile: no exception thrown because of defaulted argument via hashref' +); + +is_deeply( + \@rv, + [{}], + 'compile: default applied correctly via hashref' +); + +@rv = (); +is( + exception { @rv = compile(Any, { default => undef } )->() }, + undef, + 'compile: no exception thrown because of defaulted argument via undef' +); + +is_deeply( + \@rv, + [undef], + 'compile: default applied correctly via undef' +); + +@rv = (); +is( + exception { @rv = compile_named(thing => Int, { default => 42 } )->() }, + undef, + 'compile_named: no exception thrown because of defaulted argument' +); + +is_deeply( + \@rv, + [{ thing => 42 }], + 'compile_named: default applied correctly' +); + +@rv = (); +is( + exception { @rv = compile_named(thing => Int, { default => sub { 42 } } )->() }, + undef, + 'compile_named: no exception thrown because of defaulted argument via coderef' +); + +is_deeply( + \@rv, + [{ thing => 42 }], + 'compile_named: default applied correctly via coderef' +); + +@rv = (); +is( + exception { @rv = compile_named(thing => ArrayRef, { default => [] } )->() }, + undef, + 'compile_named: no exception thrown because of defaulted argument via arrayref' +); + +is_deeply( + \@rv, + [{ thing => [] }], + 'compile_named: default applied correctly via arrayref' +); + +@rv = (); +is( + exception { @rv = compile_named(thing => HashRef, { default => {} } )->() }, + undef, + 'compile_named: no exception thrown because of defaulted argument via hashref' +); + +is_deeply( + \@rv, + [{ thing => {} }], + 'compile_named: default applied correctly via hashref' +); + +@rv = (); +is( + exception { @rv = compile_named(thing => Any, { default => undef } )->() }, + undef, + 'compile_named: no exception thrown because of defaulted argument via undef' +); + +is_deeply( + \@rv, + [{ thing => undef }], + 'compile_named: default applied correctly via undef' +); + + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/hashorder.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/hashorder.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/hashorder.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/hashorder.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,69 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test L' brand spanking new C function. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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::Fatal; + +use Type::Params qw(compile_named); +use Types::Standard qw(Int); + +subtest "predictable error message when problems with two parameters" => sub { + for my $i (1..20) { + my $check1 = compile_named( a => Int, b => Int ); + my $check2 = compile_named( b => Int, a => Int ); + like( + exception { $check1->() }, + qr/Missing required parameter: a/, + "Iteration $i, check 1, missing parameters", + ); + like( + exception { $check1->(a => [], b => {}) }, + qr/Reference \[\] did not pass type constraint "Int"/, + "Iteration $i, check 1, invalid values", + ); + like( + exception { $check1->(a => 1, b => 2, c => '3PO', r2d => 2) }, + qr/Unrecognized parameters: c and r2d/, + "Iteration $i, check 1, extra values", + ); + like( + exception { $check2->() }, + qr/Missing required parameter: b/, + "Iteration $i, check 2, missing parameters", + ); + like( + exception { $check2->(a => [], b => {}) }, + qr/Reference \{\} did not pass type constraint "Int"/, + "Iteration $i, check 2, invalid values", + ); + like( + exception { $check2->(a => 1, b => 2, c => '3PO', r2d => 2) }, + qr/Unrecognized parameters: c and r2d/, + "Iteration $i, check 2, extra values", + ); + } +}; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/methods.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/methods.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/methods.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/methods.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/mixednamed.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/mixednamed.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/mixednamed.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/mixednamed.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/multisig.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/multisig.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/multisig.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/multisig.t 2019-01-08 18:26:35.000000000 +0000 @@ -14,7 +14,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -45,12 +45,24 @@ 'first choice in multi, no coercion, should pass', ); +is( + ${^TYPE_PARAMS_MULTISIG}, + 0, + '...${^TYPE_PARAMS_MULTISIG}', +); + is_deeply( [ $sig->( 1, [2.2,3.3,4.4] ) ], [ 1, [2,3,4] ], 'first choice in multi, coercion, should pass', ); +is( + ${^TYPE_PARAMS_MULTISIG}, + 0, + '...${^TYPE_PARAMS_MULTISIG}', +); + like( exception { $sig->( 1.1, [2.2,3.3,4.4] ) }, qr{^Parameter validation failed}, @@ -63,12 +75,24 @@ 'second choice in multi, no coercion, should pass', ); +is( + ${^TYPE_PARAMS_MULTISIG}, + 1, + '...${^TYPE_PARAMS_MULTISIG}', +); + is_deeply( [ $sig->( [2.2,3.3,4.4], 1 ) ], [ [2,3,4], 1 ], 'second choice in multi, coercion, should pass', ); +is( + ${^TYPE_PARAMS_MULTISIG}, + 1, + '...${^TYPE_PARAMS_MULTISIG}', +); + like( exception { $sig->( [2.2,3.3,4.4], 1.1 ) }, qr{^Parameter validation failed}, @@ -81,6 +105,12 @@ 'third choice in multi, no coercion, should pass', ); +is( + ${^TYPE_PARAMS_MULTISIG}, + 2, + '...${^TYPE_PARAMS_MULTISIG}', +); + like( exception { $sig->( { a => 1.1, b => 7, c => "Hello" } ) }, qr{^Parameter validation failed}, diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/named.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/named.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/named.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/named.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/noninline.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/noninline.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/noninline.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/noninline.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/optional.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/optional.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/optional.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/optional.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -29,53 +29,59 @@ use Type::Params qw(compile); use Types::Standard -types; -my $chk = compile(Num, Optional[Int], Optional[ArrayRef], Optional[HashRef]); +my $chk1 = compile(Num, Optional[Int], Optional[ArrayRef], Optional[HashRef]); +my $chk2 = compile(Num, Int, {optional=>1}, ArrayRef, {optional=>1}, HashRef, {optional=>1}); +my $chk3 = compile(Num, Int, {optional=>1}, Optional[ArrayRef], HashRef, {optional=>1}); +my $chk4 = compile(Num, Int, {optional=>1}, Optional[ArrayRef], {optional=>1}, HashRef, {optional=>1}); +my $chk5 = compile(Num, {optional=>0}, Optional[Int], Optional[ArrayRef], Optional[HashRef]); + +for my $chk ($chk1, $chk2, $chk3, $chk4, $chk5) { + is_deeply( + [ $chk->(1.1, 2, [], {}) ], + [ 1.1, 2, [], {} ] + ); + + is_deeply( + [ $chk->(1.1, 2, []) ], + [ 1.1, 2, [] ] + ); + + is_deeply( + [ $chk->(1.1, 2) ], + [ 1.1, 2 ] + ); + + is_deeply( + [ $chk->(1.1) ], + [ 1.1 ] + ); + + like( + exception { $chk->(1.1, 2, {}) }, + qr{^Reference \{\} did not pass type constraint "(Optional\[)?ArrayRef\]?" \(in \$_\[2\]\)}, + ); + + like( + exception { $chk->() }, + qr{^Wrong number of parameters; got 0; expected 1 to 4}, + ); + + like( + exception { $chk->(1 .. 5) }, + qr{^Wrong number of parameters; got 5; expected 1 to 4}, + ); + + like( + exception { $chk->(1, 2, undef) }, + qr{^Undef did not pass type constraint}, + ); +} -is_deeply( - [ $chk->(1.1, 2, [], {}) ], - [ 1.1, 2, [], {} ] -); - -is_deeply( - [ $chk->(1.1, 2, []) ], - [ 1.1, 2, [] ] -); - -is_deeply( - [ $chk->(1.1, 2) ], - [ 1.1, 2 ] -); - -is_deeply( - [ $chk->(1.1) ], - [ 1.1 ] -); - -like( - exception { $chk->(1.1, 2, {}) }, - qr{^Reference {} did not pass type constraint "Optional\[ArrayRef\]" \(in \$_\[2\]\)}, -); - -like( - exception { $chk->() }, - qr{^Wrong number of parameters; got 0; expected 1 to 4}, -); - -like( - exception { $chk->(1 .. 5) }, - qr{^Wrong number of parameters; got 5; expected 1 to 4}, -); - -my $chk2 = compile(1, 0, 0); +my $chk99 = compile(1, 0, 0); like( - exception { $chk2->() }, + exception { $chk99->() }, qr{^Wrong number of parameters; got 0; expected 1 to 3}, ); -like( - exception { $chk->(1, 2, undef) }, - qr{^Undef did not pass type constraint}, -); - done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/positional.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/positional.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/positional.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/positional.t 2019-01-08 18:26:35.000000000 +0000 @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Params/slurpy.t libtype-tiny-perl-1.004004/t/20-unit/Type-Params/slurpy.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Params/slurpy.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Params/slurpy.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Parser/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Parser/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Parser/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Parser/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Parser/moosextypes.t libtype-tiny-perl-1.004004/t/20-unit/Type-Parser/moosextypes.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Parser/moosextypes.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Parser/moosextypes.t 2019-01-08 18:26:35.000000000 +0000 @@ -6,13 +6,18 @@ Checks Type::Parser can pick up MooseX::Types type constraints. +=head1 DEPENDENCIES + +Requires L 2.0201 and L 0.001004; +skipped otherwise. + =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -24,7 +29,8 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { 'MooseX::Types::Common' => 0 }; +use Test::Requires { 'Moose' => '2.0201' }; +use Test::Requires { 'MooseX::Types::Common' => '0.001004' }; use Test::TypeTiny; use Test::Fatal; @@ -38,4 +44,4 @@ should_pass([], $type); should_fail([1,-2,3], $type); -done_testing; \ No newline at end of file +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/automagic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/automagic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/automagic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/automagic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -68,6 +68,15 @@ 'type registries are separate', ); +my $no_e = exception { + do { + my $obj = Type::Registry->new; + }; + # DESTROY called +}; + +is($no_e, undef, 'DESTROY does not cause problems'); + my $r = Type::Registry->for_class("Local::Pkg1"); should_pass([1, 2, 3], $r->lookup("ArrayRef[Integer]")); diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/methods.t libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/methods.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/methods.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/methods.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/moosextypes.t libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/moosextypes.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/moosextypes.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/moosextypes.t 2019-01-08 18:26:35.000000000 +0000 @@ -8,7 +8,8 @@ =head1 DEPENDENCIES -Requires L 0.001004; skipped otherwise. +Requires L 2.0201 and L 0.001004; +kipped otherwise. =head1 AUTHOR @@ -16,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -28,6 +29,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; +use Test::Requires { 'Moose' => '2.0201' }; use Test::Requires { 'MooseX::Types::Common' => '0.001004' }; use Test::TypeTiny; use Test::Fatal; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/mousextypes.t libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/mousextypes.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Registry/mousextypes.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Registry/mousextypes.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Common-Numeric/basic.t libtype-tiny-perl-1.004004/t/20-unit/Types-Common-Numeric/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Common-Numeric/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Common-Numeric/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -30,7 +30,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). +This software is copyright (c) 2013-2014, 2017-2019 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Common-Numeric/ranges.t libtype-tiny-perl-1.004004/t/20-unit/Types-Common-Numeric/ranges.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Common-Numeric/ranges.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Common-Numeric/ranges.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,121 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Tests constraints for L's +C and C. + +=head1 AUTHOR + +Toby Inkster. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 FATAL => 'all'; +use Test::More; +use Test::TypeTiny qw( -all ); +use Test::Fatal; + +use Types::Common::Numeric -all; + +should_fail($_, IntRange[10,15]) for -19 .. +9; +should_pass($_, IntRange[10,15]) for 10 .. 15; +should_fail($_, IntRange[10,15]) for 16 .. 20; + +should_fail($_ + 0.5, IntRange[10,15]) for -9 .. 20; + +should_fail($_, IntRange[10,15]) for ([], {}, sub { 3 }, "hello world"); + +should_fail($_, IntRange[10]) for -19 .. 9; +should_pass($_, IntRange[10]) for 10 .. 24, 1000, 1_000_000; + +########### + +should_fail($_, NumRange[10,15]) for -19 .. +9; +should_pass($_, NumRange[10,15]) for 10 .. 15; +should_fail($_, NumRange[10,15]) for 16 .. 20; + +should_fail($_ + 0.5, NumRange[10,15]) for -9 .. 9; +should_pass($_ + 0.5, NumRange[10,15]) for 10 .. 14; +should_fail($_ + 0.5, NumRange[10,15]) for 15 .. 20; + +should_fail($_, NumRange[10,15]) for ([], {}, sub { 3 }, "hello world"); + +should_fail($_, NumRange[10]) for -19 .. 9; +should_pass($_, NumRange[10]) for 10 .. 24, 1000, 1_000_000; + +########### + +should_fail( '9.99', NumRange[10,15,0,0] ); +should_pass( '10.00', NumRange[10,15,0,0] ); +should_pass( '10.01', NumRange[10,15,0,0] ); +should_pass( '12.50', NumRange[10,15,0,0] ); +should_pass( '14.99', NumRange[10,15,0,0] ); +should_pass( '15.00', NumRange[10,15,0,0] ); +should_fail( '15.01', NumRange[10,15,0,0] ); + +should_fail( '9.99', NumRange[10,15,1,0] ); +should_fail( '10.00', NumRange[10,15,1,0] ); +should_pass( '10.01', NumRange[10,15,1,0] ); +should_pass( '12.50', NumRange[10,15,1,0] ); +should_pass( '14.99', NumRange[10,15,1,0] ); +should_pass( '15.00', NumRange[10,15,1,0] ); +should_fail( '15.01', NumRange[10,15,1,0] ); + +should_fail( '9.99', NumRange[10,15,0,1] ); +should_pass( '10.00', NumRange[10,15,0,1] ); +should_pass( '10.01', NumRange[10,15,0,1] ); +should_pass( '12.50', NumRange[10,15,0,1] ); +should_pass( '14.99', NumRange[10,15,0,1] ); +should_fail( '15.00', NumRange[10,15,0,1] ); +should_fail( '15.01', NumRange[10,15,0,1] ); + +should_fail( '9.99', NumRange[10,15,1,1] ); +should_fail( '10.00', NumRange[10,15,1,1] ); +should_pass( '10.01', NumRange[10,15,1,1] ); +should_pass( '12.50', NumRange[10,15,1,1] ); +should_pass( '14.99', NumRange[10,15,1,1] ); +should_fail( '15.00', NumRange[10,15,1,1] ); +should_fail( '15.01', NumRange[10,15,1,1] ); + +########### + +should_pass(1, IntRange); +should_fail($_, IntRange) for ([], {}, sub { 3 }, "hello world", '1.2345'); + +should_pass(1, NumRange); +should_fail($_, NumRange) for ([], {}, sub { 3 }, "hello world"); +should_pass('1.2345', NumRange); + +########### + +foreach my $test ( + [NumRange, [{}, 5], qr/NumRange min must be a num/, "NumRange non-numeric min"], + [NumRange, [5, {}], qr/NumRange max must be a num/, "NumRange non-numeric max"], + [NumRange, [5, 10, {}], qr/NumRange minexcl must be a boolean/, "NumRange non-boolean minexcl"], + [NumRange, [5, 10, 0, {}], qr/NumRange maxexcl must be a boolean/, "NumRange non-boolean maxexcl"], + [NumRange, [{}, {}], qr/NumRange min must be a num/, "NumRange non-numeric min and max"], + [IntRange, [{}, 5], qr/IntRange min must be a int/, "IntRange non-numeric min"], + [IntRange, [5, {}], qr/IntRange max must be a int/, "IntRange non-numeric max"], + [IntRange, [5, 10, {}], qr/IntRange minexcl must be a boolean/, "IntRange non-boolean minexcl"], + [IntRange, [5, 10, 0, {}], qr/IntRange maxexcl must be a boolean/, "IntRange non-boolean maxexcl"], + [IntRange, [{}, {}], qr/IntRange min must be a int/, "IntRange non-numeric min and max"], + [IntRange, [1.1, 5], qr/IntRange min must be a int/, "IntRange non-integer min"], + [IntRange, [5, 9.9], qr/IntRange max must be a int/, "IntRange non-integer max"], +) { + my ($base, $params, $qr, $desc) = @$test; + my $e = exception { $base->of(@$params) }; + like($e, $qr, "Exception thrown for $desc"); +} + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/basic.t libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -30,7 +30,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). +This software is copyright (c) 2013-2014, 2017-2019 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/coerce.t libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/coerce.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/coerce.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/coerce.t 2019-01-08 18:26:35.000000000 +0000 @@ -28,7 +28,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). +This software is copyright (c) 2013-2014, 2017-2019 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -54,5 +54,6 @@ is(to_LowerCaseStr('BAR'), 'bar', 'lowercase str' ); is(to_NumericCode('4111-1111-1111-1111'), '4111111111111111', 'numeric code' ); +is(to_NumericCode('+1 (800) 555-01-23'), '18005550123', 'numeric code' ); done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/strlength.t libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/strlength.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/strlength.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/strlength.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,45 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Tests constraints for L's +Ctring + +=head1 AUTHOR + +Toby Inkster. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 utf8; +use strict; +use warnings FATAL => 'all'; +use Test::More; +use Test::TypeTiny; + +use Types::Common::String -all; + +my $type = StrLength[5,10]; + +should_fail($_, $type) for ([], {}, sub { 3 }, undef, "", 123, "Hiya", "Hello World"); +should_pass($_, $type) for ("Hello", "Hello!", " " x 8, "HelloWorld"); + +my $type2 = StrLength[4,4]; + +should_pass("café", $type2); +should_pass("™ķ⁹—", $type2); + +my $type3 = StrLength[4]; +should_fail($_, $type3) for ([], {}, sub { 3 }, undef, "", 123); +should_pass($_, $type3) for ("Hello", "Hello!", " " x 8, "HelloWorld", "Hiya", "Hello World"); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/unicode.t libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/unicode.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Common-String/unicode.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Common-String/unicode.t 2019-01-08 18:26:35.000000000 +0000 @@ -30,7 +30,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). +This software is copyright (c) 2013-2014, 2017-2019 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L). This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/basic.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/cycletuple.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/cycletuple.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/cycletuple.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/cycletuple.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,96 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks various values against C from Types::Standard. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::TypeTiny; +use Test::Fatal qw(exception); + +use Types::Standard qw( CycleTuple Num Int HashRef ArrayRef Any Optional slurpy ); +use Type::Utils qw( class_type ); + +my $type1 = CycleTuple[ + Int->plus_coercions(Num, 'int($_)'), + HashRef, + ArrayRef, +]; + +my $type2 = CycleTuple[ + Int->where(sub{2})->plus_coercions(Num, 'int($_)'), + HashRef, + ArrayRef, +]; + +my $type3 = CycleTuple[ + Int->plus_coercions(Num->where(sub{2}), 'int($_)'), + HashRef, + ArrayRef, +]; + +my $type4 = CycleTuple[ + Int->where(sub{2})->plus_coercions(Num->where(sub{2}), 'int($_)'), + HashRef, + ArrayRef, +]; + +my $i; +for my $type ($type1, $type2, $type3, $type4) +{ + ++$i; + subtest "\$type$i" => sub { + should_fail(undef, $type); + should_fail({}, $type); + should_pass([], $type); + should_fail([{}], $type); + should_fail([1], $type); + should_fail([1,{}], $type); + should_pass([1,{}, []], $type); + should_fail([1,{}, [], undef], $type); + should_fail([1,{}, [], 2], $type); + should_pass([1,{}, [], 2, {}, [1]], $type); + + is_deeply( + $type->coerce([1.1, {}, [], 2.2, {}, [3.3]]), + [1, {}, [], 2, {}, [3.3]], + 'automagic coercion', + ); + }; +} + +like( + exception { CycleTuple[Any, Optional[Any]] }, + qr/cannot be optional/i, + 'cannot make CycleTuples with optional slots', +); + +like( + exception { CycleTuple[Any, slurpy ArrayRef] }, + qr/cannot be slurpy/i, + 'cannot make CycleTuples with slurpy slots', +); + +# should probably write a test case for this. +#diag exception { $type->assert_return([1,{},[],[],[],[]]) }; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/deep-coercions.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/deep-coercions.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/deep-coercions.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/deep-coercions.t 2019-01-08 18:26:35.000000000 +0000 @@ -13,7 +13,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -29,6 +29,36 @@ use Types::Standard qw( -types slurpy ); use Type::Utils; +ok( + ! Dict->of(x => Int)->has_coercion, + "Dict of type without coercion shouldn't have coercion", +); + +ok( + Dict->of(x => Int->plus_coercions(Any, 1))->has_coercion, + "Dict of type with coercion should have coercion", +); + +ok( + ! Tuple->of(Int)->has_coercion, + "Tuple of type without coercion shouldn't have coercion", +); + +ok( + Tuple->of(Int->plus_coercions(Any, 1))->has_coercion, + "Tuple of type with coercion should have coercion", +); + +ok( + ! Map->of(Str, Int)->has_coercion, + "Map of type without coercion shouldn't have coercion", +); + +ok( + Map->of(Str, Int->plus_coercions(Any, 1))->has_coercion, + "Map of type with coercion should have coercion", +); + NONINLINED: { my $Foo = declare Foo => as Int; coerce $Foo, from Num, via { int($_) }; @@ -472,4 +502,38 @@ ); }; +TUPLE: { + my $IntFromStr = declare IntFromStr => as Int; + coerce $IntFromStr, from Str, q{ length($_) }; + + is_deeply( + Tuple->of(HashRef, slurpy ArrayRef[$IntFromStr])->coerce([{}, 1, 2.2, "Hello", "world"]), + [{}, 1, 3, 5, 5], + 'coercing Tuple with slurpy arrayref' + ); +}; + +THINGY1: { + my $IntFromStr = declare IntFromStr => as Int; + coerce $IntFromStr, from Str, q{ length($_) }; + + is_deeply( + Tuple->of($IntFromStr)->coerce(["Hello","world"]), + ["Hello","world"], + 'inlinable coercion of Tuple with no slurpy given input with extra fields fails' + ); +}; + +THINGY2: { + my $IntFromStr = declare IntFromStr => as Int; + coerce $IntFromStr, from Str, sub{ length($_) }; + + is_deeply( + Tuple->of($IntFromStr)->coerce(["Hello","world"]), + ["Hello","world"], + 'non-inlinable coercion of Tuple with no slurpy given input with extra fields fails' + ); +}; + done_testing; + diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/filehandle.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/filehandle.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/filehandle.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/filehandle.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,39 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks various values against C from Types::Standard. + +=head1 SEE ALSO + +L + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::TypeTiny; +use Test::Requires qw( IO::String ); + +use Types::Standard qw( FileHandle ); + +should_pass('IO::String'->new, FileHandle); +should_fail('IO::String', FileHandle); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/lockdown.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/lockdown.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/lockdown.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/lockdown.t 2019-01-08 18:26:35.000000000 +0000 @@ -15,7 +15,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/mxtmlb-alike.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/mxtmlb-alike.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/mxtmlb-alike.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/mxtmlb-alike.t 2019-01-08 18:26:35.000000000 +0000 @@ -28,7 +28,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/optlist.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/optlist.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/optlist.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/optlist.t 2019-01-08 18:26:35.000000000 +0000 @@ -14,7 +14,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/overload.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/overload.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/overload.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/overload.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/strmatch.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/strmatch.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/strmatch.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/strmatch.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -25,10 +25,17 @@ use Test::More; use Test::TypeTiny; +use Test::Fatal; use Types::Standard -all, "slurpy"; use Type::Utils; +my $e = exception { StrMatch[{}] }; +like($e, qr/^First parameter to StrMatch\[\`a\] expected to be a Regexp/, 'error message 1'); + +$e = exception { StrMatch[qr/(.)/, []] }; +like($e, qr/^Second parameter to StrMatch\[\`a\] expected to be a type constraint/, 'error message 2'); + my $DistanceUnit = enum DistanceUnit => [qw/ mm cm m km /]; my $Distance = declare Distance => as StrMatch[ qr{^([0-9]+)\s+(.+)$}, @@ -66,4 +73,16 @@ should_pass("https://www.google.com/", $SecureUrl); should_fail("http://www.google.com/", $SecureUrl); +my $length_eq_3 = StrMatch[qr/\A...\z/]; +should_fail('ab', $length_eq_3); +should_pass('abc', $length_eq_3); +should_fail('abcd', $length_eq_3); +#diag( $length_eq_3->inline_check('$x') ); + +my $length_ge_3 = StrMatch[qr/\A.../]; +should_fail('ab', $length_ge_3); +should_pass('abc', $length_ge_3); +should_pass('abcd', $length_ge_3); +#diag( $length_ge_3->inline_check('$x') ); + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/structured.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/structured.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/structured.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/structured.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -24,6 +24,7 @@ use lib qw( . ./t ../inc ./inc ); use Test::More; +use Test::Fatal; use Test::TypeTiny; use Types::Standard -all, "slurpy"; @@ -156,6 +157,27 @@ should_fail({ foo => undef, baz => "x" }, $gazetteer); should_fail({ baz => "x" }, $gazetteer); +my $gazetteer2 = Dict[ foo => Int, bar => Optional[Int], slurpy Map[StrMatch[qr/^...$/], Num] ]; +should_pass({ foo => 99, jjj => '2.2' }, $gazetteer2); +should_fail({ jjj => '2.2' }, $gazetteer2); +should_fail({ foo => 99, jjjj => '2.2' }, $gazetteer2); + +subtest slurpy_coderef_thing => sub +{ + my $allow_extras = 1; + my $type = Tuple[Int, slurpy sub { $allow_extras }]; + + isa_ok($type->parameters->[-1]{slurpy}, 'Type::Tiny'); + + should_pass([1], $type); + should_pass([1, "extra"], $type); + + $allow_extras = 0; + + should_pass([1], $type); + should_fail([1, "extra"], $type); +}; + subtest my_dict_is_slurpy => sub { ok(!$struct5->my_dict_is_slurpy, 'On a non-slurpy Dict'); @@ -252,4 +274,38 @@ ok(!(Dict[bar=>Int, slurpy Map[Int,Int]])->create_child_type->my_hashref_allows_value(baz => 42), 'A child of Dict[bar=>Int,slurpy Map[Int,Int]] disallows key "baz" with value 42'); }; +subtest "Invalid parameters" => sub { + my $e; + $e = exception { ScalarRef[1] }; + like($e, qr/Parameter to ScalarRef\[\`a\] expected to be a type constraint/, 'ScalarRef[INVALID]'); + $e = exception { ArrayRef[1] }; + like($e, qr/Parameter to ArrayRef\[\`a\] expected to be a type constraint/, 'ArrayRef[INVALID]'); + $e = exception { HashRef[1] }; + like($e, qr/Parameter to HashRef\[\`a\] expected to be a type constraint/, 'HashRef[INVALID]'); + $e = exception { Map[1, Str] }; + like($e, qr/First parameter to Map\[\`k,\`v\] expected to be a type constraint/, 'Map[INVALID, Str]'); + $e = exception { Map[Str, 1] }; + like($e, qr/Second parameter to Map\[\`k,\`v\] expected to be a type constraint/, 'Map[Str, INVALID]'); + $e = exception { Tuple[1] }; + like($e, qr/Parameters to Tuple\[\.\.\.] expected to be type constraints/, 'Tuple[INVALID]'); + $e = exception { Tuple[Str, slurpy 42] }; + like($e, qr/Slurpy parameter to Tuple\[\.\.\.] expected to be a type constraint/, 'Tuple[Str, slurpy INVALID]'); + $e = exception { Tuple[Optional[Str], Str] }; + like($e, qr/Optional parameters to Tuple\[\.\.\.] cannot precede required parameters/, 'Tuple[Optional[Str], Str]'); + $e = exception { CycleTuple[1] }; + like($e, qr/Parameters to CycleTuple\[\.\.\.] expected to be type constraints/, 'CycleTuple[INVALID]'); + $e = exception { CycleTuple[Optional[Str]] }; + like($e, qr/Parameters to CycleTuple\[\.\.\.] cannot be optional/, 'CycleTuple[Optional[Str]]'); + $e = exception { CycleTuple[slurpy Str] }; + like($e, qr/Parameters to CycleTuple\[\.\.\.] cannot be slurpy/, 'CycleTuple[slurpy Str]'); + $e = exception { Dict[1] }; + like($e, qr/Expected even-sized list/, 'Dict[INVALID]'); + $e = exception { Dict[[], Str] }; + like($e, qr/Key for Dict\[\.\.\.\] expected to be string/, 'Dict[INVALID => Str]'); + $e = exception { Dict[foo => 1] }; + like($e, qr/Parameter for Dict\[\.\.\.\] with key 'foo' expected to be a type constraint/, 'Dict[foo => INVALID]'); + $e = exception { Dict[foo => Str, slurpy 42] }; + like($e, qr/Slurpy parameter to Dict\[\.\.\.] expected to be a type constraint/, 'Dict[foo => Str, slurpy INVALID]'); +}; + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/tied.t libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/tied.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-Standard/tied.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-Standard/tied.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -24,6 +24,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; +use Test::Fatal; use Test::TypeTiny; use Types::Standard qw( Tied HashRef ); @@ -86,4 +87,7 @@ should_fail($s, $intersection); should_fail({foo=>2}, $intersection); +my $e = exception { Tied[{}] }; +like($e, qr/^Parameter to Tied\[.a\] expected to be a class name/, 'weird exception'); + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/basic.t libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -7,18 +7,13 @@ Test the L bootstrap library. (That is, type constraints used by Type::Tiny internally.) -=head1 DEPENDENCIES - -This test requires L 2.0600 and L 1.00. Otherwise, it is -skipped. - =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -29,15 +24,9 @@ use warnings; use lib qw( ./lib ./t/lib ../inc ./inc ); -# Test::Requires calls ->import on Moose/Mouse, so be sure -# to import them into dummy packages. -{ package XXX; use Test::Requires { Moose => '2.0600' } }; -{ package YYY; use Test::Requires { Mouse => '1.00' } }; - use Test::More; use Test::TypeTiny -all; use Types::TypeTiny -all; -use Moose::Util::TypeConstraints qw(find_type_constraint); my $stringy = do { package Overloaded::String; @@ -111,8 +100,6 @@ should_pass( ArrayLike, $type, 'Type::Tiny constraint object passes type constraint TypeTiny' ); should_fail( {}, $type ); should_fail( sub { 42 }, $type ); - should_fail( find_type_constraint("Int"), $type, 'Moose constraint object fails type constraint TypeTiny' ); - should_fail( Mouse::Util::TypeConstraints::find_type_constraint("Int"), $type, 'Mouse constraint object fails type constraint TypeTiny' ); should_fail( undef, $type ); }; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/coercion.t libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/coercion.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/coercion.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/coercion.t 2019-01-08 18:26:35.000000000 +0000 @@ -8,7 +8,7 @@ =head1 DEPENDENCIES -This test requires L 2.0600, L 1.00, and L 1.000000. +This test requires L 2.0000, L 1.00, and L 1.000000. Otherwise, it is skipped. =head1 AUTHOR @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -30,7 +30,7 @@ # Test::Requires calls ->import on Moose/Mouse, so be sure # to import them into dummy packages. -{ package XXX; use Test::Requires { Moose => '2.0600' } }; +{ package XXX; use Test::Requires { Moose => '2.0000' } }; { package YYY; use Test::Requires { Mouse => '1.00' } }; { package ZZZ; use Test::Requires { Moo => '1.000000' } }; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/meta.t libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/meta.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/meta.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/meta.t 2019-01-08 18:26:35.000000000 +0000 @@ -14,7 +14,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/moosemouse.t libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/moosemouse.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/moosemouse.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/moosemouse.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,53 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Stuff that was originally in basic.t but was split out to avoid basic.t +requiring Moose and Mouse. + +=head1 DEPENDENCIES + +This test requires L 2.0000 and L 1.00. Otherwise, it is +skipped. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +# Test::Requires calls ->import on Moose/Mouse, so be sure +# to import them into dummy packages. +{ package XXX; use Test::Requires { Moose => '2.0000' } }; +{ package YYY; use Test::Requires { Mouse => '1.00' } }; + +use Test::More; +use Test::TypeTiny -all; +use Types::TypeTiny -all; +use Moose::Util::TypeConstraints qw(find_type_constraint); + +subtest "TypeTiny" => sub +{ + my $type = TypeTiny; + should_pass( ArrayLike, $type, 'Type::Tiny constraint object passes type constraint TypeTiny' ); + should_fail( {}, $type ); + should_fail( sub { 42 }, $type ); + should_fail( find_type_constraint("Int"), $type, 'Moose constraint object fails type constraint TypeTiny' ); + should_fail( Mouse::Util::TypeConstraints::find_type_constraint("Int"), $type, 'Mouse constraint object fails type constraint TypeTiny' ); + should_fail( undef, $type ); +}; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/progressiveexporter.t libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/progressiveexporter.t --- libtype-tiny-perl-1.000005/t/20-unit/Types-TypeTiny/progressiveexporter.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Types-TypeTiny/progressiveexporter.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,40 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks that Types::TypeTiny avoids loading Exporter::Tiny. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; + +require Types::TypeTiny; + +ok !Exporter::Tiny->can('mkopt'); + +Types::TypeTiny->import(); + +ok !Exporter::Tiny->can('mkopt'); + +Types::TypeTiny->import('HashLike'); + +ok Exporter::Tiny->can('mkopt'); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/arithmetic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/arithmetic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/arithmetic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/arithmetic.t 2019-01-08 18:26:35.000000000 +0000 @@ -13,7 +13,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -85,11 +85,13 @@ { package Local::Class4; sub XYZ () { 1 } + package Local::Class5; + use constant XZY => 2 } should_pass(undef, ~ClassName); should_pass([], ~ClassName); -should_fail("Local::Class$_", ~ClassName) for 2..4; +should_fail("Local::Class$_", ~ClassName) for 2..5; should_pass("Local::Dummy1", ~ClassName); should_fail([], ~(ArrayRef[Int])); diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/coercion-modifiers.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/coercion-modifiers.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/coercion-modifiers.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/coercion-modifiers.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/constraint-strings.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/constraint-strings.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/constraint-strings.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/constraint-strings.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,69 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks Type::Tiny works accepts strings of Perl code as constraints. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2017-2019 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 Types::Standard -types; + +my $Str = Str->where( 'length($_) > 0' ); +my $Arr = ArrayRef->where( '@$_ > 0' ); +my $Hash = HashRef->where( 'keys(%$_) > 0' ); + +use Test::More; +use Test::Fatal; + +is( + exception { $Str->assert_valid( 'u' ) }, + undef, + 'non-empty string, okay', +); + +isa_ok( + exception { $Str->assert_valid( '' ) }, + 'Error::TypeTiny', + 'result of empty string', +); + +is( + exception { $Arr->assert_valid( [undef] ) }, + undef, + 'non-empty arrayref, okay', +); + +isa_ok( + exception { $Arr->assert_valid( [] ) }, + 'Error::TypeTiny', + 'result of empty arrayref', +); + +is( + exception { $Hash->assert_valid( { '' => undef } ) }, + undef, + 'non-empty hashref, okay', +); + +isa_ok( + exception { $Hash->assert_valid( +{} ) }, + 'Error::TypeTiny', + 'result of empty hashref', +); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/deprecation.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/deprecation.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/deprecation.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/deprecation.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,44 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks Type::Tiny's C attribute works. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::Fatal; +use Test::TypeTiny; + +use Type::Tiny; + +my $t1 = Type::Tiny->new(name => "Base"); +my $t2 = Type::Tiny->new(name => "Derived_1", parent => $t1); +my $t3 = Type::Tiny->new(name => "Derived_2", parent => $t1, deprecated => 1); +my $t4 = Type::Tiny->new(name => "Double_Derived_1", parent => $t3); +my $t5 = Type::Tiny->new(name => "Double_Derived_2", parent => $t3, deprecated => 0); + +ok not $t1->deprecated; +ok not $t2->deprecated; +ok $t3->deprecated; +ok $t4->deprecated; +ok not $t5->deprecated; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/esoteric.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/esoteric.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/esoteric.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/esoteric.t 2019-01-08 18:26:35.000000000 +0000 @@ -15,7 +15,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/my-methods.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/my-methods.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/my-methods.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/my-methods.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/parameterization.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/parameterization.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/parameterization.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/parameterization.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -29,6 +29,7 @@ use Test::More; use Test::TypeTiny -all; +use Test::Fatal; use Types::Standard -types; @@ -67,4 +68,10 @@ 'error message when a coderef dies', ); +like( + exception { ArrayRef[Int, Int] }, + qr/^\QOnly one parameter to ArrayRef[`a] expected; got 2/, + 'error message when ArrayRef[`a] passed multiple parameters' +); + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/shortcuts.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/shortcuts.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/shortcuts.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/shortcuts.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/smartmatch.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/smartmatch.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/smartmatch.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/smartmatch.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/syntax.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/syntax.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/syntax.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/syntax.t 2019-01-08 18:26:35.000000000 +0000 @@ -43,7 +43,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/to-moose.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/to-moose.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/to-moose.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/to-moose.t 2019-01-08 18:26:35.000000000 +0000 @@ -6,13 +6,17 @@ Checks Type::Tiny objects can be converted to Moose type constraint objects. +=head1 DEPENDENCIES + +Requires Moose 2.0000; skipped otherwise. + =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -24,7 +28,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { 'Moose' => '2.0600' }; +use Test::Requires { 'Moose' => '2.0000' }; use Test::TypeTiny; use Type::Tiny; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/to-mouse.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/to-mouse.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny/to-mouse.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny/to-mouse.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Class/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Class/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Class/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Class/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Class/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Class/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Class/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Class/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Class/plus-constructors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Class/plus-constructors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Class/plus-constructors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Class/plus-constructors.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -120,4 +120,8 @@ is_deeply($me, $me2, 'coercion worked'); +my $you = $Person->plus_constructors->coerce({ name => "Livvy" }); +my $you2 = Person->new(name => "Livvy"); +is_deeply($you, $you2, 'coercion worked (plus_constructors with no parameters)'); + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Duck/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Duck/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Duck/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Duck/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Duck/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Duck/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Duck/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Duck/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Enum/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Enum/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Enum/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Enum/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Enum/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Enum/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Enum/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Enum/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-_HalfOp/double-union.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-_HalfOp/double-union.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-_HalfOp/double-union.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-_HalfOp/double-union.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,42 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Ensure that the following works: + + ArrayRef[Str] | Undef | Str + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2017-2019 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 FATAL => 'all'; +use Test::More; + +use Types::Standard -all; + +my $union = eval { ArrayRef[Str] | Undef | Str }; + +SKIP: { + ok $union or skip 'broken type', 6; + ok $union->check([qw/ a b /]); + ok !$union->check([[]]); + ok $union->check(undef); + ok $union->check("a"); + ok !$union->check([undef]); + ok !$union->check({}); +} + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-_HalfOp/overload-precedence.t 2019-01-08 18:26:35.000000000 +0000 @@ -14,7 +14,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Graham Knop. +This software is copyright (c) 2014, 2017-2019 by Graham Knop. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Intersection/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Intersection/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Intersection/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Intersection/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Intersection/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Intersection/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Intersection/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Intersection/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -60,7 +60,7 @@ [ '"Int&Int" requires that the value pass "Int" and "Int"', 'Value "3.14159" did not pass type constraint "Int"', - '"Int" is defined as: (defined $_ and $_ =~ /\\A-?[0-9]+\\z/)', + '"Int" is defined as: (do { my $tmp = $_; defined($tmp) and !ref($tmp) and $tmp =~ /\\A-?[0-9]+\\z/ })', ], ) or diag explain($e->explain); diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Role/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Role/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Role/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Role/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Role/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Role/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Role/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Role/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Union/basic.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Union/basic.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Union/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Union/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -146,4 +146,14 @@ 'Union find_type_for (none)', ); +ok( + (FooBar|DoesQuux)==(DoesQuux|FooBar), + 'Union equals', +); + +ok( + (FooBar|DoesQuux)!=(DoesQuux|SmallInteger), + 'Union not equals', +); + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Union/errors.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Union/errors.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Union/errors.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Union/errors.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -61,7 +61,7 @@ '"Int|ArrayRef[Int]" requires that the value pass "ArrayRef[Int]" or "Int"', 'Value "3.14159" did not pass type constraint "Int"', ' Value "3.14159" did not pass type constraint "Int"', - ' "Int" is defined as: (defined $_ and $_ =~ /\\A-?[0-9]+\\z/)', + ' "Int" is defined as: (do { my $tmp = $_; defined($tmp) and !ref($tmp) and $tmp =~ /\\A-?[0-9]+\\z/ })', 'Value "3.14159" did not pass type constraint "ArrayRef[Int]"', ' "ArrayRef[Int]" is a subtype of "ArrayRef"', ' "ArrayRef" is a subtype of "Ref"', diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Union/relationships.t libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Union/relationships.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Tiny-Union/relationships.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Tiny-Union/relationships.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,67 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Checks union type constraint subtype/supertype relationships. + +=head1 DEPENDENCIES + +Uses the bundled BiggerLib.pm type library. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::TypeTiny; + +use BiggerLib qw( :types ); +use Type::Utils qw( union class_type ); +use Types::Standard Object => { -as => "Blessed" }; + +{ my $x; sub FooBarOrDoesQuux () { $x ||= union(FooBarOrDoesQuux => [FooBar, DoesQuux]) } } + +ok( + FooBarOrDoesQuux->is_a_type_of(FooBarOrDoesQuux), +); + +ok( + FooBarOrDoesQuux->is_supertype_of(FooBar), +); + +ok( + FooBarOrDoesQuux->is_supertype_of(DoesQuux), +); + +ok( + FooBarOrDoesQuux->is_a_type_of(Blessed), +); + +ok( + ! FooBarOrDoesQuux->is_supertype_of(Blessed), +); + +ok( + ! FooBarOrDoesQuux->is_subtype_of(FooBarOrDoesQuux), +); + +ok( + FooBarOrDoesQuux->is_subtype_of(Blessed), +); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/classifier.t libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/classifier.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/classifier.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/classifier.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/dwim-both.t libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/dwim-both.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/dwim-both.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/dwim-both.t 2019-01-08 18:26:35.000000000 +0000 @@ -9,7 +9,7 @@ =head1 DEPENDENCIES -Mouse 1.00 and Moose 2.0600; skipped otherwise. +Mouse 1.00 and Moose 2.0000; skipped otherwise. =head1 AUTHOR @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -29,7 +29,7 @@ use Test::More; { package AAA; use Test::Requires { "Mouse" => "1.00" } }; -{ package BBB; use Test::Requires { "Moose" => "2.0600" } }; +{ package BBB; use Test::Requires { "Moose" => "2.0000" } }; { package Minnie; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/dwim-moose.t libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/dwim-moose.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/dwim-moose.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/dwim-moose.t 2019-01-08 18:26:35.000000000 +0000 @@ -9,7 +9,7 @@ =head1 DEPENDENCIES -Moose 2.0600 and MooseX::Types 0.35; skipped otherwise. +Moose 2.0201 and MooseX::Types 0.35; skipped otherwise. =head1 AUTHOR @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -28,7 +28,7 @@ use warnings; use Test::More; -use Test::Requires { "Moose" => "2.0600" }; +use Test::Requires { "Moose" => "2.0201" }; use Test::Requires { "MooseX::Types" => "0.35" }; use Test::TypeTiny; @@ -83,6 +83,9 @@ should_pass([bless({}, $testclass)], $fallbackp); should_pass([], $fallbackp); should_fail([bless({}, 'main')], $fallbackp); + + my $fallbacku = dwim_type("ArrayRef[$testclass]", fallback => []); + is($fallbacku, undef); } { diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/dwim-mouse.t libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/dwim-mouse.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/dwim-mouse.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/dwim-mouse.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -83,6 +83,9 @@ should_pass([bless({}, $testclass)], $fallbackp); should_pass([], $fallbackp); should_fail([bless({}, 'main')], $fallbackp); + + my $fallbacku = dwim_type("ArrayRef[$testclass]", fallback => []); + is($fallbacku, undef); } { @@ -97,4 +100,6 @@ should_fail([bless({}, 'main')], $fallbackp); } + + done_testing; diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/match-on-type.t libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/match-on-type.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/match-on-type.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/match-on-type.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -88,6 +88,18 @@ 'to_json_2 using match_on_type works', ); +like( + exception { to_json(do { my $x = "hello"; \$x }) }, + qr{\ASCALAR\(\w+\) is not acceptable json type}, + "fallthrough works for compile_match_on_type", +); + +like( + exception { to_json_2(do { my $x = "hello"; \$x }) }, + qr{\ASCALAR\(\w+\) is not acceptable json type}, + "fallthrough works for match_on_type", +); + my $compiled1 = compile_match_on_type( HashRef() => sub { 'HASH' }, ArrayRef() => sub { 'ARRAY' }, @@ -140,7 +152,7 @@ 'coderef compiled by compile_match_on_type with no match', ); -my $context; +our $context; MATCH_VOID: { match_on_type([], ArrayRef, sub { $context = wantarray }); ok(!defined($context), 'match_on_type void context'); @@ -153,6 +165,18 @@ my @x = match_on_type([], ArrayRef, sub { $context = wantarray }); ok(defined($context) && $context, 'match_on_type list context'); }; +MATCH_VOID_STRINGOFCODE: { + match_on_type([], ArrayRef, q{ $::context = wantarray }); + ok(!defined($context), 'match_on_type void context (string of code)'); +}; +MATCH_SCALAR_STRINGOFCODE: { + my $x = match_on_type([], ArrayRef, q{ $::context = wantarray }); + ok(defined($context) && !$context, 'match_on_type scalar context (string of code)'); +}; +MATCH_LIST_STRINGOFCODE: { + my @x = match_on_type([], ArrayRef, q{ $::context = wantarray }); + ok(defined($context) && $context, 'match_on_type list context (string of code)'); +}; my $compiled = compile_match_on_type(ArrayRef, sub { $context = wantarray }); COMPILE_VOID: { $compiled->([]); diff -Nru libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/warnings.t libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/warnings.t --- libtype-tiny-perl-1.000005/t/20-unit/Type-Utils/warnings.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/20-unit/Type-Utils/warnings.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -29,7 +29,7 @@ use Test::More; use Test::Requires '5.014'; -use Test::Requires 'Test::Warnings'; +use Test::Requires { 'Test::Warnings' => 0.005 }; #warnings added in this version use Test::Warnings qw( :no_end_test warnings ); use Type::Library -base, -declare => qw/WholeNumber/; diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Class-InsideOut/basic.t libtype-tiny-perl-1.004004/t/30-integration/Class-InsideOut/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Class-InsideOut/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Class-InsideOut/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by David Golden, Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 by David Golden, 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Exporter-Tiny/basic.t libtype-tiny-perl-1.004004/t/30-integration/Exporter-Tiny/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Exporter-Tiny/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Exporter-Tiny/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Exporter-Tiny/installer.t libtype-tiny-perl-1.004004/t/30-integration/Exporter-Tiny/installer.t --- libtype-tiny-perl-1.000005/t/30-integration/Exporter-Tiny/installer.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Exporter-Tiny/installer.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Exporter-Tiny/role-conflict.t libtype-tiny-perl-1.004004/t/30-integration/Exporter-Tiny/role-conflict.t --- libtype-tiny-perl-1.000005/t/30-integration/Exporter-Tiny/role-conflict.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Exporter-Tiny/role-conflict.t 2019-01-08 18:26:35.000000000 +0000 @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Function-Parameters/basic.t libtype-tiny-perl-1.004004/t/30-integration/Function-Parameters/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Function-Parameters/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Function-Parameters/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -38,6 +38,8 @@ or plan skip_all => "this test requires Moo 1.000000 or Moose 2.0000"; }; +BEGIN { plan skip_all => 'Devel::Cover' if $INC{'Devel/Cover.pm'} }; + use Types::Standard -types; use Function::Parameters qw(:strict); diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Kavorka/80returntype.t libtype-tiny-perl-1.004004/t/30-integration/Kavorka/80returntype.t --- libtype-tiny-perl-1.000005/t/30-integration/Kavorka/80returntype.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Kavorka/80returntype.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,70 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Adopted test from Kavorka test suite. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 utf8; +use warnings; +use Test::More; +use Test::Fatal; + +use Test::Requires "Kavorka"; + +note "simple type constraint"; + +fun add1 ($a, $b → Int) { + return $a + $b; +} + +is( add1(4,5), 9 ); +is( add1(4.1,4.9), 9 ); +like(exception { my $r = add1(4.1, 5) }, qr{did not pass type constraint "Int" at \S+ line 38}); + +is_deeply( [add1(4,5)], [9] ); +like(exception { my @r = add1(4.1, 5) }, qr{did not pass type constraint "ArrayRef.Int." at \S+ line 41}); + +note "type constraint expression"; + +use Types::Standard (); +use constant Rounded => Types::Standard::Int()->plus_coercions(Types::Standard::Num(), q[int($_)]); + +fun add2 ($a, $b --> (Rounded) does coerce) { + return $a + $b; +} + +is( add2(4,5), 9 ); +is( add2(4.1,4.9), 9 ); +is( add2(4.1,5), 9 ); + +note "type constraints for list and scalar contexts"; + +fun add3 ($a, $b → Int, ArrayRef[Int] is list) { + wantarray ? ($a,$b) : ($a+$b); +} + +is( add3(4,5), 9 ); +is( add3(4.1,4.9), 9 ); +like(exception { my $r = add3(4.1, 5) }, qr{did not pass type constraint "Int" at \S+ line 64}); + +is_deeply( [add3(4,5)], [4,5] ); +like(exception { my @r = add3(4.1,4.9) }, qr{did not pass type constraint "ArrayRef.Int." at \S+ line 67}); +like(exception { my @r = add3(4.1,5) }, qr{did not pass type constraint "ArrayRef.Int." at \S+ line 68}); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Kavorka/basic.t libtype-tiny-perl-1.004004/t/30-integration/Kavorka/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Kavorka/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Kavorka/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/match-simple/basic.t libtype-tiny-perl-1.004004/t/30-integration/match-simple/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/match-simple/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/match-simple/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moo/basic.t libtype-tiny-perl-1.004004/t/30-integration/Moo/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Moo/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moo/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -11,7 +11,7 @@ Uses the bundled BiggerLib.pm type library. -Test is skipped if Moo 1.001000 is not available. +Test is skipped if Moo 1.000000 is not available. =head1 AUTHOR @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -31,7 +31,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { Moo => 1.001000 }; +use Test::Requires { Moo => 1.000000 }; use Test::Fatal; { diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moo/coercion-inlining-avoidance.t libtype-tiny-perl-1.004004/t/30-integration/Moo/coercion-inlining-avoidance.t --- libtype-tiny-perl-1.000005/t/30-integration/Moo/coercion-inlining-avoidance.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moo/coercion-inlining-avoidance.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moo/coercion.t libtype-tiny-perl-1.004004/t/30-integration/Moo/coercion.t --- libtype-tiny-perl-1.000005/t/30-integration/Moo/coercion.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moo/coercion.t 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ Uses the bundled BiggerLib.pm type library. -Test is skipped if Moo 1.001000 is not available. +Test is skipped if Moo 1.000000 is not available. =head1 AUTHOR @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -30,7 +30,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { Moo => 1.001000 }; +use Test::Requires { Moo => 1.000000 }; use Test::Fatal; { diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moo/exceptions.t libtype-tiny-perl-1.004004/t/30-integration/Moo/exceptions.t --- libtype-tiny-perl-1.000005/t/30-integration/Moo/exceptions.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moo/exceptions.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -29,7 +29,7 @@ use Test::More; use Test::Fatal; -use Test::Requires { "Moo" => "1.002001" }; +use Test::Requires { "Moo" => "1.004000" }; BEGIN { require Method::Generate::Accessor; @@ -48,6 +48,8 @@ my $e_constructor = exception { Goo->new(number => "too") }; isa_ok($e_constructor, 'Error::TypeTiny::Assertion', '$e_constructor'); +# Expect the error message to contain this file, 'exceptions.t' +like($e_constructor, qr/exceptions\.t/, '$e_constructor location') if Moo->VERSION ge '1.004'; ok($e_constructor->has_attribute_name, '$e_constructor->has_attribute_name'); is($e_constructor->attribute_name, 'number', '$e_constructor->attribute_name'); ok($e_constructor->has_attribute_step, '$e_constructor->has_attribute_step'); diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moo/inflation2.t libtype-tiny-perl-1.004004/t/30-integration/Moo/inflation2.t --- libtype-tiny-perl-1.000005/t/30-integration/Moo/inflation2.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moo/inflation2.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moo/inflation.t libtype-tiny-perl-1.004004/t/30-integration/Moo/inflation.t --- libtype-tiny-perl-1.000005/t/30-integration/Moo/inflation.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moo/inflation.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ Uses the bundled BiggerLib.pm type library. -Test is skipped if Moo 1.001000 is not available. Test is redundant if +Test is skipped if Moo 1.000000 is not available. Test is redundant if Moose 2.0000 is not available. =head1 AUTHOR @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -33,7 +33,7 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { Moo => 1.001000 }; +use Test::Requires { Moo => 1.000000 }; use Test::Fatal; { diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moops/basic.t libtype-tiny-perl-1.004004/t/30-integration/Moops/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Moops/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moops/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -15,7 +15,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moops/library-keyword.t libtype-tiny-perl-1.004004/t/30-integration/Moops/library-keyword.t --- libtype-tiny-perl-1.000005/t/30-integration/Moops/library-keyword.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moops/library-keyword.t 2019-01-08 18:26:35.000000000 +0000 @@ -15,7 +15,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moose/accept-moose-types.t libtype-tiny-perl-1.004004/t/30-integration/Moose/accept-moose-types.t --- libtype-tiny-perl-1.000005/t/30-integration/Moose/accept-moose-types.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moose/accept-moose-types.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moose/basic.t libtype-tiny-perl-1.004004/t/30-integration/Moose/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Moose/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moose/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -28,6 +28,7 @@ use strict; use warnings; +no warnings qw(once); use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moose/coercion-more.t libtype-tiny-perl-1.004004/t/30-integration/Moose/coercion-more.t --- libtype-tiny-perl-1.000005/t/30-integration/Moose/coercion-more.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moose/coercion-more.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,62 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test for the good old "You cannot coerce an attribute unless its +type has a coercion" error. + +=head1 DEPENDENCIES + +Uses the bundled BiggerLib.pm type library. + +Test is skipped if Moose 2.1200 is not available. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2013-2014, 2017-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::Requires { Moose => '2.1200' }; +use Test::Fatal; +use Test::TypeTiny qw( matchfor ); + +my $e; + +{ + package Local::Class; + + use Moose; + use BiggerLib -all; + + ::isa_ok(BigInteger, "Moose::Meta::TypeConstraint"); + + has small => (is => "rw", isa => SmallInteger, coerce => 1); + has big => (is => "rw", isa => BigInteger, coerce => 1); + + $e = ::exception { + has big_nc => (is => "rw", isa => BigInteger->no_coercions, coerce => 1); + }; +} + +like( + $e, + qr{^You cannot coerce an attribute .?big_nc.? unless its type .?\w+.? has a coercion}, + "no_coercions and friends available on Moose type constraint objects", +); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moose/coercion.t libtype-tiny-perl-1.004004/t/30-integration/Moose/coercion.t --- libtype-tiny-perl-1.000005/t/30-integration/Moose/coercion.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moose/coercion.t 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ Uses the bundled BiggerLib.pm type library. -Test is skipped if Moose 2.1200 is not available. +Test is skipped if Moose 2.0000 is not available. =head1 AUTHOR @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -30,11 +30,12 @@ use lib qw( ./lib ./t/lib ../inc ./inc ); use Test::More; -use Test::Requires { Moose => '2.1200' }; +use Test::Requires { Moose => '2.0000' }; use Test::Fatal; use Test::TypeTiny qw( matchfor ); my $e; +my $o; { package Local::Class; @@ -47,20 +48,9 @@ has small => (is => "rw", isa => SmallInteger, coerce => 1); has big => (is => "rw", isa => BigInteger, coerce => 1); - $e = ::exception { - has big_nc => (is => "rw", isa => BigInteger->no_coercions, coerce => 1); - }; + has big_nc => (is => "rw", isa => BigInteger->no_coercions, coerce => 0); } -like( - $e, - qr{^You cannot coerce an attribute .?big_nc.? unless its type .?\w+.? has a coercion}, - "no_coercions and friends available on Moose type constraint objects", -); - -undef $e; -my $o; - my $suffix = "mutable class"; for my $i (0..1) { diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moose/inflate-then-inline.t libtype-tiny-perl-1.004004/t/30-integration/Moose/inflate-then-inline.t --- libtype-tiny-perl-1.000005/t/30-integration/Moose/inflate-then-inline.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moose/inflate-then-inline.t 2019-01-08 18:26:35.000000000 +0000 @@ -10,7 +10,7 @@ =head1 DEPENDENCIES -Test is skipped if Moose 2.0600 is not available. +Test is skipped if Moose 2.1210 is not available. =head1 AUTHOR @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. @@ -28,7 +28,7 @@ use strict; use warnings; use Test::More 0.96; -use Test::Requires { 'Moose' => '2.0600' }; +use Test::Requires { 'Moose' => '2.1210' }; use Type::Tiny; diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Moose/native-attribute-traits.t libtype-tiny-perl-1.004004/t/30-integration/Moose/native-attribute-traits.t --- libtype-tiny-perl-1.000005/t/30-integration/Moose/native-attribute-traits.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Moose/native-attribute-traits.t 2019-01-08 18:26:35.000000000 +0000 @@ -9,7 +9,10 @@ =head1 DEPENDENCIES -Test is skipped if Moose 2.0600 is not available. +Test is skipped if Moose 2.1210 is not available. + +(The feature should work in older versions of Moose, but older versions +of Test::Moose conflict with newer versions of Test::Builder.) =head1 AUTHOR @@ -17,7 +20,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. @@ -25,7 +28,7 @@ =cut use Test::More; -use Test::Requires { Moose => '2.0600' }; +use Test::Requires { Moose => '2.1210' }; use Test::Fatal; use Test::TypeTiny qw( matchfor ); use Test::Moose qw( with_immutable ); diff -Nru libtype-tiny-perl-1.000005/t/30-integration/MooseX-Getopt/coercion.t libtype-tiny-perl-1.004004/t/30-integration/MooseX-Getopt/coercion.t --- libtype-tiny-perl-1.000005/t/30-integration/MooseX-Getopt/coercion.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/MooseX-Getopt/coercion.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Alexander Hartmaier. +This software is copyright (c) 2014, 2017-2019 by Alexander Hartmaier. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/MooseX-Types/basic.t libtype-tiny-perl-1.004004/t/30-integration/MooseX-Types/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/MooseX-Types/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/MooseX-Types/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/MooseX-Types/extending.t libtype-tiny-perl-1.004004/t/30-integration/MooseX-Types/extending.t --- libtype-tiny-perl-1.000005/t/30-integration/MooseX-Types/extending.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/MooseX-Types/extending.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/MooseX-Types/more.t libtype-tiny-perl-1.004004/t/30-integration/MooseX-Types/more.t --- libtype-tiny-perl-1.000005/t/30-integration/MooseX-Types/more.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/MooseX-Types/more.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Mouse/basic.t libtype-tiny-perl-1.004004/t/30-integration/Mouse/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Mouse/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Mouse/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Mouse/coercion.t libtype-tiny-perl-1.004004/t/30-integration/Mouse/coercion.t --- libtype-tiny-perl-1.000005/t/30-integration/Mouse/coercion.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Mouse/coercion.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/MouseX-Types/basic.t libtype-tiny-perl-1.004004/t/30-integration/MouseX-Types/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/MouseX-Types/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/MouseX-Types/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/MouseX-Types/extending.t libtype-tiny-perl-1.004004/t/30-integration/MouseX-Types/extending.t --- libtype-tiny-perl-1.000005/t/30-integration/MouseX-Types/extending.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/MouseX-Types/extending.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Object-Accessor/basic.t libtype-tiny-perl-1.004004/t/30-integration/Object-Accessor/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Object-Accessor/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Object-Accessor/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -22,7 +22,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Return-Type/basic.t libtype-tiny-perl-1.004004/t/30-integration/Return-Type/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Return-Type/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Return-Type/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -20,7 +20,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/basic.t libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/delayed-quoting.t libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/delayed-quoting.t --- libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/delayed-quoting.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/delayed-quoting.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,56 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Check type constraints can be made inlinable using L even if +Sub::Quote is loaded late. + +=head1 DEPENDENCIES + +Some parts are skipped if Sub::Quote is not available. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 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 lib qw( ./lib ./t/lib ../inc ./inc ); + +use Test::More; +use Test::TypeTiny; + +use Types::Standard qw( ArrayRef Int ); + +my $type = ArrayRef[Int]; +my $coderef1 = $type->_overload_coderef; +my $coderef2 = $type->_overload_coderef; + +is($coderef1, $coderef2, 'overload coderef gets cached instead of being rebuilt'); + +eval { require Sub::Quote } or do { + diag "Sub::Quote required for further testing"; + done_testing; + exit(0); +}; + +my $coderef3 = $type->_overload_coderef; + +isnt($coderef3, $coderef1, 'loading Sub::Quote triggers rebuilding overload coderef'); + +my $coderef4 = $type->_overload_coderef; + +is($coderef3, $coderef4, 'overload coderef gets cached again instead of being rebuilt'); + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/unquote-coercions.t libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/unquote-coercions.t --- libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/unquote-coercions.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/unquote-coercions.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/unquote-constraints.t libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/unquote-constraints.t --- libtype-tiny-perl-1.000005/t/30-integration/Sub-Quote/unquote-constraints.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Sub-Quote/unquote-constraints.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Switcheroo/basic.t libtype-tiny-perl-1.004004/t/30-integration/Switcheroo/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Switcheroo/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Switcheroo/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Type-Tie/basic.t libtype-tiny-perl-1.004004/t/30-integration/Type-Tie/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Type-Tie/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Type-Tie/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Toby Inkster. +This software is copyright (c) 2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Validation-Class-Simple/archaic.t libtype-tiny-perl-1.004004/t/30-integration/Validation-Class-Simple/archaic.t --- libtype-tiny-perl-1.000005/t/30-integration/Validation-Class-Simple/archaic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Validation-Class-Simple/archaic.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/30-integration/Validation-Class-Simple/basic.t libtype-tiny-perl-1.004004/t/30-integration/Validation-Class-Simple/basic.t --- libtype-tiny-perl-1.000005/t/30-integration/Validation-Class-Simple/basic.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/30-integration/Validation-Class-Simple/basic.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/73f51e2d.pl libtype-tiny-perl-1.004004/t/40-regression/73f51e2d.pl --- libtype-tiny-perl-1.000005/t/40-regression/73f51e2d.pl 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/73f51e2d.pl 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Graham Knop. +This software is copyright (c) 2014, 2017-2019 by Graham Knop. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/73f51e2d.t libtype-tiny-perl-1.004004/t/40-regression/73f51e2d.t --- libtype-tiny-perl-1.000005/t/40-regression/73f51e2d.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/73f51e2d.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Graham Knop. +This software is copyright (c) 2014, 2017-2019 by Graham Knop. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/gh14.t libtype-tiny-perl-1.004004/t/40-regression/gh14.t --- libtype-tiny-perl-1.000005/t/40-regression/gh14.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/gh14.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,75 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test for non-inlined coercions in Moo. + +The issue that prompted this test was actually invalid, caused by a typo +in the bug reporter's code. But I wrote the test case, so I might as well +include it. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +Toby Inkster Etobyink@cpan.orgE. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2017-2019 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::Fatal; +use Test::Requires { Moo => '1.006' }; + +{ + package FinancialTypes; + use Type::Library -base; + use Type::Utils -all; + BEGIN { extends "Types::Standard" }; + + declare 'BankAccountNo', + as Str, + where { + /^\d{26}$/ + or /^[A-Z]{2}\d{18,26}$/ + or /^\d{8}-\d+(-\d+)+$/ + }, + message { "Bad account: $_"}; + + coerce 'BankAccountNo', + from Str, via { + $_ =~ s{\s+}{}g; + $_; + }; +} + +{ + package BankAccount; + use Moo; + has account_number => ( + is => 'ro', + required => !!1, + isa => FinancialTypes::BankAccountNo(), + coerce => FinancialTypes::BankAccountNo()->coercion, + ); +} + +my $x; +my $e = exception { + $x = BankAccount::->new( account_number => "10 2030 4050 1111 2222 3333 4444" ); +}; +is($e, undef); +is($x->account_number, "10203040501111222233334444"); +done_testing(); diff -Nru libtype-tiny-perl-1.000005/t/40-regression/gh1.t libtype-tiny-perl-1.004004/t/40-regression/gh1.t --- libtype-tiny-perl-1.000005/t/40-regression/gh1.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/gh1.t 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Richard Simões. +This software is copyright (c) 2013-2014, 2017-2019 by Richard Simões. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt125132.t libtype-tiny-perl-1.004004/t/40-regression/rt125132.t --- libtype-tiny-perl-1.000005/t/40-regression/rt125132.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt125132.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,89 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Test inlined Int type check clobbering C<< $1 >>. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +Marc Ballarin . + +Some modifications by Toby Inkster . + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 by Marc Ballarin. + +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 Type::Params qw(compile); +use Types::Standard qw(Str Int); + +{ + my $check; + sub check_int_tt_compile { + $check ||= compile(Int); + my ($int) = $check->(@_); + is($int, 123, 'check_int_tt_compile'); + } +} + +{ + my $check; + sub check_str_tt { + $check ||= compile(Str); + my ($int) = $check->(@_); + is($int, 123, 'check_str_tt'); + } +} + +{ + sub check_int_manual { + my ($int) = @_; + die "no Int!" unless $int =~ /^\d+$/; + is($int, 123, 'check_int_manual'); + } +} + +{ + sub check_int_tt_no_compile { + my ($int) = @_; + Int->assert_valid($int); + is($int, 123, 'check_int_tt_no_compile'); + } +} + +my $string = 'a123'; + +subtest 'using temporary variable' => sub { + if ($string =~ /a(\d+)/) { + my $matched = $1; + check_int_tt_compile($matched); + check_int_manual($matched); + check_str_tt($matched); + check_int_tt_no_compile($matched); + } +}; + +subtest 'using direct $1' => sub { + if ($string =~ /a(\d+)/) { + check_int_tt_compile($1); + check_int_manual($1); + check_str_tt($1); + check_int_tt_no_compile($1); + } +}; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt125765.t libtype-tiny-perl-1.004004/t/40-regression/rt125765.t --- libtype-tiny-perl-1.000005/t/40-regression/rt125765.t 1970-01-01 00:00:00.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt125765.t 2019-01-08 18:26:35.000000000 +0000 @@ -0,0 +1,61 @@ +=pod + +=encoding utf-8 + +=head1 PURPOSE + +Check weird error doesn't happen with deep explain. + +=head1 SEE ALSO + +L. + +=head1 AUTHOR + +KB Jørgensen . + +Some modifications by Toby Inkster . + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2018-2019 by KB Jørgensen. + +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::Fatal; +use Types::Standard qw(Dict Tuple Any); + +my @warnings; +$SIG{__WARN__} = sub { push @warnings, $_[0]; }; + +my $type = Dict->of(foo => Any); + +my $e = exception { + $type->assert_valid({ foo => 1, asd => 1 }); +}; + +like($e, qr/Reference .+ did not pass type constraint/, "got correct error for Dict"); + +is_deeply(\@warnings, [], 'no warnings') + or diag explain \@warnings; + +@warnings = (); + +$type = Tuple->of(Any); + +$e = exception { + $type->assert_valid([1, 2]); +}; + +like($e, qr/Reference .+ did not pass type constraint/, "got correct error for Tuple"); + +is_deeply(\@warnings, [], 'no warnings') + or diag explain \@warnings; + +done_testing; diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt85911.t libtype-tiny-perl-1.004004/t/40-regression/rt85911.t --- libtype-tiny-perl-1.000005/t/40-regression/rt85911.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt85911.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Diab Jerius. +This software is copyright (c) 2013-2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt86004.t libtype-tiny-perl-1.004004/t/40-regression/rt86004.t --- libtype-tiny-perl-1.000005/t/40-regression/rt86004.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt86004.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Diab Jerius. +This software is copyright (c) 2013-2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt86233.t libtype-tiny-perl-1.004004/t/40-regression/rt86233.t --- libtype-tiny-perl-1.000005/t/40-regression/rt86233.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt86233.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Vyacheslav Matyukhin. +This software is copyright (c) 2013-2014, 2017-2019 by Vyacheslav Matyukhin. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt86239.t libtype-tiny-perl-1.004004/t/40-regression/rt86239.t --- libtype-tiny-perl-1.000005/t/40-regression/rt86239.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt86239.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Vyacheslav Matyukhin. +This software is copyright (c) 2013-2014, 2017-2019 by Vyacheslav Matyukhin. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt90096-2.t libtype-tiny-perl-1.004004/t/40-regression/rt90096-2.t --- libtype-tiny-perl-1.000005/t/40-regression/rt90096-2.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt90096-2.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Diab Jerius. +This software is copyright (c) 2013-2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt90096.t libtype-tiny-perl-1.004004/t/40-regression/rt90096.t --- libtype-tiny-perl-1.000005/t/40-regression/rt90096.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt90096.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Samuel Kaufman. +This software is copyright (c) 2013-2014, 2017-2019 by Samuel Kaufman. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt92571-2.t libtype-tiny-perl-1.004004/t/40-regression/rt92571-2.t --- libtype-tiny-perl-1.000005/t/40-regression/rt92571-2.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt92571-2.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Diab Jerius. +This software is copyright (c) 2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt92571.t libtype-tiny-perl-1.004004/t/40-regression/rt92571.t --- libtype-tiny-perl-1.000005/t/40-regression/rt92571.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt92571.t 2019-01-08 18:26:35.000000000 +0000 @@ -17,7 +17,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Diab Jerius. +This software is copyright (c) 2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt92591.t libtype-tiny-perl-1.004004/t/40-regression/rt92591.t --- libtype-tiny-perl-1.000005/t/40-regression/rt92591.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt92591.t 2019-01-08 18:26:35.000000000 +0000 @@ -18,7 +18,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Diab Jerius. +This software is copyright (c) 2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt94196.t libtype-tiny-perl-1.004004/t/40-regression/rt94196.t --- libtype-tiny-perl-1.000005/t/40-regression/rt94196.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt94196.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Diab Jerius. +This software is copyright (c) 2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt97684.t libtype-tiny-perl-1.004004/t/40-regression/rt97684.t --- libtype-tiny-perl-1.000005/t/40-regression/rt97684.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt97684.t 2019-01-08 18:26:35.000000000 +0000 @@ -16,7 +16,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Diab Jerius. +This software is copyright (c) 2014, 2017-2019 by Diab Jerius. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/rt98113.t libtype-tiny-perl-1.004004/t/40-regression/rt98113.t --- libtype-tiny-perl-1.000005/t/40-regression/rt98113.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/rt98113.t 2019-01-08 18:26:35.000000000 +0000 @@ -20,7 +20,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Dagfinn Ilmari Mannsåker +This software is copyright (c) 2014, 2017-2019 by Dagfinn Ilmari Mannsåker This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/40-regression/ttxs-gh1.t libtype-tiny-perl-1.004004/t/40-regression/ttxs-gh1.t --- libtype-tiny-perl-1.000005/t/40-regression/ttxs-gh1.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/40-regression/ttxs-gh1.t 2019-01-08 18:26:35.000000000 +0000 @@ -12,7 +12,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2014 by Jed Lund. +This software is copyright (c) 2014, 2017-2019 by Jed Lund. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff -Nru libtype-tiny-perl-1.000005/t/99-moose-std-types-test.t libtype-tiny-perl-1.004004/t/99-moose-std-types-test.t --- libtype-tiny-perl-1.000005/t/99-moose-std-types-test.t 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/99-moose-std-types-test.t 2019-01-08 18:26:35.000000000 +0000 @@ -8,7 +8,7 @@ =head1 DEPENDENCIES -Test is skipped if Moose 2.0600 is not available. +Test is skipped if Moose 2.0000 is not available. =head1 AUTHOR @@ -21,7 +21,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Infinity Interactive, Inc.. +This software is copyright (c) 2013-2014, 2017-2019 by Infinity Interactive, Inc.. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system @@ -48,7 +48,7 @@ use strict; use warnings; use Test::Fatal; -use Test::Requires { 'Moose' => '2.0600' }; +use Test::Requires { 'Moose' => '2.0000' }; use Eval::TypeTiny; use IO::File; @@ -571,6 +571,7 @@ accept => [ $REGEX, $REGEX_OBJ, + $FAKE_REGEX, ], reject => [ $ZERO, @@ -595,7 +596,6 @@ $FH_OBJECT, $OBJECT, $UNDEF, - $FAKE_REGEX, ], }, GlobRef => { diff -Nru libtype-tiny-perl-1.000005/t/lib/BiggerLib.pm libtype-tiny-perl-1.004004/t/lib/BiggerLib.pm --- libtype-tiny-perl-1.000005/t/lib/BiggerLib.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/lib/BiggerLib.pm 2019-01-08 18:26:35.000000000 +0000 @@ -19,7 +19,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/t/lib/DemoLib.pm libtype-tiny-perl-1.004004/t/lib/DemoLib.pm --- libtype-tiny-perl-1.000005/t/lib/DemoLib.pm 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/t/lib/DemoLib.pm 2019-01-08 18:26:35.000000000 +0000 @@ -14,7 +14,7 @@ =head1 COPYRIGHT AND LICENCE -This software is copyright (c) 2013-2014 by Toby Inkster. +This software is copyright (c) 2013-2014, 2017-2019 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. diff -Nru libtype-tiny-perl-1.000005/TODO libtype-tiny-perl-1.004004/TODO --- libtype-tiny-perl-1.000005/TODO 2014-10-25 19:05:44.000000000 +0000 +++ libtype-tiny-perl-1.004004/TODO 2019-01-08 18:26:35.000000000 +0000 @@ -1,33 +1,20 @@ -Post-1.000000 Changes -===================== +Long-Term +========= -* Type::Params should provide compile_named/validate_named functions - tailored for named parameters rather than using the slurpy Dict hack. +* Rewrite Type::Tiny::Manual. * Try to make inlining for ClassName, RoleName, StrMatch, etc more - suitable for things like Mite. + suitable for things like Mite. Perhaps add a separate method to type + constraints for generating a string of Perl code that can be compiled + and executed without the presence of Type::Tiny and the type library. -* Inform Type::Coercion when it *should have* been frozen (for example, - the parameterized ArrayRef, HashRef, Dict, and Tuple coercion - generators). - - After that, $coercion->add_type_coercions can issue a warning about - that bad things are happening. On Perl 5.10, this can be done with - warnings::warnif. On earlier Perls that mechanism is unreliable, so - just use plain old warn. - -* Investigate popular type constraints defined outside Type-Tiny, and - consider which can be added to Types::Standard/Types::Common::*. - These would need to be constraints that can be implemented with no - non-core dependencies. - -* Possibly add a NonEmpty type constraint, allowing NonEmpty[Str], - NonEmpty[HashRef[Int]], NonEmpty[ArrayRef], etc. This would be an - interesting one for optimizing. +* Resolve RT#102457. Error::TypeTiny::Assertion needs a better way of + identifying which stack frame to report the error at, or Type::Params + needs to mark its compiled subs more clearly. -* CycleTuple[Int,Str,HashRef] should allow [1,foo=>{},2,bar=>{}]. +* Resolve RT#121763. Need to figure out the circumstances under which + this happens and fix. -* Perhaps allow Type::Coercion::FromMoose's implementation of - add_type_coercions to succeed? +* Resolve RT#120226 if HAARG will help me flesh out an API. -* to_TypeTiny's _TypeTinyFromGeneric could support inlining? +* Overhaul is_subtype_of stuff.