#!/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
