add_depends should default to content dependencies if unknown type specified
parent
e45e23a7f1
commit
7a8b492bcc
|
@ -1810,9 +1810,7 @@ sub add_depends ($$;@) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
$deptype=$DEPEND_CONTENT unless $deptype;
|
||||||
$deptype=$DEPEND_CONTENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($simple) {
|
if ($simple) {
|
||||||
$depends_simple{$page}{lc $pagespec} |= $deptype;
|
$depends_simple{$page}{lc $pagespec} |= $deptype;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
use Test::More tests => 85;
|
use Test::More tests => 88;
|
||||||
|
|
||||||
BEGIN { use_ok("IkiWiki"); }
|
BEGIN { use_ok("IkiWiki"); }
|
||||||
%config=IkiWiki::defaultconfig();
|
%config=IkiWiki::defaultconfig();
|
||||||
|
@ -85,3 +85,8 @@ foreach my $spec ("index or (backlink(index) and !*.png)", "backlink(foo)") {
|
||||||
ok($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_LINKS);
|
ok($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_LINKS);
|
||||||
ok(! ($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_PRESENCE));
|
ok(! ($IkiWiki::depends{foo7}{$spec} & $IkiWiki::DEPEND_PRESENCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# content is the default if unknown types are entered
|
||||||
|
ok(add_depends("foo8", "*", presenCe => 1));
|
||||||
|
ok($IkiWiki::depends{foo8}{"*"} & $IkiWiki::DEPEND_CONTENT);
|
||||||
|
ok(! ($IkiWiki::depends{foo8}{"*"} & ($IkiWiki::DEPEND_PRESENCE | $IkiWiki::DEPEND_LINKS)));
|
||||||
|
|
Loading…
Reference in New Issue