Commits

Toby Inkster committed b78b6f8

document test suite

  • Participants
  • Parent commits 300cdf4

Comments (0)

Files changed (13)

+=head1 PURPOSE
+
+Checks MooX::Struct compiles.
+
+Prints out some key software versions.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More tests => 1;
 BEGIN { use_ok('MooX::Struct') };
 
+=head1 PURPOSE
+
+Basic MooX::Struct usage.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More tests => 12;
 use MooX::Struct
+=head1 PURPOSE
+
+Check that different structs can inherit from each other.
+
+Check that the "-class" option works.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More tests => 24;
 use MooX::Struct
+=head1 PURPOSE
+
+Check that the "-rw" flag works.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More tests => 1;
 use MooX::Struct -rw,
+=head1 PURPOSE
+
+Check that methods can be added to structs.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More tests => 1;
 use MooX::Struct
 	Person => [
+=head1 PURPOSE
+
+Check that the required (C<< ! >>) postfix sigil works, and that the
+scalar ((C<< $ >>), array (C<< @ >>) and hash (C<< % >>) prefix sigils
+work.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 use Scalar::Does;
 use MooX::Struct

t/07overloading.t

+=head1 PURPOSE
+
+Check that overloading to string and to arrayref work.
+
+Also checks the C<CLONE> method.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 use MooX::Struct
 	Point   => [ qw(x y) ],

t/08alt-constructor.t

+=head1 PURPOSE
+
+Check square-bracket-style constructor.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 use MooX::Struct
 	Point   => [ qw( +x +y ) ],
+=head1 PURPOSE
+
+Check that structs can consume Moo roles.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 
 BEGIN {

t/10strict-constructor.t

+=head1 PURPOSE
+
+Check that the constructor is strict (throws an error if it sees unknown
+attributes).
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More tests => 1;
 use MooX::Struct Thingy => [qw/ $x /];
 
+=head1 PURPOSE
+
+Check the experimental C<EXTEND> method.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 use MooX::Struct Point => [qw( +x +y )];
 
+=head1 PURPOSE
+
+Check that struct aliases are lexical, but can be made permanent
+using the C<< -retain >> flag.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 
 {
+=head1 PURPOSE
+
+Check C<lazy_default> from C<MooX::Struct::Util>.
+
+=head1 AUTHOR
+
+Toby Inkster E<lt>tobyink@cpan.orgE<gt>.
+
+=head1 COPYRIGHT AND LICENCE
+
+This software is copyright (c) 2012 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 Test::More;
 
 use MooX::Struct::Util qw/ lazy_default /;