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: If string.charAt(k) not equal "%", return this char
|
2017-06-29 21:42:01 +02:00
|
|
|
esid: sec-decodeuricomponent-encodeduricomponent
|
2014-07-22 01:09:02 +02:00
|
|
|
description: Complex tests
|
2017-04-18 22:31:31 +02:00
|
|
|
includes: [decimalToHexString.js]
|
2014-07-22 01:09:02 +02:00
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
|
|
|
//CHECK
|
2015-04-29 17:44:25 +02:00
|
|
|
var errorCount = 0;
|
|
|
|
var count = 0;
|
|
|
|
for (var indexI = 0; indexI <= 65535; indexI++) {
|
2011-09-07 08:35:18 +02:00
|
|
|
if (indexI !== 0x25) {
|
2015-04-29 17:44:25 +02:00
|
|
|
var hex = decimalToHexString(indexI);
|
2017-06-29 21:42:11 +02:00
|
|
|
try {
|
2011-09-07 08:35:18 +02:00
|
|
|
var str = String.fromCharCode(indexI);
|
2017-06-29 21:42:11 +02:00
|
|
|
if (decodeURIComponent(str) !== str) {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#' + hex + ' ');
|
2011-09-07 08:35:18 +02:00
|
|
|
errorCount++;
|
2017-06-29 21:42:11 +02:00
|
|
|
}
|
2018-02-15 21:50:18 +01:00
|
|
|
} catch (e) {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('#' + hex + ' ');
|
2011-09-07 08:35:18 +02:00
|
|
|
errorCount++;
|
2017-06-29 21:42:11 +02:00
|
|
|
}
|
2011-09-07 08:35:18 +02:00
|
|
|
count++;
|
|
|
|
}
|
2017-06-29 21:42:11 +02:00
|
|
|
}
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2017-06-29 21:42:11 +02:00
|
|
|
if (errorCount > 0) {
|
2021-07-21 21:37:52 +02:00
|
|
|
throw new Test262Error('Total error: ' + errorCount + ' bad Unicode character in ' + count);
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|