summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json')
-rw-r--r--testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json152
1 files changed, 152 insertions, 0 deletions
diff --git a/testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json b/testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json
new file mode 100644
index 0000000000..0043ac08bc
--- /dev/null
+++ b/testing/web-platform/tests/urlpattern/resources/urlpattern-compare-test-data.json
@@ -0,0 +1,152 @@
+[
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/a" },
+ "right": { "pathname": "/foo/b" },
+ "expected": -1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/b" },
+ "right": { "pathname": "/foo/bar" },
+ "expected": -1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/bar" },
+ "right": { "pathname": "/foo/:bar" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/" },
+ "right": { "pathname": "/foo/:bar" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/:bar" },
+ "right": { "pathname": "/foo/*" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/{bar}" },
+ "right": { "pathname": "/foo/(bar)" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/{bar}" },
+ "right": { "pathname": "/foo/{bar}+" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/{bar}+" },
+ "right": { "pathname": "/foo/{bar}?" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/{bar}?" },
+ "right": { "pathname": "/foo/{bar}*" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/(123)" },
+ "right": { "pathname": "/foo/(12)" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/:b" },
+ "right": { "pathname": "/foo/:a" },
+ "expected": 0
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "*/foo" },
+ "right": { "pathname": "*" },
+ "expected": 1
+ },
+ {
+ "component": "port",
+ "left": { "port": "9" },
+ "right": { "port": "100" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "foo/:bar?/baz" },
+ "right": { "pathname": "foo/{:bar}?/baz" },
+ "expected": -1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "foo/:bar?/baz" },
+ "right": { "pathname": "foo{/:bar}?/baz" },
+ "expected": 0
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "foo/:bar?/baz" },
+ "right": { "pathname": "fo{o/:bar}?/baz" },
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "foo/:bar?/baz" },
+ "right": { "pathname": "foo{/:bar/}?baz" },
+ "expected": -1
+ },
+ {
+ "component": "pathname",
+ "left": "https://a.example.com/b?a",
+ "right": "https://b.example.com/a?b",
+ "expected": 1
+ },
+ {
+ "component": "pathname",
+ "left": { "pathname": "/foo/{bar}/baz" },
+ "right": { "pathname": "/foo/bar/baz" },
+ "expected": 0
+ },
+ {
+ "component": "protocol",
+ "left": { "protocol": "a" },
+ "right": { "protocol": "b" },
+ "expected": -1
+ },
+ {
+ "component": "username",
+ "left": { "username": "a" },
+ "right": { "username": "b" },
+ "expected": -1
+ },
+ {
+ "component": "password",
+ "left": { "password": "a" },
+ "right": { "password": "b" },
+ "expected": -1
+ },
+ {
+ "component": "hostname",
+ "left": { "hostname": "a" },
+ "right": { "hostname": "b" },
+ "expected": -1
+ },
+ {
+ "component": "search",
+ "left": { "search": "a" },
+ "right": { "search": "b" },
+ "expected": -1
+ },
+ {
+ "component": "hash",
+ "left": { "hash": "a" },
+ "right": { "hash": "b" },
+ "expected": -1
+ }
+]