test262/test/built-ins/decodeURI/S15.1.3.1_A2.1_T1.js

24 lines
678 B
JavaScript
Raw Normal View History

// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: If string.charAt(k) not equal "%", return this char
2017-06-29 21:49:38 +02:00
esid: sec-decodeuri-encodeduri
description: Complex tests
includes: [decimalToHexString.js]
---*/
for (var indexI = 0; indexI <= 65535; indexI++) {
if (indexI !== 0x25) {
2017-06-29 21:49:49 +02:00
try {
var str = String.fromCharCode(indexI);
var differs = decodeURI(str) !== str;
} catch (e) {
throw new Test262Error('#' + decimalToHexString(indexI) + ' throws');
}
if (differs) {
throw new Test262Error('#' + decimalToHexString(indexI) + ' differs');
2017-06-29 21:49:49 +02:00
}
}
2017-06-29 21:49:49 +02:00
}