blob: 016841e290745ac8b6db8080c7b81ae7205f319f [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_A2_T1</p>
<div id='console'></div>
<script>
try {
/**
* @name: S7.4_A2_T1;
* @section: 7.4;
* @assertion: Correct interpretation of multi line comments;
* @description: Create comments with any code;
*/
/*CHECK#1*/
/* testFailed('#1: Correct interpretation multi line comments');
*/
/*CHECK#2*/
var x = 0;
/* x = 1;*/
if (x !== 0) {
testFailed('#2: var x = 0; /* x = 1;*/ x === 0. Actual: ' + (x));
}
//CHECK#3
var /* y = 1;*/
y;
if (y !== undefined) {
testFailed('#3: var /* y = 1; */ \\n y; y === undefined. Actual: ' + (y));
}
//CHECK#4
var /* y = 1;*/ y;
if (y !== undefined) {
testFailed('#4: var /* y = 1; */ y; y === undefined. Actual: ' + (y));
}
/*CHECK#5*/
/*var x = 1;
if (x === 1) {
testFailed('#5: Correct interpretation multi line comments');
}
*/
/*CHECK#6*/
/*var this.y = 1;*/
this.y++;
if (isNaN(y) !== true) {
testFailed('#6: /*var this.y = 1;*/ \\n this.y++; y === Not-a-Number. Actual: ' + (y));
}
//CHECK#7
var string = "/*var y = 0*/" /* y = 1;*/
if (string !== "/*var y = 0*/") {
testFailed('#7: var string = "/*var y = 0*/" /* y = 1;*/ string === "//var y = 0"');
}
//CHECK#8
var string = "/*var y = 0" /* y = 1;*/
if (string !== "/*var y = 0") {
testFailed('#8: var string = "/*var y = 0" /* y = 1;*/ string === "//var y = 0"');
}
/*CHECK#9*/
/** testFailed('#9: Correct interpretation multi line comments');
*/
/*CHECK#10*/
/* testFailed('#10: Correct interpretation multi line comments');
**/
/*CHECK#11*/
/****** testFailed('#11: Correct interpretation multi line comments');*********
***********
*
**********
**/
} 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>