Fixed issue with matcher

This commit is contained in:
Jocelyn Fiat
2011-07-22 17:28:42 +02:00
parent 6599bf1a07
commit 4940ddb8f5
4 changed files with 20 additions and 5 deletions

View File

@@ -29,6 +29,12 @@ feature -- Test routines
local
tpl: URI_TEMPLATE
do
create tpl.make ("{version}/{id}")
uri_template_match (tpl, "v2/123", <<["version", "v2"], ["id" , "123"]>>, <<>>)
create tpl.make ("api/{foo}{bar}/id/{id}")
uri_template_mismatch (tpl, "api/foobar/id/123")
create tpl.make ("api/foo/{foo_id}/{?id,extra}")
uri_template_match (tpl, "api/foo/bar/", <<["foo_id", "bar"]>>, <<>>)
uri_template_match (tpl, "api/foo/bar/?id=123", <<["foo_id", "bar"]>>, <<["id", "123"]>>)