<html> | |
<head> | |
<meta charset='utf-8'> | |
<style> | |
.pass { | |
font-weight: bold; | |
color: green; | |
} | |
.fail { | |
font-weight: bold; | |
color: red; | |
} | |
</style> | |
<script> | |
if (window.testRunner) | |
testRunner.dumpAsText(); | |
function SputnikError(message) | |
{ | |
this.message = message; | |
} | |
SputnikError.prototype.toString = function () | |
{ | |
return 'SputnikError: ' + this.message; | |
}; | |
var sputnikException; | |
function testPrint(msg) | |
{ | |
var span = document.createElement("span"); | |
document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace | |
span.innerHTML = msg + '<br />'; | |
} | |
function escapeHTML(text) | |
{ | |
return text.toString().replace(/&/g, "&").replace(/</g, "<"); | |
} | |
function printTestPassed(msg) | |
{ | |
testPrint('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>'); | |
} | |
function printTestFailed(msg) | |
{ | |
testPrint('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>'); | |
} | |
function testFailed(msg) | |
{ | |
throw new SputnikError(msg); | |
} | |
var successfullyParsed = false; | |
</script> | |
</head> | |
<body> | |
<p>S7.6_A1.1_T5</p> | |
<div id='console'></div> | |
<script> | |
try { | |
/** | |
* @name: S7.6_A1.1_T5; | |
* @section: 7.6; | |
* @assertion: IdentifierStart :: UnicodeLetter (any character in the Unicode categories "Lu", "Ll", "Lt", "Lm", "Lo", "Nl"); | |
* @description: UnicodeLetter :: Other letter (Lo). | |
* Complex test with eval; | |
*/ | |
//CHECK | |
Lo = [[0x01AA, 0x01AA], [0x01BB, 0x01BB], [0x01BE, 0x01C3], [0x03F3, 0x03F3], [0x04C0, 0x04C0], [0x05D0, 0x05EA], [0x05F0, 0x05F2], [0x0621, 0x063A], [0x0641, 0x064A], [0x0671, 0x06B7], [0x06BA, 0x06BE], [0x06C0, 0x06CE], [0x06D0, 0x06D3], [0x06D5, 0x06D5], [0x0905, 0x0939], [0x093D, 0x093D], [0x0950, 0x0950], [0x0958, 0x0961], [0x0985, 0x098C], [0x098F, 0x0990], [0x0993, 0x09A8], [0x09AA, 0x09B0], [0x09B2, 0x09B2], [0x09B6, 0x09B9], [0x09DC, 0x09DD], [0x09DF, 0x09E1], [0x09F0, 0x09F1], [0x0A05, 0x0A0A], [0x0A0F, 0x0A10], [0x0A13, 0x0A28], [0x0A2A, 0x0A30], [0x0A32, 0x0A33], [0x0A35, 0x0A36], [0x0A38, 0x0A39], [0x0A59, 0x0A5C], [0x0A5E, 0x0A5E], [0x0A72, 0x0A74], [0x0A85, 0x0A8B], [0x0A8D, 0x0A8D], [0x0A8F, 0x0A91], [0x0A93, 0x0AA8], [0x0AAA, 0x0AB0], [0x0AB2, 0x0AB3], [0x0AB5, 0x0AB9], [0x0ABD, 0x0ABD], [0x0AD0, 0x0AD0], [0x0AE0, 0x0AE0], [0x0B05, 0x0B0C], [0x0B0F, 0x0B10], [0x0B13, 0x0B28], [0x0B2A, 0x0B30], [0x0B32, 0x0B33], [0x0B36, 0x0B39], [0x0B3D, 0x0B3D], [0x0B5C, 0x0B5D], [0x0B5F, 0x0B61], [0x0B85, 0x0B8A], [0x0B8E, 0x0B90], [0x0B92, 0x0B95], [0x0B99, 0x0B9A], [0x0B9C, 0x0B9C], [0x0B9E, 0x0B9F], [0x0BA3, 0x0BA4], [0x0BA8, 0x0BAA], [0x0BAE, 0x0BB5], [0x0BB7, 0x0BB9], [0x0C05, 0x0C0C], [0x0C0E, 0x0C10], [0x0C12, 0x0C28], [0x0C2A, 0x0C33], [0x0C35, 0x0C39], [0x0C60, 0x0C61], [0x0C85, 0x0C8C], [0x0C8E, 0x0C90], [0x0C92, 0x0CA8], [0x0CAA, 0x0CB3], [0x0CB5, 0x0CB9], [0x0CDE, 0x0CDE], [0x0CE0, 0x0CE1], [0x0D05, 0x0D0C], [0x0D0E, 0x0D10], [0x0D12, 0x0D28], [0x0D2A, 0x0D39], [0x0D60, 0x0D61], [0x0E01, 0x0E30], [0x0E32, 0x0E33], [0x0E40, 0x0E45], [0x0E81, 0x0E82], [0x0E84, 0x0E84], [0x0E87, 0x0E88], [0x0E8A, 0x0E8A], [0x0E8D, 0x0E8D], [0x0E94, 0x0E97], [0x0E99, 0x0E9F], [0x0EA1, 0x0EA3], [0x0EA5, 0x0EA5], [0x0EA7, 0x0EA7], [0x0EAA, 0x0EAB], [0x0EAD, 0x0EB0], [0x0EB2, 0x0EB3], [0x0EBD, 0x0EBD], [0x0EC0, 0x0EC4], [0x0EDC, 0x0EDD], [0x0F00, 0x0F00], [0x0F40, 0x0F47], [0x0F49, 0x0F69], [0x0F88, 0x0F8B], [0x1100, 0x1159], [0x115F, 0x11A2], [0x11A8, 0x11F9], [0x2135, 0x2138], [0x3006, 0x3006], [0x3041, 0x3094], [0x30A1, 0x30FA], [0x3105, 0x312C], [0x3131, 0x318E], [0x4E00, 0x9FA5], [0xAC00, 0xD7A3], [0xF900, 0xFA2D], [0xFB1F, 0xFB28], [0xFB2A, 0xFB36], [0xFB38, 0xFB3C], [0xFB3E, 0xFB3E], [0xFB40, 0xFB41], [0xFB43, 0xFB44], [0xFB46, 0xFBB1], [0xFBD3, 0xFD3D], [0xFD50, 0xFD8F], [0xFD92, 0xFDC7], [0xFDF0, 0xFDFB], [0xFE70, 0xFE72], [0xFE74, 0xFE74], [0xFE76, 0xFEFC], [0xFF66, 0xFF6F], [0xFF71, 0xFF9D], [0xFFA0, 0xFFBE], [0xFFC2, 0xFFC7], [0xFFCA, 0xFFCF], [0xFFD2, 0xFFD7], [0xFFDA, 0xFFDC]]; | |
errorCount = 0; | |
count = 0; | |
for (indexI = 0; indexI < Lo.length; indexI++) { | |
for (indexJ = Lo[indexI][0]; indexJ <= Lo[indexI][1]; indexJ++) { | |
try { | |
var identifier = String.fromCharCode(indexJ); | |
var hex = decimalToHexString(indexJ); | |
eval("var " + identifier + "=1"); | |
if (eval(identifier + "===1") !== true) { | |
testFailed('#' + hex + ' '); | |
errorCount++; | |
} | |
} catch (e) { | |
testFailed('#' + hex + ' '); | |
errorCount++; | |
} | |
count++; | |
} | |
} | |
if (errorCount > 0) { | |
testFailed('Total error: ' + errorCount + ' bad Unicode character in ' + count); | |
} | |
function decimalToHexString(n) { | |
n = Number(n); | |
var h = ""; | |
for (var i = 3; i >= 0; i--) { | |
if (n >= Math.pow(16, i)) { | |
var t = Math.floor(n / Math.pow(16, i)); | |
n -= t * Math.pow(16, i); | |
if ( t >= 10 ) { | |
if ( t == 10 ) { h += "A"; } | |
if ( t == 11 ) { h += "B"; } | |
if ( t == 12 ) { h += "C"; } | |
if ( t == 13 ) { h += "D"; } | |
if ( t == 14 ) { h += "E"; } | |
if ( t == 15 ) { h += "F"; } | |
} else { | |
h += String(t); | |
} | |
} else { | |
h += "0"; | |
} | |
} | |
return h; | |
} | |
} catch (ex) { | |
sputnikException = ex; | |
} | |
var successfullyParsed = true; | |
</script> | |
<script> | |
if (!successfullyParsed) | |
printTestFailed('successfullyParsed is not set'); | |
else if (sputnikException) | |
printTestFailed(sputnikException); | |
else | |
printTestPassed(""); | |
testPrint('<br /><span class="pass">TEST COMPLETE</span>'); | |
</script> | |
</body> | |
</html> |