92979bdc94b87656c116ef02d9b7ec4f7b724a9e
[liburi-template-perl.git] / t / data / spec.json
1 {
2   "variables": {
3     "foo"    : "\u03d3",
4     "bar"    : "fred",
5     "baz"    : "10,20,30",
6     "qux"    : ["10","20","30"],
7     "corge"  : [],
8     "grault" : "",
9     "garply" : "a/b/c",
10     "waldo"  : "ben & jerrys",
11     "fred"   : ["fred", "", "wilma"],
12     "plugh"  : ["\u017F\u0307", "\u0073\u0307"],
13     "1-a_b.c": 200
14   },
15
16   "tests": [
17     {
18       "template": "http://example.org/?q={bar}",
19       "expected": "http://example.org/?q=fred"
20     },
21
22     {
23       "template": "/{xyzzy}",
24       "expected": "/"
25     },
26
27     {
28       "template": "http://example.org/?{-join|&|foo,bar,xyzzy,baz}",
29       "expected": "http://example.org/?foo=%CE%8E&bar=fred&baz=10%2C20%2C30"
30     },
31
32     {
33       "template": "http://example.org/?d={-list|,|qux}",
34       "expected": "http://example.org/?d=10,20,30"
35     },
36
37     {
38       "template": "http://example.org/?d={-list|&d=|qux}",
39       "expected": "http://example.org/?d=10&d=20&d=30"
40     },
41
42     {
43       "template": "http://example.org/{bar}{bar}/{garply}",
44       "expected": "http://example.org/fredfred/a%2Fb%2Fc"
45     },
46
47     {
48       "template": "http://example.org/{bar}{-prefix|/|fred}",
49       "expected": "http://example.org/fred/fred//wilma"
50     },
51
52     {
53       "template": "{-neg|:|corge}{-suffix|:|plugh}",
54       "expected": ":%E1%B9%A1:%E1%B9%A1:"
55     },
56
57     {
58       "template": "../{waldo}/",
59       "expected": "../ben%20%26%20jerrys/"
60     },
61
62     {
63       "template": "telnet:192.0.2.16{-opt|:80|grault}",
64       "expected": "telnet:192.0.2.16:80"
65     },
66
67     {
68       "template": ":{1-a_b.c}:",
69       "expected": ":200:"
70     }
71   ]
72 }