This repository has been archived by the owner on Jul 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
adon
committed
Nov 6, 2015
1 parent
86f0637
commit 10059f1
Showing
3 changed files
with
122 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,18 +145,18 @@ Authors: Nera Liu <[email protected]> | |
}); | ||
|
||
baseURL = 'http://www.yahoo.com/fin\\ance\\hello?world#test/ing?complex#url'; | ||
expect(yUrlResolver('asdf', baseURL)).to.eql('http://www.yahoo.com/fin\\ance/asdf'); | ||
expect(yUrlResolver('asdf', baseURL)).to.eql('http://www.yahoo.com/fin/ance/asdf'); | ||
expect(yUrlResolver('/asdf', baseURL)).to.eql('http://www.yahoo.com/asdf'); | ||
expect(yUrlResolver('?asdf', baseURL)).to.eql('http://www.yahoo.com/fin\\ance\\hello?asdf'); | ||
expect(yUrlResolver('#asdf', baseURL)).to.eql('http://www.yahoo.com/fin\\ance\\hello?world#asdf'); | ||
expect(yUrlResolver('?asdf', baseURL)).to.eql('http://www.yahoo.com/fin/ance/hello?asdf'); | ||
expect(yUrlResolver('#asdf', baseURL)).to.eql('http://www.yahoo.com/fin/ance/hello?world#asdf'); | ||
absUrls.forEach(function(url, i){ | ||
expect(yUrlResolver(url, baseURL)).to.eql(absUrlsAnswers[i]); | ||
}); | ||
// last baseURL is being kept | ||
expect(yUrlResolver('asdf')).to.eql('http://www.yahoo.com/fin\\ance/asdf'); | ||
expect(yUrlResolver('asdf')).to.eql('http://www.yahoo.com/fin/ance/asdf'); | ||
expect(yUrlResolver('/asdf')).to.eql('http://www.yahoo.com/asdf'); | ||
expect(yUrlResolver('?asdf')).to.eql('http://www.yahoo.com/fin\\ance\\hello?asdf'); | ||
expect(yUrlResolver('#asdf')).to.eql('http://www.yahoo.com/fin\\ance\\hello?world#asdf'); | ||
expect(yUrlResolver('?asdf')).to.eql('http://www.yahoo.com/fin/ance/hello?asdf'); | ||
expect(yUrlResolver('#asdf')).to.eql('http://www.yahoo.com/fin/ance/hello?world#asdf'); | ||
absUrls.forEach(function(url, i){ | ||
expect(yUrlResolver(url)).to.eql(absUrlsAnswers[i]); | ||
}); | ||
|
@@ -208,6 +208,26 @@ Authors: Nera Liu <[email protected]> | |
expect(yUrlResolver('#abc', baseURL)).to.eql('#abc'); | ||
expect(yUrlResolver('hello/world.html', baseURL)).to.eql('http://yahoo.com/hello/world.html'); | ||
expect(yUrlResolver('/hello/world.html', baseURL)).to.eql('http://yahoo.com/hello/world.html'); | ||
|
||
// path resolution | ||
expect(yUrlResolver('../../hello/world.html', baseURL)).to.eql('http://yahoo.com/hello/world.html'); | ||
expect(yUrlResolver('/hello/hello2/../', baseURL)).to.eql('http://yahoo.com/hello/'); | ||
expect(yUrlResolver('/hello/hello2/..', baseURL)).to.eql('http://yahoo.com/hello/'); | ||
|
||
expect(yUrlResolver('/hello3/hello2/../../..', baseURL)).to.eql('http://yahoo.com/'); | ||
expect(yUrlResolver('/hello3/hello2/../../../', baseURL)).to.eql('http://yahoo.com/'); | ||
expect(yUrlResolver('/hello3/hello2/../../../hello', baseURL)).to.eql('http://yahoo.com/hello'); | ||
expect(yUrlResolver('/hello3/hello2/../../..?hello', baseURL)).to.eql('http://yahoo.com/?hello'); | ||
expect(yUrlResolver('/hello3/hello2/../../..#hello', baseURL)).to.eql('http://yahoo.com/#hello'); | ||
|
||
expect(yUrlResolver('/hello3/hello2/../../.', baseURL)).to.eql('http://yahoo.com/'); | ||
expect(yUrlResolver('/hello3/hello2/../.././', baseURL)).to.eql('http://yahoo.com/'); | ||
expect(yUrlResolver('/hello3/hello2/../.././hello', baseURL)).to.eql('http://yahoo.com/hello'); | ||
expect(yUrlResolver('/hello3/hello2/../../.?hello', baseURL)).to.eql('http://yahoo.com/?hello'); | ||
expect(yUrlResolver('/hello3/hello2/../../.#hello', baseURL)).to.eql('http://yahoo.com/#hello'); | ||
|
||
expect(yUrlResolver('/hello2/../hello/world.html', baseURL)).to.eql('http://yahoo.com/hello/world.html'); | ||
expect(yUrlResolver('/hello2/../hello/./world.html', baseURL)).to.eql('http://yahoo.com/hello/world.html'); | ||
}); | ||
|
||
it('mailto: scheme URLs and any relative paths', function() { | ||
|