| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: Let reservedURIComponentSet be the empty string |
| 6 |
esid: sec-decodeuricomponent-encodeduricomponent |
| 7 |
description: > |
| 8 |
uriReserved and "#" not in reservedURIComponentSet. HexDigit in |
| 9 |
[0..9, A..F] |
| 10 |
---*/ |
| 11 |
|
| 12 |
//CHECK#1 |
| 13 |
if (decodeURIComponent("%3B") !== ";") { |
| 14 |
throw new Test262Error('#1: decodeURIComponent("%3B") equal ";", not "%3B"'); |
| 15 |
} |
| 16 |
|
| 17 |
//CHECK#2 |
| 18 |
if (decodeURIComponent("%2F") !== "/") { |
| 19 |
throw new Test262Error('#2: decodeURIComponent("%2F") equal "/", not "%2F"'); |
| 20 |
} |
| 21 |
|
| 22 |
//CHECK#3 |
| 23 |
if (decodeURIComponent("%3F") !== "?") { |
| 24 |
throw new Test262Error('#3: decodeURIComponent("%3F") equal "?", not "%3F"'); |
| 25 |
} |
| 26 |
|
| 27 |
//CHECK#4 |
| 28 |
if (decodeURIComponent("%3A") !== ":") { |
| 29 |
throw new Test262Error('#4: decodeURIComponent("%3A") equal ":", not "%3A"'); |
| 30 |
} |
| 31 |
|
| 32 |
//CHECK#5 |
| 33 |
if (decodeURIComponent("%40") !== "@") { |
| 34 |
throw new Test262Error('#5: decodeURIComponent("%40") equal "@", not "%40"'); |
| 35 |
} |
| 36 |
|
| 37 |
//CHECK#6 |
| 38 |
if (decodeURIComponent("%26") !== "&") { |
| 39 |
throw new Test262Error('#6: decodeURIComponent("%26") equal "&", not "%26"'); |
| 40 |
} |
| 41 |
|
| 42 |
//CHECK#7 |
| 43 |
if (decodeURIComponent("%3D") !== "=") { |
| 44 |
throw new Test262Error('#7.1: decodeURIComponent("%3D") equal "=", not "%3D"'); |
| 45 |
} |
| 46 |
|
| 47 |
//CHECK#8 |
| 48 |
if (decodeURIComponent("%2B") !== "+") { |
| 49 |
throw new Test262Error('#8.1: decodeURIComponent("%2B") equal "+", not "%2B"'); |
| 50 |
} |
| 51 |
|
| 52 |
//CHECK#9 |
| 53 |
if (decodeURIComponent("%24") !== "$") { |
| 54 |
throw new Test262Error('#9: decodeURIComponent("%24") equal "$", not "%24"'); |
| 55 |
} |
| 56 |
|
| 57 |
//CHECK#10 |
| 58 |
if (decodeURIComponent("%2C") !== ",") { |
| 59 |
throw new Test262Error('#10: decodeURIComponent("%2C") equal ",", not "%2C"'); |
| 60 |
} |
| 61 |
|
| 62 |
//CHECK#11 |
| 63 |
if (decodeURIComponent("%23") !== "#") { |
| 64 |
throw new Test262Error('#11: decodeURIComponent("%23") equal "#", not "%23"'); |
| 65 |
} |
| 66 |
|
| 67 |
reportCompare(0, 0); |