File: testIsAudio

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 (58 lines) | stat: -rwxr-xr-x 715 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
53
54
55
56
57
58
#!/usr/bin/perl -w
#  Test that file suffix extraction works correctly.

use gnump3d::files;


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

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


    my $audio = &isAudio( $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.mp3,1
test.mp3.mp3,1
test.ogg,1
test.mpeg,0
test,0
foo.ogg.mpeg,0
foo..,0
test.ogg,1
test.mid,1
test.wav,1
test.rm,1
test.ram,1
test.ra,1
test.it,1
test.xm,1
test.s3m,1
test.stm,1
test.mod,1
test.dsm,1
test.far,1
test.ult,1
test.mtm,1
test.669,1