NAME
Games::Golf::Entry - Single solution for a golf hole.
SYNOPSIS
use Games::Golf;
my $entry = new Games::Golf::Entry ( "hole.pl" );
$entry->test;
$entry->print_report;
$entry->test_ok or die;
DESCRIPTION
Internal object to be used by Games::Golf
. Each solution represents a single hole.
CONSTRUCTOR
-
Creates a new
Games::Golf::Entry
object. You should pass the path to the file that holds the solution.!!FIXME!! We should pass the hole name in order to know which test suite to apply.
!!FIXME!! Should we pass arguments as an array or as a hash?
!!FIXME!! Maybe we could create another constructor that will accept directly the code to test? Don't sure this is a good idea.
ACCESSORS
All the accessors are autoloaded.
-
Full name of the author.
- email()
-
Author's email address.
- nick()
-
Author's nickname.
- hole()
-
The name of the hole this solution solves.
- date()
-
Date of the entry.
- code()
-
The entry's code.
- result()
-
The entry's test result. This is updated by the check() method of
Games::Golf::TestSuite
.This structure is an array reference. The first parameter is the total number of tests taken. The second parameters is the number of tests passed. The rest of the array is the list of errors messages.
""
means the test passed. For example:$result = [ 5, # total number of tests taken 3, # number of tests passed "", # ok 1 "", # ok 2 "expected:\n--\n3--\ngot:\n--\n4--\n" # not ok 3 "", # ok 4 "", # ok 5 ];
- file()
-
Filename of the entry.
- id()
-
MD5 sum of the file, to make caching easier.
METHODS
- test()
-
Run the test suite on this entry.
- test_ok()
-
Return true if entry passed the test suite.
!!FIXME!! A simple true/false value, or maybe a percentage if we're playing with Test::Harness?
- print_report()
-
Outputs result of the tests.
!!FIXME!! This means whe should cache also the result of tests?
BUGS
Please report all bugs to:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Golf
TODO
Lots of stuff.
AUTHORS
- Philippe 'BooK' Bruhat <book@cpan.org>
- Dave Hoover <dave@redsquirreldesign.com>
- Steffen Müller <tsee@gmx.net>
- Jonathan E. Paton <jonathanpaton@yahoo.com>
- Jérôme Quelin <jquelin@cpan.org>
- Eugène Van der Pijll <E.C.vanderPijll@phys.uu.nl>
COPYRIGHT
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
SEE ALSO
3 POD Errors
The following errors were encountered while parsing the POD:
- Around line 216:
'=item' outside of any '=over'
- Around line 299:
You forgot a '=back' before '=head1'
- Around line 317:
Non-ASCII character seen before =encoding in 'Müller'. Assuming CP1252