Astro-SIMBAD-Client
view release on metacpan or search on metacpan
inc/My/Module/Test.pm view on Meta::CPAN
is made available for testing. Otherwise, the subroutine iterates over
the elements in the array, performing the navigation on each in turn,
and testing whether the desired value is found. If it is, the array
element in which it is found becomes the value available for testing.
Otherwise C<undef> becomes available for testing.
=head2 hidden
This subroutine returns true if its argument is the name of a module
hidden by L<Test::Without::Module|Test::Without::Module>. Otherwise it
returns false.
=head2 load_data
This subroutine takes as its argument a file containing data to be
provided via the C<canned()> subroutine. The contents of the file will
be string C<eval>-ed.
=head2 load_module
This subroutine takes as arguments a number of Perl module names. It
attempts to C<require> these in order, stopping when the first
C<require> succeeds. If none succeeds, the internal skip indicator is
set, so that subsequent tests are skipped until C<clear()> is called.
Load status is cached, so only one C<eval> is done per module.
=head2 module_loaded
This subroutine takes as its first argument the name of a module. The
second argument is the name of one of the C<My::Module::Test>
subroutines, and subsequent arguments are arguments for the named
subroutine. If the named module has not been loaded, nothing happens. If
the named module has been loaded, the named subroutine is called (as a
co-routine), with the given arguments.
=head2 returned_value
This subroutine dumps the value returned by the last call as a scalar.
It is intended for diagnostics only.
=head2 silent
This subroutine causes exception diagnostics displayed by C<call()> and
C<call_a()> to be silenced if skipping is in effect. The argument is
interpreted as a Perl boolean, and defaults to the negation of the
current setting. If skipping is not in effect, diagnostics will be
issued regardless of whether C<silence 1> is in effect.
This is cleared by C<clear>.
=head2 test
This subroutine performs the actual test. It takes two arguments: the
expected value, and the name of the test. The value made available by
C<call()>, C<count()>, C<deref()>, C<deref_curr()>, or C<find()> is
compared to the expected value, and the test succeeds or fails based on
the result of the comparison.
If the expected value is a C<Regexp> object, the comparison is done with
the C<Test::More> C<like()> subroutine. If it looks like a number, the
comparison is done with C<cmp_ok> for numeric equality. Otherwise, the
comparison is done with C<is>.
=head1 SUPPORT
Support is by the author. Please file bug reports at
L<https://rt.cpan.org/Public/Dist/Display.html?Name=Astro-SIMBAD-Client>,
L<https://github.com/trwyant/perl-Astro-SIMBAD-Client/issues>, or in
electronic mail to the author.
=head1 AUTHOR
Thomas R. Wyant, III (F<wyant at cpan dot org>)
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2011-2025 by Thomas R. Wyant, III
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl 5.10.0. For more details, see the full text
of the licenses in the files F<LICENSE-Artistic> and F<LICENSE-GNU>.
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.
=cut
# ex: set textwidth=72 :
( run in 0.525 second using v1.01-cache-2.11-cpan-39bf76dae61 )