Test::...:Result(3pm)
β¨ Test::DatabaseRow::Result β¨
okay bestie, so this page is all about Test::DatabaseRow::Result β the little cutie that represents the result of some db testing. iykyk. it's giving "i did a test, here's what happened, now let's tell everybody" π
πΈ SYNOPSIS πΈ
use Test::More tests => 1;
use Test::DatabaseRow::Result;
# create a test results
my $result_object = Test::DatabaseRow::Result->new(
is_error => 1,
diag => [ "The WHAM overheaded!" ]
);
# have those results render to Test::Builder
$result_object->pass_to_test_builder("fire main gun");
no cap, that's the whole vibe. you build the result object, you hand it off to Test::Builder, and it does its little thing π
π¦ DESCRIPTION π¦
so this module is used by Test::DatabaseRow::Object to represent the result of a test. that's literally it, that's the job. it holds the tea, it reports the tea ββ¨
π Accessors π
these are the read only accessors of the object. they may be (optionally) set at object creation time by passing their name and value to the constructor. so like, constructor time is your one shot at setting them β after that they're just read-only icons π
each accessor may be queried by prefixing its name with the has_ to determine (yes bestie, the original sentence just kinda trails off there, we're keeping it fr fr) π
is_errorβ a Boolean representing if this is an error or not. true = something went sideways π, false = we ate π₯diagβ an arrayref containing diagnostic error strings that can help explain any error. like, the receipts for why it broke π
π Methods π
new(...)β simple constructor. passing arguments to the constructor sets the values of the accessors. lowkey the easiest thing you'll do all day π«Άadd_diag( @diagnostics )β adds extra diagnostics to thediagarray. more context, more clarity, we love to see it β¨pass_to_test_builder( $description )β causes this test to render itself out usingTest::Builder. it's the moment your result object gets its main character energy on stage π€is_successβ returns true if and only ifis_erroris false. that's the whole contract, no notes π―
π BUGS π
bugs (and requests for new features) can be reported through the CPAN RT system:
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-DatabaseRow>
alternatively, you can simply fork this project on github and send me pull requests. please see:
<http://github.com/2shortplanks/Test-DatabaseRow>
not me telling you to fork it and slide into the PRs, but like... yes exactly that πΈ
π AUTHOR π
written by Mark Fowler mark@twoshortplanks.com π
copyright Mark Fowler 2011.
this program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. (free as in slay ποΈ)
π SEE ALSO π
Test::DatabaseRow::Object, Test::DatabaseRow, Test::Builder, DBI
and that's the page bestie!! π this came from the perl v5.34.0 docs, dated 2022-06-17, and honestly? iconic of it. go forth and test those databases, you absolute legend π¦πβ¨
π¦ where this page comes from
- debian bookworm: libtest-databaserow-perl 2.04-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtest-databaserow-perl 2.04-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtest-databaserow-perl 2.04-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtest-databaserow-perl 2.04-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtest-databaserow-perl 2.04-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms