extended copyright info to 2009
[audio-mpd.git] / t / 25-settings.t
blobf3fb0c1b6c55b4a2f46c30b0fade9c83c270b82f
1 #!perl
3 # This file is part of Audio::MPD
4 # Copyright (c) 2007-2009 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.
11 use strict;
12 use warnings;
14 use Audio::MPD;
15 use Test::More;
17 # are we able to test module?
18 eval 'use Audio::MPD::Test';
19 plan skip_all => $@ if $@ =~ s/\n+Compilation failed.*//s;
21 plan tests => 10;
22 my $mpd = Audio::MPD->new;
26 # testing repeat
27 $mpd->repeat(1);
28 is( $mpd->status->repeat, 1, 'enabling repeat mode' );
29 $mpd->repeat(0);
30 is( $mpd->status->repeat, 0, 'disabling repeat mode' );
31 $mpd->repeat;
32 is( $mpd->status->repeat, 1, 'toggling repeat mode to on' );
33 $mpd->repeat;
34 is( $mpd->status->repeat, 0, 'toggling repeat mode to off' );
38 # testing random
39 $mpd->random(1);
40 is( $mpd->status->random, 1, 'enabling random mode' );
41 $mpd->random(0);
42 is( $mpd->status->random, 0, 'disabling random mode' );
43 $mpd->random;
44 is( $mpd->status->random, 1, 'toggling random mode to on' );
45 $mpd->random;
46 is( $mpd->status->random, 0, 'toggling random mode to off' );
50 # testing fade
51 $mpd->fade(15);
52 is( $mpd->status->xfade, 15, 'enabling fading' );
53 $mpd->fade;
54 is( $mpd->status->xfade,  0, 'disabling fading by default' );
57 exit;