blob: faa37aebb10d154e53237ae0d2ebdbe263b44522 [file] [log] [blame]
<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, "&amp;").replace(/</g, "&lt;");
}
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.4_A5</p>
<div id='console'></div>
<script>
try {
/**
* @name: S7.4_A5;
* @section: 7.4;
* @assertion: Single line comments can contain any Unicode character without Line Terminators;
* @description: //var " + xx + "yy = -1", insert instead of xx all Unicode characters;
*/
//CHECK
errorCount = 0;
count = 0;
var hex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
for (i1 = 0; i1 < 16; i1++) {
for (i2 = 0; i2 < 16; i2++) {
for (i3 = 0; i3 < 16; i3++) {
for (i4 = 0; i4 < 16; i4++) {
try {
var uu = hex[i1] + hex[i2] + hex[i3] + hex[i4];
var xx = String.fromCharCode("0x" + uu);
var LineTerminators = ((uu === "000A") || (uu === "000D") || (uu === "2028") || (uu === "2029"));
var yy = 0;
eval("//var " + xx + "yy = -1");
if (LineTerminators !== true) {
if (yy !== 0) {
testFailed('#' + uu + ' ');
errorCount++;
}
} else {
if (yy !== -1) {
testFailed('#' + uu + ' ');
errorCount++;
}
}
} catch (e){
testFailed('#' + uu + ' ');
errorCount++;
}
count++;
}
}
}
}
if (errorCount > 0) {
testFailed('Total error: ' + errorCount + ' bad Unicode character in ' + count);
}
} 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>