S15.1.3.2_A3_T2.js (1915B)
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" or "%3b"'); 15 } 16 17 //CHECK#2 18 if (decodeURIComponent("%2f") !== "/") { 19 throw new Test262Error('#2: decodeURIComponent("%2f") equal "/", not "%2F" or "%2f"'); 20 } 21 22 //CHECK#3 23 if (decodeURIComponent("%3f") !== "?") { 24 throw new Test262Error('#3: decodeURIComponent("%3f") equal "?", not "%3F" or "%3f"'); 25 } 26 27 //CHECK#4 28 if (decodeURIComponent("%3a") !== ":") { 29 throw new Test262Error('#4: decodeURIComponent("%3a") equal ":", not "%3A" or "%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" or "%3d"'); 45 } 46 47 //CHECK#8 48 if (decodeURIComponent("%2b") !== "+") { 49 throw new Test262Error('#8.1: decodeURIComponent("%2b") equal "+", not "%2B" or "%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" or "%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);