X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=t%2Fdata%2Fspec.json;fp=t%2Fdata%2Fspec.json;h=8705267c3d6c0d573d8993415009da3094ee2799;hb=e0de6ab08282e52476e36abb99a35be9eff9ca8e;hp=0000000000000000000000000000000000000000;hpb=90a266f52eaecdd5e15d16fe4fa3b98cb184c67c;p=liburi-template-perl.git diff --git a/t/data/spec.json b/t/data/spec.json new file mode 100644 index 0000000..8705267 --- /dev/null +++ b/t/data/spec.json @@ -0,0 +1,56 @@ +{ + "variables" : { + "e" : "20% tricky", + "a" : "fred", + "scheme" : "https", + "d" : "one two three", + "20" : "this-is-spinal-tap", + "p" : "quote=to+be+or+not+to+be", + "c" : "cheeseburger", + "q" : "hullo#world", + "b" : "barney", + "f" : "" + }, + "tests" : [ + { + "template" : "http://example.org/page1#{a}", + "expected" : "http://example.org/page1#fred" + }, + { + "template" : "http://example.org/{a}/{b}/", + "expected" : "http://example.org/fred/barney/" + }, + { + "template" : "http://example.org/{a}{b}/", + "expected" : "http://example.org/fredbarney/" + }, + { + "template" : "http://example.com/order/{c}/{c}/{c}/", + "expected" : "http://example.com/order/cheeseburger/cheeseburger/cheeseburger/" + }, + { + "template" : "http://example.org/{d}", + "expected" : "http://example.org/one%20two%20three" + }, + { + "template" : "http://example.org/{e}", + "expected" : "http://example.org/20%25%20tricky" + }, + { + "template" : "http://example.com/{f}/", + "expected" : "http://example.com//" + }, + { + "template" : "{scheme}://{20}.example.org?date={wilma}&option={a}", + "expected" : "https://this-is-spinal-tap.example.org?date=&option=fred" + }, + { + "template" : "http://example.org?{p}", + "expected" : "http://example.org?quote=to+be+or+not+to+be" + }, + { + "template" : "http://example.com/{q}", + "expected" : "http://example.com/hullo#world" + } + ] +}