| 1 |
A user pointed out an error (in his opinion): |
| 2 |
compare_dirs_ok does not work properly on second level directories |
| 3 |
I have not verified that this error occurs |
| 4 |
|
| 5 |
compare_dirs_ok does not make sure that the first dir has all the |
| 6 |
files that appear in the second. It should call dir_contains_only_ok. |
| 7 |
|
| 8 |
The same user said that once compare_dirs_ok is fixed, there should |
| 9 |
be an option like --exclude in the standard diff. |
| 10 |
(implemented in 0.16) |
| 11 |
|
| 12 |
#----------------------------------------------------- |
| 13 |
|
| 14 |
Functions Schwern suggested which are not implemented yet: |
| 15 |
|
| 16 |
#----------------------------------------------------- |
| 17 |
|
| 18 |
dir_ok( "some/dir", { |
| 19 |
"foo" => "some/dir/foo would contain this", |
| 20 |
"bar" => "some/dir/bar would contain this", |
| 21 |
"baz/biff" => "some/dir/baz/biff would contain this" |
| 22 |
}); |
| 23 |
# I suggested using undef for the values here to request a check of structure |
| 24 |
# only, that is only file names would be examined, not contents. Yet, |
| 25 |
# Schwern had already suggested dir_contains_ok, which is probably more |
| 26 |
# directly intelligiable. |
| 27 |
|
| 28 |
#----------------------------------------------------- |
| 29 |
|
| 30 |
find_ok( "some/dir", sub { which will be run against all files in some/dir |
| 31 |
and returns true if they pass } ); |
| 32 |
(implemented in 0.16) |
| 33 |
|
| 34 |
#----------------------------------------------------- |
| 35 |
|
| 36 |
I suggested: |
| 37 |
|
| 38 |
dirs_agree("dir1", "dir2") |
| 39 |
|
| 40 |
Schwern suggested a new name for dirs_agree: |
| 41 |
|
| 42 |
compare_dirs_ok instead of dirs_agree (implemented in 0.03) |
| 43 |
|
| 44 |
(I'm extrapolating, he didn't make a direct suggestion, but his earlier |
| 45 |
suggestions point to something like this.) |
| 46 |
|
| 47 |
#----------------------------------------------------- |
| 48 |
|
| 49 |
After trying compare_dirs_ok I immediately wanted to be able to exclude |
| 50 |
some lines from the comparison. Namely, in my example, dates were the |
| 51 |
only differences. So, I still wanted the files to count as the same, even |
| 52 |
though the dates differed. That led to: |
| 53 |
|
| 54 |
compare_dirs_filter_ok($dir1, $dir2, \&filter, $name) (implemented in 0.04) |
| 55 |
|
| 56 |
filter is called for all lines of input, it must return the line with |
| 57 |
any needed changes. If the line should be omitted, it should return "". |
| 58 |
(implemented in 0.04) |
| 59 |
|
| 60 |
#----------------------------------------------------- |
| 61 |
|
| 62 |
I want compare_filer_ok($file1, $file2, $filter) to work like |
| 63 |
compare_dirs_filter but one file at a time |
| 64 |
(implemented in 0.06) |
| 65 |
|
| 66 |
#----------------------------------------------------- |
| 67 |
|
| 68 |
The version 0.15 causes a lot of warning being processed by Perl::Critic |
| 69 |
so that some style changes may improve further maintainability. |
| 70 |
(implemented in 0.16) |