-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.pl
41 lines (30 loc) · 1.11 KB
/
test.pl
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
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test;
BEGIN { plan tests => 13 };
use Ogg::Vorbis::Header;
ok(1); # If we made it this far, we're ok.
#########################
# Insert your test code below, the Test module is use()ed here so read
# its man page ( perldoc Test ) for help writing this test script.
# See if partial load works
ok(my $ogg = Ogg::Vorbis::Header->new("test.ogg"));
# See if load_after works
ok($ogg->load);
# Try all the routines
ok($ogg->info->{"rate"} == 44100);
ok($ogg->comment_tags);
ok(@{$ogg->comment("artist")}->[0] == "Dan");
ok($ogg->add_comments("moog", "bog"));
ok($ogg->edit_comment("moog", "bug"));
ok($ogg->delete_comment("artist"));
ok($ogg->write_vorbis);
system("cp test.ogg test.ogg.2");
system("cp test.ogg.bak test.ogg");
ok($ogg->clear_comments);
# See if full load works
ok(my $ogg = Ogg::Vorbis::Header->load("test.ogg.2"));
ok(@{$ogg->comment("moog")}->[0] == "bug");
unlink("test.ogg.2");