summaryrefslogtreecommitdiff
path: root/t/20-modules/Type-Tiny-Enum
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2023-01-02 12:38:52 +0100
committerJonas Smedegaard <dr@jones.dk>2023-01-02 12:38:52 +0100
commita38b05357b20ef15ca83800e28f1fb44e6c6b87b (patch)
tree14d7988daaf185faee2d37857b4bfd37448b3006 /t/20-modules/Type-Tiny-Enum
parent1e2074ab6e5a2b953591c5c912e23cedffea8402 (diff)
parent5bdc3f3302539003af87a9149b3e8b4dcd3ec626 (diff)
New upstream version 2.002000
Diffstat (limited to 't/20-modules/Type-Tiny-Enum')
-rw-r--r--t/20-modules/Type-Tiny-Enum/basic.t15
-rw-r--r--t/20-modules/Type-Tiny-Enum/cmp.t2
-rw-r--r--t/20-modules/Type-Tiny-Enum/errors.t2
-rw-r--r--t/20-modules/Type-Tiny-Enum/exporter.t2
-rw-r--r--t/20-modules/Type-Tiny-Enum/exporter_lexical.t10
-rw-r--r--t/20-modules/Type-Tiny-Enum/sorter.t2
-rw-r--r--t/20-modules/Type-Tiny-Enum/union_intersection.t2
7 files changed, 27 insertions, 8 deletions
diff --git a/t/20-modules/Type-Tiny-Enum/basic.t b/t/20-modules/Type-Tiny-Enum/basic.t
index b3859f59..2dac6b72 100644
--- a/t/20-modules/Type-Tiny-Enum/basic.t
+++ b/t/20-modules/Type-Tiny-Enum/basic.t
@@ -12,7 +12,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2013-2014, 2017-2022 by Toby Inkster.
+This software is copyright (c) 2013-2014, 2017-2023 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 warnings;
use lib qw( ./lib ./t/lib ../inc ./inc );
use Test::More;
+use Test::Fatal;
use Test::TypeTiny;
use Type::Utils qw< enum >;
@@ -59,6 +60,18 @@ is_deeply(
'FBB->values retains order',
);
+is_deeply(
+ [@{ +FBB }],
+ [qw/foo bar baz/],
+ 'overload retains order',
+);
+
+isnt(
+ exception { push @{ +FBB }, 'quux' },
+ undef,
+ 'cannot push to overloaded arrayref'
+);
+
use Scalar::Util qw(refaddr);
is(
diff --git a/t/20-modules/Type-Tiny-Enum/cmp.t b/t/20-modules/Type-Tiny-Enum/cmp.t
index 3d1b99af..24815c9f 100644
--- a/t/20-modules/Type-Tiny-Enum/cmp.t
+++ b/t/20-modules/Type-Tiny-Enum/cmp.t
@@ -12,7 +12,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2018-2022 by Toby Inkster.
+This software is copyright (c) 2018-2023 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 --git a/t/20-modules/Type-Tiny-Enum/errors.t b/t/20-modules/Type-Tiny-Enum/errors.t
index e8c67923..872b4e6b 100644
--- a/t/20-modules/Type-Tiny-Enum/errors.t
+++ b/t/20-modules/Type-Tiny-Enum/errors.t
@@ -12,7 +12,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2014, 2017-2022 by Toby Inkster.
+This software is copyright (c) 2014, 2017-2023 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 --git a/t/20-modules/Type-Tiny-Enum/exporter.t b/t/20-modules/Type-Tiny-Enum/exporter.t
index ead55e8b..09c80bcf 100644
--- a/t/20-modules/Type-Tiny-Enum/exporter.t
+++ b/t/20-modules/Type-Tiny-Enum/exporter.t
@@ -12,7 +12,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2022 by Toby Inkster.
+This software is copyright (c) 2022-2023 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 --git a/t/20-modules/Type-Tiny-Enum/exporter_lexical.t b/t/20-modules/Type-Tiny-Enum/exporter_lexical.t
index a6c8681e..ac9cf1cd 100644
--- a/t/20-modules/Type-Tiny-Enum/exporter_lexical.t
+++ b/t/20-modules/Type-Tiny-Enum/exporter_lexical.t
@@ -12,7 +12,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2022 by Toby Inkster.
+This software is copyright (c) 2022-2023 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.
@@ -22,7 +22,13 @@ the same terms as the Perl 5 programming language system itself.
use strict;
use warnings;
use Test::More;
-use Test::Requires '5.037002';
+use Test::Requires { 'Exporter::Tiny' => '1.006000' };
+
+BEGIN {
+ Exporter::Tiny::_HAS_NATIVE_LEXICAL_SUB or
+ Exporter::Tiny::_HAS_MODULE_LEXICAL_SUB or
+ plan skip_all => "This test requires Exporter::Tiny support for exporting lexical subs";
+};
use Type::Tiny::Enum -lexical, Status => [ 'alive', 'dead' ];
diff --git a/t/20-modules/Type-Tiny-Enum/sorter.t b/t/20-modules/Type-Tiny-Enum/sorter.t
index 59d3823c..4e5122db 100644
--- a/t/20-modules/Type-Tiny-Enum/sorter.t
+++ b/t/20-modules/Type-Tiny-Enum/sorter.t
@@ -16,7 +16,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2020-2022 by Toby Inkster.
+This software is copyright (c) 2020-2023 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 --git a/t/20-modules/Type-Tiny-Enum/union_intersection.t b/t/20-modules/Type-Tiny-Enum/union_intersection.t
index 93bca39d..5ab14169 100644
--- a/t/20-modules/Type-Tiny-Enum/union_intersection.t
+++ b/t/20-modules/Type-Tiny-Enum/union_intersection.t
@@ -12,7 +12,7 @@ Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
=head1 COPYRIGHT AND LICENCE
-This software is copyright (c) 2022 by Toby Inkster.
+This software is copyright (c) 2022-2023 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.