2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
|
|
|
info: Let reservedURIComponentSet be the empty string
|
2017-06-29 21:42:01 +02:00
|
|
|
esid: sec-decodeuricomponent-encodeduricomponent
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
uriReserved and "#" not in reservedURIComponentSet. HexDigit in
|
|
|
|
[0..9, a..f]
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//CHECK#1
|
|
|
|
if (decodeURIComponent("%3b") !== ";") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#1: decodeURIComponent("%3b") equal ";", not "%3B" or "%3b"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#2
|
|
|
|
if (decodeURIComponent("%2f") !== "/") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#2: decodeURIComponent("%2f") equal "/", not "%2F" or "%2f"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#3
|
|
|
|
if (decodeURIComponent("%3f") !== "?") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#3: decodeURIComponent("%3f") equal "?", not "%3F" or "%3f"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#4
|
|
|
|
if (decodeURIComponent("%3a") !== ":") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#4: decodeURIComponent("%3a") equal ":", not "%3A" or "%3a"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#5
|
|
|
|
if (decodeURIComponent("%40") !== "@") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#5: decodeURIComponent("%40") equal "@", not "%40"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#6
|
|
|
|
if (decodeURIComponent("%26") !== "&") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#6: decodeURIComponent("%26") equal "&", not "%26"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#7
|
|
|
|
if (decodeURIComponent("%3d") !== "=") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#7.1: decodeURIComponent("%3d") equal "=", not "%3D" or "%3d"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#8
|
|
|
|
if (decodeURIComponent("%2b") !== "+") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#8.1: decodeURIComponent("%2b") equal "+", not "%2B" or "%2b"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#9
|
|
|
|
if (decodeURIComponent("%24") !== "$") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#9: decodeURIComponent("%24") equal "$", not "%24"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#10
|
|
|
|
if (decodeURIComponent("%2c") !== ",") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#10: decodeURIComponent("%2c") equal ",", not "%2C" or "%2c"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//CHECK#11
|
|
|
|
if (decodeURIComponent("%23") !== "#") {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#11: decodeURIComponent("%23") equal "#", not "%23"');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|