POE::C...D::Test(3pm)

πŸ“¦
version 2.001 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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::MPD session.
  • 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. 🫑


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 is perl v5.40.1, dated 2025-04-11, and was lovingly extracted from POE::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