Skip to content

Commit

Permalink
Fixed url test (and add a few more)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjenkinson committed Jan 27, 2016
1 parent 77ac552 commit f0e52aa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/unit/utils/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ describe('utils', function() {
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "../z.ts?abc=1#test"), "https://a.com/b/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "./../z.ts?abc=1#test"), "https://a.com/b/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "././z.ts?abc=1#test"), "https://a.com/b/cd/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "../../z.ts?abc=1#test"), "https://a.com/b/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "../../z.ts?abc=1&something=blah/./../test#test"), "https://a.com/b/z.ts?abc=1&something=blah/./../test#test");
e(fn("https://a.com/b/cd/e/f.m3u8?test=1#something", "../../z.ts?abc=1#test"), "https://a.com/b/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "../../z.ts?abc=1#test"), "https://a.com/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "../../z.ts?abc=1&something=blah/./../test#test"), "https://a.com/z.ts?abc=1&something=blah/./../test#test");
e(fn("https://a.com/b/cd/e/f.m3u8?test=1#something", "./../../z.ts?abc=1#test"), "https://a.com/b/z.ts?abc=1#test");

e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "subdir/pointless/../z.ts?abc=1#test"), "https://a.com/b/cd/subdir/z.ts?abc=1#test");
e(fn("https://a.com/b/cd/e.m3u8?test=1#something", "/subdir/pointless/../z.ts?abc=1#test"), "https://a.com/subdir/z.ts?abc=1#test");
Expand Down

0 comments on commit f0e52aa

Please sign in to comment.