|
| 1 | +[ |
| 2 | + { |
| 3 | + "component": "pathname", |
| 4 | + "left": { "pathname": "/foo/a" }, |
| 5 | + "right": { "pathname": "/foo/b" }, |
| 6 | + "expected": -1 |
| 7 | + }, |
| 8 | + { |
| 9 | + "component": "pathname", |
| 10 | + "left": { "pathname": "/foo/b" }, |
| 11 | + "right": { "pathname": "/foo/bar" }, |
| 12 | + "expected": -1 |
| 13 | + }, |
| 14 | + { |
| 15 | + "component": "pathname", |
| 16 | + "left": { "pathname": "/foo/bar" }, |
| 17 | + "right": { "pathname": "/foo/:bar" }, |
| 18 | + "expected": 1 |
| 19 | + }, |
| 20 | + { |
| 21 | + "component": "pathname", |
| 22 | + "left": { "pathname": "/foo/" }, |
| 23 | + "right": { "pathname": "/foo/:bar" }, |
| 24 | + "expected": 1 |
| 25 | + }, |
| 26 | + { |
| 27 | + "component": "pathname", |
| 28 | + "left": { "pathname": "/foo/:bar" }, |
| 29 | + "right": { "pathname": "/foo/*" }, |
| 30 | + "expected": 1 |
| 31 | + }, |
| 32 | + { |
| 33 | + "component": "pathname", |
| 34 | + "left": { "pathname": "/foo/{bar}" }, |
| 35 | + "right": { "pathname": "/foo/(bar)" }, |
| 36 | + "expected": 1 |
| 37 | + }, |
| 38 | + { |
| 39 | + "component": "pathname", |
| 40 | + "left": { "pathname": "/foo/{bar}" }, |
| 41 | + "right": { "pathname": "/foo/{bar}+" }, |
| 42 | + "expected": 1 |
| 43 | + }, |
| 44 | + { |
| 45 | + "component": "pathname", |
| 46 | + "left": { "pathname": "/foo/{bar}+" }, |
| 47 | + "right": { "pathname": "/foo/{bar}?" }, |
| 48 | + "expected": 1 |
| 49 | + }, |
| 50 | + { |
| 51 | + "component": "pathname", |
| 52 | + "left": { "pathname": "/foo/{bar}?" }, |
| 53 | + "right": { "pathname": "/foo/{bar}*" }, |
| 54 | + "expected": 1 |
| 55 | + }, |
| 56 | + { |
| 57 | + "component": "pathname", |
| 58 | + "left": { "pathname": "/foo/(123)" }, |
| 59 | + "right": { "pathname": "/foo/(12)" }, |
| 60 | + "expected": 1 |
| 61 | + }, |
| 62 | + { |
| 63 | + "component": "pathname", |
| 64 | + "left": { "pathname": "/foo/:b" }, |
| 65 | + "right": { "pathname": "/foo/:a" }, |
| 66 | + "expected": 0 |
| 67 | + }, |
| 68 | + { |
| 69 | + "component": "pathname", |
| 70 | + "left": { "pathname": "*/foo" }, |
| 71 | + "right": { "pathname": "*" }, |
| 72 | + "expected": 1 |
| 73 | + }, |
| 74 | + { |
| 75 | + "component": "port", |
| 76 | + "left": { "port": "9" }, |
| 77 | + "right": { "port": "100" }, |
| 78 | + "expected": 1 |
| 79 | + }, |
| 80 | + { |
| 81 | + "component": "pathname", |
| 82 | + "left": { "pathname": "foo/:bar?/baz" }, |
| 83 | + "right": { "pathname": "foo/{:bar}?/baz" }, |
| 84 | + "expected": -1 |
| 85 | + }, |
| 86 | + { |
| 87 | + "component": "pathname", |
| 88 | + "left": { "pathname": "foo/:bar?/baz" }, |
| 89 | + "right": { "pathname": "foo{/:bar}?/baz" }, |
| 90 | + "expected": 0 |
| 91 | + }, |
| 92 | + { |
| 93 | + "component": "pathname", |
| 94 | + "left": { "pathname": "foo/:bar?/baz" }, |
| 95 | + "right": { "pathname": "fo{o/:bar}?/baz" }, |
| 96 | + "expected": 1 |
| 97 | + }, |
| 98 | + { |
| 99 | + "component": "pathname", |
| 100 | + "left": { "pathname": "foo/:bar?/baz" }, |
| 101 | + "right": { "pathname": "foo{/:bar/}?baz" }, |
| 102 | + "expected": -1 |
| 103 | + }, |
| 104 | + { |
| 105 | + "component": "pathname", |
| 106 | + "left": "https://a.example.com/b?a", |
| 107 | + "right": "https://b.example.com/a?b", |
| 108 | + "expected": 1 |
| 109 | + }, |
| 110 | + { |
| 111 | + "component": "pathname", |
| 112 | + "left": { "pathname": "/foo/{bar}/baz" }, |
| 113 | + "right": { "pathname": "/foo/bar/baz" }, |
| 114 | + "expected": 0 |
| 115 | + }, |
| 116 | + { |
| 117 | + "component": "protocol", |
| 118 | + "left": { "protocol": "a" }, |
| 119 | + "right": { "protocol": "b" }, |
| 120 | + "expected": -1 |
| 121 | + }, |
| 122 | + { |
| 123 | + "component": "username", |
| 124 | + "left": { "username": "a" }, |
| 125 | + "right": { "username": "b" }, |
| 126 | + "expected": -1 |
| 127 | + }, |
| 128 | + { |
| 129 | + "component": "password", |
| 130 | + "left": { "password": "a" }, |
| 131 | + "right": { "password": "b" }, |
| 132 | + "expected": -1 |
| 133 | + }, |
| 134 | + { |
| 135 | + "component": "hostname", |
| 136 | + "left": { "hostname": "a" }, |
| 137 | + "right": { "hostname": "b" }, |
| 138 | + "expected": -1 |
| 139 | + }, |
| 140 | + { |
| 141 | + "component": "search", |
| 142 | + "left": { "search": "a" }, |
| 143 | + "right": { "search": "b" }, |
| 144 | + "expected": -1 |
| 145 | + }, |
| 146 | + { |
| 147 | + "component": "hash", |
| 148 | + "left": { "hash": "a" }, |
| 149 | + "right": { "hash": "b" }, |
| 150 | + "expected": -1 |
| 151 | + } |
| 152 | +] |
0 commit comments