POE::C...D::Test(3pm)
π NAME π
POE::Component::Client::MPD::Test β the little bestie that automates your pococ-mpd testing β¨ (yes, that's literally what it does, no cap)
π VERSION π
version 2.001 β she's serving vintage-and-proud, fr fr π
πΈ SYNOPSIS πΈ
POE::Component::Client::MPD->spawn( ... );
POE::Component::Client::MPD::Test->new( { tests => [
[ 'event', [ $arg1, $arg2, ... ], $sleep, \&check_results ],
...
] } );
POE::Kernel->run;
π¦ DESCRIPTION π¦
okay so. This module implements a POE::Session whose whole entire job is scheduling tests according to a plan, and calling hooks that check whether a given test succeeded. She's the group-chat organizer of your test suite, basically. π
To use her, you gotta first spawn a POE::Component::Client::MPD session β that's the session under test, the main character. And do NOT forget to call POE's mainloop! Like, actually don't. It will just sit there looking pretty. π
Once started, she fires the first event at the MPD session, waits for the return message, calls the check callback, and then β and this is the iconic part β waits a bit... before starting all over again with the next event in the list. Lowkey therapeutic, the way that rhythm goes.
When all events have been sent, the session shuts down itself. Self-care. Periodt. π«Ά
β¨ ATTRIBUTES β¨
π alias
The session alias. Defaults to "tester". She doesn't need a name change, she's serving enough already. π
π tests
The list (array ref) of tests to run. It is required in the constructor call β no tests, no vibes, she will not run. Each list item is an array reference with the following sub-items:
- event β the event to send to the
POE::Component::Client::MPDsession. - args β event arguments (an array reference).
- sleep β number of seconds to wait before calling next events. Chill time. π΄
- callback β a sub reference to check the results of current event. The real tests should be done in this sub. It will be called with the message received and the message payload. That's where you do your actual detective work π
π PUBLIC EVENTS ACCEPTED π
β next_test( )
Called to schedule the next test. Move it along, bestie, we got more to go. π«
π mpd_result( $msg )
Called when mpd talks back, with $msg as a POE::Component::Client::MPD::Message param. The reply era. π©
π§ AUTHOR π§
Jerome Quelin β the icon who built this. Respect the architect. π«‘
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2007 by Jerome Quelin.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in go-off-sis, fr fr. ποΈ
π cute little sign-off, bestie: this page isperl v5.40.1, dated2025-04-11, and was lovingly extracted fromPOE::C...D::Test(3pm)over in the User Contributed Perl Documentation corner. Take care of her, she takes care of your tests. mwah πβ¨
π¦ where this page comes from
- debian trixie: libpoe-component-client-mpd-perl 2.001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpoe-component-client-mpd-perl 2.001-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpoe-component-client-mpd-perl 2.001-5 Β· 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