3 # This file is part of POE::Component::Client::MPD.
4 # Copyright (c) 2007-2008 Jerome Quelin, all rights reserved.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the same terms as Perl itself.
19 dir1/title-artist-album.ogg
25 # [ 'event', [ $arg1, $arg2, ... ], $sleep, \&check_results ]
28 # test should come first to know the song id
29 [ 'pl.clear', [], 0, \&check_success ],
30 [ 'pl.add', \@songs, 0, \&check_success ],
31 [ 'pl.swapid', [0,2], 0, \&check_success ],
32 [ 'pl.as_items', [], 0, \&check_2ndpos ],
33 [ 'pl.swapid', [0,2], 0, \&check_success ],
36 # test should come second to know the song id
37 [ 'pl.moveid', [0,2], 0, \&check_success ],
38 [ 'pl.as_items', [], 0, \&check_2ndpos ],
39 [ 'pl.moveid', [0,0], 0, \&check_success ],
42 [ 'pl.swap', [0,2], 0, \&check_success ],
43 [ 'pl.as_items', [], 0, \&check_2ndpos ],
44 [ 'pl.swap', [0,2], 0, \&check_success ],
47 [ 'pl.move', [0,2], 0, \&check_success ],
48 [ 'pl.as_items', [], 0, \&check_2ndpos ],
51 [ 'status', [], 0, sub { $plvers=$_[1]->playlist; } ],
52 [ 'pl.shuffle', [], 0, \&check_success ],
53 [ 'status', [], 0, \&check_shuffle ],
57 # are we able to test module?
58 eval 'use POE::Component::Client::MPD::Test nbtests=>$nbtests, tests=>\@tests';
59 diag($@), plan skip_all => $@ if $@ =~ s/\n+BEGIN failed--compilation aborted.*//s;
66 is($msg->status, 1, "command '" . $msg->request . "' returned an ok status");
70 my ($msg, $status) = @_;
72 is($status->playlist, $plvers+1, 'shuffle() changes playlist version');
76 my ($msg, $items) = @_;
78 is($items->[2]->title, 'ok-title', 'swap[id()] / swap[id()] changes songs');