-ok(pagespec_match("foo", "*", ""));
-ok(pagespec_match("page", "?ag?", ""));
-ok(! pagespec_match("page", "?a?g?", ""));
-ok(pagespec_match("foo.png", "*.*", ""));
-ok(! pagespec_match("foo", "*.*", ""));
-ok(pagespec_match("foo", "foo or bar", ""), "simple list");
-ok(pagespec_match("bar", "foo or bar", ""), "simple list 2");
-ok(pagespec_match("foo", "f?? and !foz", ""));
-ok(! pagespec_match("foo", "f?? and !foo", ""));
-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("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");
+ok(pagespec_match("foo", "*"));
+ok(!pagespec_match("foo", ""));
+ok(pagespec_match("foo", "!bar"));
+ok(pagespec_match("page", "?ag?"));
+ok(! pagespec_match("page", "?a?g?"));
+ok(pagespec_match("foo.png", "*.*"));
+ok(! pagespec_match("foo", "*.*"));
+ok(pagespec_match("foo", "foo or bar"), "simple list");
+ok(pagespec_match("bar", "foo or bar"), "simple list 2");
+ok(pagespec_match("foo", "f?? and !foz"));
+ok(! pagespec_match("foo", "f?? and !foo"));
+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
+ or (
+ (meep and foo)
+ or
+ (baz or foo)
+ or beep
+ )
+)"), "multiline complex pagespec");
+ok(! pagespec_match("a/foo", "foo", location => "a/b"), "nonrelative fail");
+ok(! pagespec_match("foo", "./*", location => "a/b"), "relative fail");
+ok(pagespec_match("a/foo", "./*", location => "a/b"), "relative");
+ok(pagespec_match("a/b/foo", "./*", location => "a/b"), "relative 2");
+ok(pagespec_match("a/foo", "./*", "a/b"), "relative oldstyle call");
+ok(pagespec_match("foo", "./*", location => "a"), "relative toplevel");
+ok(pagespec_match("foo/bar", "*", location => "baz"), "absolute");
+ok(! pagespec_match("foo", "foo and bar"), "foo and bar");
+ok(pagespec_match("{f}oo", "{*}*"), "curly match");
+ok(! pagespec_match("foo", "{*}*"), "curly !match");
+
+ok(pagespec_match("somepage", "user(frodo)", user => "frodo"));
+ok(pagespec_match("somepage", "user(frodo)", user => "Frodo"));
+ok(! pagespec_match("somepage", "user(frodo)", user => "Sam"));
+ok(pagespec_match("somepage", "user(*o)", user => "Bilbo"));
+ok(pagespec_match("somepage", "user(*o)", user => "frodo"));
+ok(! pagespec_match("somepage", "user(*o)", user => "Sam"));
+ok(pagespec_match("somepage", "user(http://*.myopenid.com/)", user => "http://foo.myopenid.com/"));
+ok(pagespec_match("somepage", "user(*://*)", user => "http://foo.myopenid.com/"));