File: 12-status.t

package info (click to toggle)
libaudio-mpd-common-perl 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 124 kB
  • ctags: 13
  • sloc: perl: 323; makefile: 37
file content (52 lines) | stat: -rw-r--r-- 1,991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!perl
#
# This file is part of Audio::MPD::Common
# Copyright (c) 2007 Jerome Quelin, all rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
#

use strict;
use warnings;

use Audio::MPD::Common::Status;
use Test::More tests => 15;


my %kv = (
    volume         => 66,
    repeat         => 1,
    random         => 0,
    playlist       => 24,
    playlistlength => 21,
    xfade          => 14,
    state          => 'play',
    song           => 10,
    songid         => 11,
    time           => '45:214',
    bitrate        => 127,
    audio          => '44100:16:2',
    error          => 'problems opening audio device',
    updating_db    => 1,
);

my $s = Audio::MPD::Common::Status->new( \%kv );
isa_ok( $s,             'Audio::MPD::Common::Status',    'object creation' );
isa_ok( $s->time,       'Audio::MPD::Common::Time',      'accessor: time' );
is( $s->volume,         66,                              'accessor: volume' );
is( $s->repeat,         1,                               'accessor: repeat' );
is( $s->random,         0,                               'accessor: random' );
is( $s->playlist,       24,                              'accessor: playlist' );
is( $s->playlistlength, 21,                              'accessor: playlistlength' );
is( $s->xfade,          14,                              'accessor: xfade' );
is( $s->state,          'play',                          'accessor: state' );
is( $s->song,           10,                              'accessor: song' );
is( $s->songid,         11,                              'accessor: songid' );
is( $s->bitrate,        127,                             'accessor: bitrate' );
is( $s->audio,          '44100:16:2',                    'accessor: audio' );
is( $s->error,          'problems opening audio device', 'accessor: error' );
is( $s->updating_db,    1,                               'accessor: updating_db' );

exit;