File: testIsPlaylist

package info (click to toggle)
gnump3d 2.9.3-1sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,420 kB
  • ctags: 366
  • sloc: perl: 10,649; sh: 188; makefile: 147
file content (41 lines) | stat: -rwxr-xr-x 540 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
#!/usr/bin/perl -w
#  Test that recognition of playlist filetypes works correctly

use gnump3d::files;


while( <DATA> )
{
    my ($file, $shouldBe ) = split(/,/);

    if ( defined( $shouldBe ) )
    {
	chomp( $shouldBe );
    }


    my $audio = &isPlaylist( $file );

    if ( defined( $shouldBe ) && defined( $audio ) )
    {
	if ( $shouldBe ne $audio )
	{
	    print "For '$file' got '$audio' not '$shouldBe'\n";
	    exit( 1 );
	}
    }
}


#
# All OK
exit 0;


__DATA__
test.pls,1
test.m3u,1
test.ogg,0
test.mpeg,0
test,0
test.mp3,0