Last change
on this file since 19 was
12,
checked in by peter, 19 years ago
|
- added "exclude_path" option to Filesystem backend
- added an excluded directory to the test suite ("t/dont_look_here")
- fixed dying DB test (still a workaround for a DBD::SQLite problem)
|
File size:
900 bytes
|
Rev | Line | |
---|
[8] | 1 | #!/usr/bin/perl -w |
---|
| 2 | use strict; |
---|
| 3 | |
---|
[12] | 4 | use Test::More tests => 6; |
---|
[8] | 5 | BEGIN { use_ok('MP3::Find::Filesystem') }; |
---|
| 6 | |
---|
| 7 | my $SEARCH_DIR = 't/mp3s'; |
---|
[12] | 8 | my $EXCLUDE_DIR = 't/mp3s/dont_look_here'; |
---|
| 9 | my $MP3_COUNT = 1; |
---|
| 10 | my $EXCLUDED_MP3_COUNT = 1; |
---|
[8] | 11 | |
---|
| 12 | # exercise the object |
---|
| 13 | |
---|
| 14 | my $finder = MP3::Find::Filesystem->new; |
---|
| 15 | isa_ok($finder, 'MP3::Find::Filesystem'); |
---|
| 16 | |
---|
| 17 | # a most basic search: |
---|
| 18 | my @res = $finder->find_mp3s(dir => $SEARCH_DIR); |
---|
| 19 | is(scalar(@res), $MP3_COUNT, 'dir as scalar'); |
---|
| 20 | |
---|
| 21 | @res = $finder->find_mp3s(dir => [$SEARCH_DIR]); |
---|
| 22 | is(scalar(@res), $MP3_COUNT, 'dir as ARRAY ref'); |
---|
| 23 | |
---|
[12] | 24 | # exclude |
---|
| 25 | @res = $finder->find_mp3s(dir => $SEARCH_DIR, exclude_path => $EXCLUDE_DIR); |
---|
| 26 | is(scalar(@res), $MP3_COUNT - $EXCLUDED_MP3_COUNT, 'excluded directory'); |
---|
| 27 | |
---|
| 28 | @res = $finder->find_mp3s(dir => $SEARCH_DIR, exclude_path => [$EXCLUDE_DIR]); |
---|
| 29 | is(scalar(@res), $MP3_COUNT - $EXCLUDED_MP3_COUNT, 'excluded directory as array'); |
---|
| 30 | |
---|
[8] | 31 | #TODO: get some test mp3s |
---|
Note: See
TracBrowser
for help on using the repository browser.