提交 b570278c 编写于 作者: X xdmal

修复uri联想验证功能,同步对应用例

将uri用例的使用情况与d.ts文件保持一致。

issue: https://gitee.com/openharmony/xts_acts/issues/I53M2CSigned-off-by: Nxdmal <maxiaodong16@huawei.com>
上级 99dd7ae8
......@@ -13,7 +13,7 @@
* limitations under the License.
*/
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
import URI from '@ohos.uri'
import uri from '@ohos.uri'
describe('UriTest', function () {
/**
......@@ -24,7 +24,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_012', 0, function () {
try {
let that = new URI('#http://username:password@host:8080/directory/file?foo=1&bar=2');
let that = new uri.URI('#http://username:password@host:8080/directory/file?foo=1&bar=2');
} catch (err) {
expect(err.toString()).assertEqual("Error: #It can't be the first");
}
......@@ -38,7 +38,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_010', 0, function () {
try {
let that = new URI({name: 'gaogao'});
let that = new uri.URI({name: 'gaogao'});
} catch (err) {
expect(err.toString()).assertEqual("Error: input type err");
}
......@@ -52,7 +52,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_032', 0, function () {
try {
let that = new URI('ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2');
let that = new uri.URI('ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2');
} catch (err) {
expect(err.toString()).assertEqual("Error: SpecialPath does not conform to the rule");
}
......@@ -66,7 +66,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_030', 0, function () {
try {
let that = new URI('http://username:password@[::]:8080/directory/file?Query#gaogao faofao');
let that = new uri.URI('http://username:password@[::]:8080/directory/file?Query#gaogao faofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: Fragment does not conform to the rule");
}
......@@ -80,7 +80,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_028', 0, function () {
try {
let that = new URI('http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao');
let that = new uri.URI('http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: Query does not conform to the rule");
}
......@@ -94,7 +94,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_013', 0, function () {
try {
let that = new URI('1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
let that = new uri.URI('1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: Scheme the first character must be a letter");
}
......@@ -108,7 +108,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_014', 0, function () {
try {
let that = new URI('ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
let that = new uri.URI('ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: scheme does not conform to the rule");
}
......@@ -122,7 +122,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_026', 0, function () {
try {
let that = new URI('http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao');
let that = new uri.URI('http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: Prot does not conform to the rule");
}
......@@ -136,7 +136,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_021', 0, function () {
try {
let that = new URI('http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao');
let that = new uri.URI('http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: IPv6 is missing a closing bracket");
}
......@@ -150,7 +150,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_018', 0, function () {
try {
let that = new URI('http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
let that = new uri.URI('http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: userInfo does not conform to the rule");
}
......@@ -164,7 +164,7 @@ describe('UriTest', function () {
*/
it('SUB_Runtime_JSAPI_SR000GGR34_020', 0, function () {
try {
let that = new URI('http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
let that = new uri.URI('http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao');
} catch (err) {
expect(err.toString()).assertEqual("Error: ipv6 does not conform to the rule");
}
......@@ -177,11 +177,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_001', 0, function () {
let gaogao = new URI('http://gg:gaogao@www.baidu.com:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@www.baidu.com:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@www.baidu.com:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@www.baidu.com:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("www.baidu.com");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -196,11 +196,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor013', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[1080::8:800:200C:417A]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[1080::8:800:200C:417A]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/66path1");
......@@ -215,11 +215,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_002', 0, function () {
let gaogao = new URI('http://gg:gaogao@[::]:88/path/path66?foooo#gaogao');
let gaogao = new uri.URI('http://gg:gaogao@[::]:88/path/path66?foooo#gaogao');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[::]:88");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[::]:88/path/path66?foooo");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[::]");
expect(gaogao.port).assertEqual("88");
expect(gaogao.path).assertEqual("/path/path66");
......@@ -234,11 +234,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor015', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[1:0:0:1:2:1:2:1]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[1:0:0:1:2:1:2:1]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/66path1");
......@@ -253,11 +253,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_003', 0, function () {
let gaogao = new URI('http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[::FFFF:129.144.52.38]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[::FFFF:129.144.52.38]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -272,11 +272,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor017', 0, function () {
let gaogao = new URI('http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[::192.9.5.5]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[::192.9.5.5]:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[::192.9.5.5]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -291,11 +291,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor018', 0, function () {
let gaogao = new URI('http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[22::22:2:2%ss]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[22::22:2:2%ss]:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[22::22:2:2%ss]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -311,11 +311,11 @@ describe('UriTest', function () {
*/
it('testConstructor019', 0, function () {
let gaogao =
new URI('http://gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query#fagment');
new uri.URI('http://gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[fe80:0000:0001:0000:0440:44ff:1233:5678]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -330,11 +330,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor020', 0, function () {
let gaogao = new URI('http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@[fe80::0001:0000]:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@[fe80::0001:0000]:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("[fe80::0001:0000]");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -349,11 +349,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_004', 0, function () {
let gaogao = new URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("gg:gaogao@199.98.55.44:99");
expect(gaogao.ssp).assertEqual("//gg:gaogao@199.98.55.44:99/path/path?query");
expect(gaogao.userinfo).assertEqual("gg:gaogao");
expect(gaogao.userInfo).assertEqual("gg:gaogao");
expect(gaogao.host).assertEqual("199.98.55.44");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -368,11 +368,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_005', 0, function () {
let gaogao = new URI('http://16.9.5.4:99/path/path?query#fagment');
let gaogao = new uri.URI('http://16.9.5.4:99/path/path?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("16.9.5.4:99");
expect(gaogao.ssp).assertEqual("//16.9.5.4:99/path/path?query");
expect(gaogao.userinfo).assertEqual("null");
expect(gaogao.userInfo).assertEqual("null");
expect(gaogao.host).assertEqual("16.9.5.4");
expect(gaogao.port).assertEqual("99");
expect(gaogao.path).assertEqual("/path/path");
......@@ -387,11 +387,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor023', 0, function () {
let gaogao = new URI('http://49.99.54.12:50/path/path23?query#fagment');
let gaogao = new uri.URI('http://49.99.54.12:50/path/path23?query#fagment');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("49.99.54.12:50");
expect(gaogao.ssp).assertEqual("//49.99.54.12:50/path/path23?query");
expect(gaogao.userinfo).assertEqual("null");
expect(gaogao.userInfo).assertEqual("null");
expect(gaogao.host).assertEqual("49.99.54.12");
expect(gaogao.port).assertEqual("50");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -406,11 +406,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_006', 0, function () {
let gaogao = new URI('http://user@49.10pe8.54.12:80/path/path23?query#qwer');
let gaogao = new uri.URI('http://user@49.10pe8.54.12:80/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@49.10pe8.54.12:80");
expect(gaogao.ssp).assertEqual("//user@49.10pe8.54.12:80/path/path23?query");
expect(gaogao.userinfo).assertEqual("null");
expect(gaogao.userInfo).assertEqual("null");
expect(gaogao.host).assertEqual("null");
expect(gaogao.port).assertEqual("-1");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -425,11 +425,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_007', 0, function () {
let gaogao = new URI('http://user@www.baidu.com/path/path23?query#qwer');
let gaogao = new uri.URI('http://user@www.baidu.com/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@www.baidu.com");
expect(gaogao.ssp).assertEqual("//user@www.baidu.com/path/path23?query");
expect(gaogao.userinfo).assertEqual("user");
expect(gaogao.userInfo).assertEqual("user");
expect(gaogao.host).assertEqual("www.baidu.com");
expect(gaogao.port).assertEqual("-1");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -444,11 +444,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_008', 0, function () {
let gaogao = new URI('http://user@www.hw.com:77/path/path23?query#qwer');
let gaogao = new uri.URI('http://user@www.hw.com:77/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@www.hw.com:77");
expect(gaogao.ssp).assertEqual("//user@www.hw.com:77/path/path23?query");
expect(gaogao.userinfo).assertEqual("user");
expect(gaogao.userInfo).assertEqual("user");
expect(gaogao.host).assertEqual("www.hw.com");
expect(gaogao.port).assertEqual("77");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -463,11 +463,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_009', 0, function () {
let gaogao = new URI('ht2tp://user@www.h12343w.com:77/path/path23?query#qwer');
let gaogao = new uri.URI('ht2tp://user@www.h12343w.com:77/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("ht2tp");
expect(gaogao.authority).assertEqual("user@www.h12343w.com:77");
expect(gaogao.ssp).assertEqual("//user@www.h12343w.com:77/path/path23?query");
expect(gaogao.userinfo).assertEqual("user");
expect(gaogao.userInfo).assertEqual("user");
expect(gaogao.host).assertEqual("www.h12343w.com");
expect(gaogao.port).assertEqual("77");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -482,11 +482,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor028', 0, function () {
let gaogao = new URI('ht2tp://user@www.1hw.1com:77/path/path23?query#qwer');
let gaogao = new uri.URI('ht2tp://user@www.1hw.1com:77/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("ht2tp");
expect(gaogao.authority).assertEqual("user@www.1hw.1com:77");
expect(gaogao.ssp).assertEqual("//user@www.1hw.1com:77/path/path23?query");
expect(gaogao.userinfo).assertEqual("null");
expect(gaogao.userInfo).assertEqual("null");
expect(gaogao.host).assertEqual("null");
expect(gaogao.port).assertEqual("-1");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -501,11 +501,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor029', 0, function () {
let gaogao = new URI('http://user@hosthost/path/path23?query#qwer');
let gaogao = new uri.URI('http://user@hosthost/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@hosthost");
expect(gaogao.ssp).assertEqual("//user@hosthost/path/path23?query");
expect(gaogao.userinfo).assertEqual("user");
expect(gaogao.userInfo).assertEqual("user");
expect(gaogao.host).assertEqual("hosthost");
expect(gaogao.port).assertEqual("-1");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -520,11 +520,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor030', 0, function () {
let gaogao = new URI('http://user@[::]/path/path23?query#qwer');
let gaogao = new uri.URI('http://user@[::]/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("user@[::]");
expect(gaogao.ssp).assertEqual("//user@[::]/path/path23?query");
expect(gaogao.userinfo).assertEqual("user");
expect(gaogao.userInfo).assertEqual("user");
expect(gaogao.host).assertEqual("[::]");
expect(gaogao.port).assertEqual("-1");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -539,11 +539,11 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testConstructor031', 0, function () {
let gaogao = new URI('http://[::192:0:5]/path/path23?query#qwer');
let gaogao = new uri.URI('http://[::192:0:5]/path/path23?query#qwer');
expect(gaogao.scheme).assertEqual("http");
expect(gaogao.authority).assertEqual("[::192:0:5]");
expect(gaogao.ssp).assertEqual("//[::192:0:5]/path/path23?query");
expect(gaogao.userinfo).assertEqual("null");
expect(gaogao.userInfo).assertEqual("null");
expect(gaogao.host).assertEqual("[::192:0:5]");
expect(gaogao.port).assertEqual("-1");
expect(gaogao.path).assertEqual("/path/path23");
......@@ -558,7 +558,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testEquals001', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = gaogao;
let res = gaogao.equals(gaogao1);
expect(res).assertEqual(true);
......@@ -571,8 +571,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_034', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let res = gaogao.equals(gaogao1);
expect(res).assertEqual(true);
})
......@@ -584,8 +584,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_035', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let res = gaogao.equals(gaogao1);
expect(res).assertEqual(false);
})
......@@ -597,8 +597,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testEquals004', 0, function () {
let gaogao = new URI('http://gg:gaogao@wwwaaa:99/path1?query#fagment');
let gaogao1 = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let gaogao = new uri.URI('http://gg:gaogao@wwwaaa:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123');
let res = gaogao.equals(gaogao1);
expect(res).assertEqual(false);
})
......@@ -610,8 +610,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testEquals005', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new URI('http://[1:0:0:1:2:1:2:1]/path1?query#fagment123');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment');
let gaogao1 = new uri.URI('http://[1:0:0:1:2:1:2:1]/path1?query#fagment123');
let res = gaogao.equals(gaogao1);
expect(res).assertEqual(false);
})
......@@ -623,7 +623,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_036', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/path/path1");
expect(res.toString()).assertEqual("http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/path1?query#fagment");
......@@ -636,7 +636,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_037', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/../../path");
expect(res.toString()).assertEqual("http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment");
......@@ -649,7 +649,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testNormalize003', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/../../../aa/bb/cc");
expect(res.toString()).assertEqual("http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../../aa/bb/cc?query#fagment");
......@@ -662,7 +662,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_038', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query');
let res = gaogao.normalize();
expect(res.path).assertEqual("/../../aa/bb/cc");
expect(res.toString()).assertEqual("http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../aa/bb/cc?query");
......@@ -675,7 +675,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_039', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment');
let res = gaogao.normalize();
expect(res.path).assertEqual("/path/aa/bb/cc");
expect(res.toString()).assertEqual("http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/aa/bb/cc?query#fagment");
......@@ -688,7 +688,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_042', 0, function () {
let gaogao = new URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
let res = gaogao.toString();
expect(res).assertEqual('http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment');
})
......@@ -700,7 +700,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testToString002', 0, function () {
let gaogao = new URI('htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment');
let gaogao = new uri.URI('htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment');
let res = gaogao.toString();
expect(res).assertEqual('htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment');
})
......@@ -712,7 +712,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testToString003', 0, function () {
let gaogao = new URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.toString();
expect(res).assertEqual('ftp://username:password@www.baidu.com:88/path?query#fagment');
})
......@@ -724,7 +724,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_043', 0, function () {
let gaogao = new URI('http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment');
let gaogao = new uri.URI('http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment');
let res = gaogao.toString();
expect(res).assertEqual('http://gg:gao%E4%BD%A0%E5%A5%BDgao@199.98.55.44:99/path/' +
'p%E4%BD%A0%E5%A5%BDath?qu%E4%BD%A0%E5%A5%BDery#fag%E4%BD%A0%E5%A5%BDment');
......@@ -737,7 +737,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testToString005', 0, function () {
let gaogao = new URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
let gaogao = new uri.URI('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
let res = gaogao.toString();
expect(res).assertEqual('http://gg:gaogao@199.98.55.44:99/path/path?query#fagment');
})
......@@ -749,7 +749,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_041', 0, function () {
let gaogao = new URI('f/tp://username:password@www.baidu.com:88/path?query#fagment');
let gaogao = new uri.URI('f/tp://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(false);
})
......@@ -761,7 +761,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('SUB_Runtime_JSAPI_SR000GGR34_040', 0, function () {
let gaogao = new URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
let gaogao = new uri.URI('ftp://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(true);
})
......@@ -773,7 +773,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testCheckIsAbsolute003', 0, function () {
let gaogao = new URI('htt/p://username:password@www.baidu.com:88/path?query#fagment');
let gaogao = new uri.URI('htt/p://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(false);
})
......@@ -785,7 +785,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testCheckIsAbsolute004', 0, function () {
let gaogao = new URI('https://username:password@www.baidu.com:88/path?query#fagment');
let gaogao = new uri.URI('https://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(true);
})
......@@ -797,7 +797,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it('testCheckIsAbsolute005', 0, function () {
let gaogao = new URI('http1://username:password@www.baidu.com:88/path?query#fagment');
let gaogao = new uri.URI('http1://username:password@www.baidu.com:88/path?query#fagment');
let res = gaogao.checkIsAbsolute();
expect(res).assertEqual(true);
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册