3 # This file is part of POE::Component::Client::MPD.
4 # Copyright (c) 2007 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.
14 use POE qw[ Component::Client::MPD::Message ];
23 dir1/title-artist-album.ogg
28 # [ 'event', [ $arg1, $arg2, ... ], $answer_back, \&check_results ]
31 # test should come first to know the song id
32 [ 'pl.clear', [], $DISCARD, undef ],
33 [ 'pl.add', \@songs, $DISCARD, undef ],
34 [ 'pl.swapid', [0,2], $DISCARD, undef ],
35 [ 'pl.as_items', [], $SEND, \&check_2ndpos ],
36 [ 'pl.swapid', [0,2], $DISCARD, undef ],
39 # test should come second to know the song id
40 [ 'pl.moveid', [0,2], $DISCARD, undef ],
41 [ 'pl.as_items', [], $SEND, \&check_2ndpos ],
42 [ 'pl.moveid', [0,0], $DISCARD, undef ],
45 [ 'pl.swap', [0,2], $DISCARD, undef ],
46 [ 'pl.as_items', [], $SEND, \&check_2ndpos ],
47 [ 'pl.swap', [0,2], $DISCARD, undef ],
50 [ 'pl.move', [0,2], $DISCARD, undef ],
51 [ 'pl.as_items', [], $SEND, \&check_2ndpos ],
54 [ 'status', [], $SEND, sub { $plvers=$_[0]->data->playlist; } ],
55 [ 'pl.shuffle', [], $DISCARD, undef ],
56 [ 'status', [], $SEND, \&check_shuffle ],
61 # are we able to test module?
62 eval 'use POE::Component::Client::MPD::Test';
63 plan skip_all => $@ if $@ =~ s/\n+BEGIN failed--compilation aborted.*//s;
67 is( $_[0]->data->playlist, $plvers+1, 'shuffle() changes playlist version' );
71 my @items = @{ $_[0]->data };
72 is( $items[2]->title, 'ok-title', 'swap[id()] / swap[id()] changes songs' );