fixes and more tests
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 7 Feb 2007 00:45:00 +0000 (00:45 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 7 Feb 2007 00:45:00 +0000 (00:45 +0000)
IkiWiki.pm
doc/plugins/write.mdwn
po/ikiwiki.pot
t/pagespec_match.t

index a547c57efb00f9c9f5c719994916714d10accaf9..32ca0449fb81c4c59db6a3548f713e86e11b43bf 100644 (file)
@@ -881,7 +881,7 @@ sub match_glob ($$$) { #{{{
        if ($glob =~ m!^\./!) {
                $from=~s!/?[^/]+$!!;
                $glob=~s!^\./!!;
-               $glob="$from/$glob";
+               $glob="$from/$glob" if length $from;
        }
 
        # turn glob into safe regexp
index d822408c2d49e856c802578ac7d267979a713472..1aaaf1d1e7ea7aa7e3e6371b7fbf987d735d5a9b 100644 (file)
@@ -314,9 +314,9 @@ Makes the specified page depend on the specified [[PageSpec]].
 
 #### `pagespec_match($$;$)`
 
-Passed a page name, a [[PageSpec]], and the location the glob should be
-matched against, returns true if the [[PageSpec]] matches the page. (If the
-third parameter is not passed, relative PageSpecs will match relative to
+Passed a page name, a [[PageSpec]], and the location the [[PageSpec]] should
+be matched against, returns true if the [[PageSpec]] matches the page. (If
+the third parameter is not passed, relative PageSpecs will match relative to
 the top of the wiki.)
 
 #### `bestlink($$)`
index 7ec22a68928237e256188a68b0b27424a6f6b30e..6fd3644e88662ad779fa8548039d455fea2836c1 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2007-02-06 15:59-0500\n"
+"POT-Creation-Date: 2007-02-06 19:43-0500\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
index 1b814357735c435b2bf8a23dd2459b511826a139..bd517f58bf430c8ba3d941cbfe9ed827a9f2b584 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 40;
+use Test::More tests => 41;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -18,10 +18,11 @@ ok(! pagespec_match("foo", "* and !foo", ""));
 ok(! pagespec_match("foo", "foo and !foo", ""));
 ok(! pagespec_match("foo.png", "* and !*.*", ""));
 ok(pagespec_match("foo", "(bar or ((meep and foo) or (baz or foo) or beep))", ""));
-ok(! pagespec_match("foo/bar", "./*", "foo"), "relative fail");
-ok(! pagespec_match("a/foo", "./*", "a/b"), "relative");
-ok(! pagespec_match("a/b/foo", "./*", "a/b"), "relative fail");
-ok(! pagespec_match("foo", "./*", "a"), "relative toplevel");
+ok(! pagespec_match("a/foo", "foo", "a/b"), "nonrelative fail");
+ok(! pagespec_match("foo", "./*", "a/b"), "relative fail");
+ok(pagespec_match("a/foo", "./*", "a/b"), "relative");
+ok(pagespec_match("a/b/foo", "./*", "a/b"), "relative 2");
+ok(pagespec_match("foo", "./*", "a"), "relative toplevel");
 ok(pagespec_match("foo/bar", "*", "baz"), "absolute");
 
 $links{foo}=[qw{bar baz}];