summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2020-07-30 00:02:10 +0200
committerNicolas George <george@nsup.org>2020-08-12 16:45:21 +0200
commit1201687da268c11459891a80ca1972aeaca8db88 (patch)
tree957a7fa03127b4ba83ed810b8eccb0532dfda5f6 /tests
parentd853293679f93ef882e6a5f1c47eb5a65ceddf3d (diff)
lavf/url: rewrite ff_make_absolute_url() using ff_url_decompose().
Also add and update some tests. Change the semantic a little, because for filesytem paths symlinks complicate things. See the comments in the code for detail. Fix trac tickets #8813 and 8814.
Diffstat (limited to 'tests')
-rw-r--r--tests/ref/fate/url54
1 files changed, 52 insertions, 2 deletions
diff --git a/tests/ref/fate/url b/tests/ref/fate/url
index 84cf85abdd..7e6395c47b 100644
--- a/tests/ref/fate/url
+++ b/tests/ref/fate/url
@@ -46,9 +46,9 @@ http://[::1]:8080/dev/null =>
Testing ff_make_absolute_url:
(null) baz => baz
/foo/bar baz => /foo/baz
- /foo/bar ../baz => /baz
+ /foo/bar ../baz => /foo/../baz
/foo/bar /baz => /baz
- /foo/bar ../../../baz => /baz
+ /foo/bar ../../../baz => /foo/../../../baz
http://server/foo/ baz => http://server/foo/baz
http://server/foo/bar baz => http://server/foo/baz
http://server/foo/ ../baz => http://server/baz
@@ -62,6 +62,56 @@ Testing ff_make_absolute_url:
http://server/foo/bar /../../../../../other/url => http://server/other/url
http://server/foo/bar /test/../../../../../other/url => http://server/other/url
http://server/foo/bar /test/../../test/../../../other/url => http://server/other/url
+ http://server/foo/bar file:../baz/qux => file:../baz/qux
+ http://server/foo//bar/ ../../ => http://server/foo/
+ file:../tmp/foo ../bar/ => file:../tmp/../bar/
+ file:../tmp/foo file:../bar/ => file:../bar/
+ http://server/foo/bar ./ => http://server/foo/
+ http://server/foo/bar .dotfile => http://server/foo/.dotfile
+ http://server/foo/bar ..doubledotfile => http://server/foo/..doubledotfile
+ http://server/foo/bar double..dotfile => http://server/foo/double..dotfile
+ http://server/foo/bar doubledotfile.. => http://server/foo/doubledotfile..
+ http://a/b/c/d;p?q g:h => g:h
+ http://a/b/c/d;p?q g => http://a/b/c/g
+ http://a/b/c/d;p?q ./g => http://a/b/c/g
+ http://a/b/c/d;p?q g/ => http://a/b/c/g/
+ http://a/b/c/d;p?q /g => http://a/g
+ http://a/b/c/d;p?q //g => http://g
+ http://a/b/c/d;p?q ?y => http://a/b/c/d;p?y
+ http://a/b/c/d;p?q g?y => http://a/b/c/g?y
+ http://a/b/c/d;p?q #s => http://a/b/c/d;p?q#s
+ http://a/b/c/d;p?q g#s => http://a/b/c/g#s
+ http://a/b/c/d;p?q g?y#s => http://a/b/c/g?y#s
+ http://a/b/c/d;p?q ;x => http://a/b/c/;x
+ http://a/b/c/d;p?q g;x => http://a/b/c/g;x
+ http://a/b/c/d;p?q g;x?y#s => http://a/b/c/g;x?y#s
+ http://a/b/c/d;p?q => http://a/b/c/d;p?q
+ http://a/b/c/d;p?q . => http://a/b/c/
+ http://a/b/c/d;p?q ./ => http://a/b/c/
+ http://a/b/c/d;p?q .. => http://a/b/
+ http://a/b/c/d;p?q ../ => http://a/b/
+ http://a/b/c/d;p?q ../g => http://a/b/g
+ http://a/b/c/d;p?q ../.. => http://a/
+ http://a/b/c/d;p?q ../../ => http://a/
+ http://a/b/c/d;p?q ../../g => http://a/g
+ http://a/b/c/d;p?q ../../../g => http://a/g
+ http://a/b/c/d;p?q ../../../../g => http://a/g
+ http://a/b/c/d;p?q /./g => http://a/g
+ http://a/b/c/d;p?q /../g => http://a/g
+ http://a/b/c/d;p?q g. => http://a/b/c/g.
+ http://a/b/c/d;p?q .g => http://a/b/c/.g
+ http://a/b/c/d;p?q g.. => http://a/b/c/g..
+ http://a/b/c/d;p?q ..g => http://a/b/c/..g
+ http://a/b/c/d;p?q ./../g => http://a/b/g
+ http://a/b/c/d;p?q ./g/. => http://a/b/c/g/
+ http://a/b/c/d;p?q g/./h => http://a/b/c/g/h
+ http://a/b/c/d;p?q g/../h => http://a/b/c/h
+ http://a/b/c/d;p?q g;x=1/./y => http://a/b/c/g;x=1/y
+ http://a/b/c/d;p?q g;x=1/../y => http://a/b/c/y
+ http://a/b/c/d;p?q g?y/./x => http://a/b/c/g?y/./x
+ http://a/b/c/d;p?q g?y/../x => http://a/b/c/g?y/../x
+ http://a/b/c/d;p?q g#s/./x => http://a/b/c/g#s/./x
+ http://a/b/c/d;p?q g#s/../x => http://a/b/c/g#s/../x
Testing av_url_split:
/foo/bar => -1 /foo/bar