Initial contribution of r88 of Google's Sputnik tests

This commit is contained in:
Mark Miller 2011-06-23 15:37:18 -07:00
parent dc18b7c435
commit bcc15fd553
5548 changed files with 234630 additions and 0 deletions

View File

@ -0,0 +1,9 @@
# Below is a list of people and organizations that have contributed
# to the Sputnik project. Names should be added to the list like so:
#
# Name/Organization <email address>
Google Inc.
outofhanwell

View File

@ -0,0 +1,26 @@
Copyright 2009, Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,20 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
var HoursPerDay = 24;
var MinutesPerHour = 60;
var SecondsPerMinute = 60;
var msPerDay = 86400000;
var msPerSecond = 1000;
var msPerMinute = 60000;
var msPerHour = 3600000;
var date_1899_end = -2208988800001;
var date_1900_start = -2208988800000;
var date_1969_end = -1;
var date_1970_start = 0;
var date_1999_end = 946684799999;
var date_2000_start = 946684800000;
var date_2099_end = 4102444799999;
var date_2100_start = 4102444800000;

View File

@ -0,0 +1,326 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
//15.9.1.2 Day Number and Time within Day
function Day(t) {
return Math.floor(t/msPerDay);
}
function TimeWithinDay(t) {
return t%msPerDay;
}
//15.9.1.3 Year Number
function DaysInYear(y){
if(y%4 != 0) return 365;
if(y%4 == 0 && y%100 != 0) return 366;
if(y%100 == 0 && y%400 != 0) return 365;
if(y%400 == 0) return 366;
}
function DayFromYear(y) {
return (365*(y-1970)
+ Math.floor((y-1969)/4)
- Math.floor((y-1901)/100)
+ Math.floor((y-1601)/400));
}
function TimeFromYear(y){
return msPerDay*DayFromYear(y);
}
function YearFromTime(t) {
t = Number(t);
var sign = ( t < 0 ) ? -1 : 1;
var year = ( sign < 0 ) ? 1969 : 1970;
for(var time = 0;;year += sign){
time = TimeFromYear(year);
if(sign > 0 && time > t){
year -= sign;
break;
}
else if(sign < 0 && time <= t){
break;
}
};
return year;
}
function InLeapYear(t){
if(DaysInYear(YearFromTime(t)) == 365)
return 0;
if(DaysInYear(YearFromTime(t)) == 366)
return 1;
}
function DayWithinYear(t) {
return Day(t)-DayFromYear(YearFromTime(t));
}
//15.9.1.4 Month Number
function MonthFromTime(t){
var day = DayWithinYear(t);
var leap = InLeapYear(t);
if((0 <= day) && (day < 31)) return 0;
if((31 <= day) && (day < (59+leap))) return 1;
if(((59+leap) <= day) && (day < (90+leap))) return 2;
if(((90+leap) <= day) && (day < (120+leap))) return 3;
if(((120+leap) <= day) && (day < (151+leap))) return 4;
if(((151+leap) <= day) && (day < (181+leap))) return 5;
if(((181+leap) <= day) && (day < (212+leap))) return 6;
if(((212+leap) <= day) && (day < (243+leap))) return 7;
if(((243+leap) <= day) && (day < (273+leap))) return 8;
if(((273+leap) <= day) && (day < (304+leap))) return 9;
if(((304+leap) <= day) && (day < (334+leap))) return 10;
if(((334+leap) <= day) && (day < (365+leap))) return 11;
}
//15.9.1.5 Date Number
function DateFromTime(t) {
var day = DayWithinYear(t);
var month = MonthFromTime(t);
var leap = InLeapYear(t);
if(month == 0) return day+1;
if(month == 1) return day-30;
if(month == 2) return day-58-leap;
if(month == 3) return day-89-leap;
if(month == 4) return day-119-leap;
if(month == 5) return day-150-leap;
if(month == 6) return day-180-leap;
if(month == 7) return day-211-leap;
if(month == 8) return day-242-leap;
if(month == 9) return day-272-leap;
if(month == 10) return day-303-leap;
if(month == 11) return day-333-leap;
}
//15.9.1.6 Week Day
function WeekDay(t) {
var weekday = (Day(t)+4)%7;
return (weekday < 0 ? 7+weekday : weekday);
}
//15.9.1.9 Daylight Saving Time Adjustment
var LocalTZA = $LocalTZ*msPerHour;
function DaysInMonth(m, leap) {
m = m%12;
//April, June, Sept, Nov
if(m == 3 || m == 5 || m == 8 || m == 10 ) {
return 30;
}
//Jan, March, May, July, Aug, Oct, Dec
if(m == 0 || m == 2 || m == 4 || m == 6 || m == 7 || m == 9 || m == 11){
return 31;
}
//Feb
return 28+leap;
}
function GetSundayInMonth(t, m, count){
var year = YearFromTime(t);
var leap = InLeapYear(t);
var day = 0;
if(m >= 1) day += DaysInMonth(0, leap);
if(m >= 2) day += DaysInMonth(1, leap);
if(m >= 3) day += DaysInMonth(2, leap);
if(m >= 4) day += DaysInMonth(3, leap);
if(m >= 5) day += DaysInMonth(4, leap);
if(m >= 6) day += DaysInMonth(5, leap);
if(m >= 7) day += DaysInMonth(6, leap);
if(m >= 8) day += DaysInMonth(7, leap);
if(m >= 9) day += DaysInMonth(8, leap);
if(m >= 10) day += DaysInMonth(9, leap);
if(m >= 11) day += DaysInMonth(10, leap);
var month_start = TimeFromYear(year)+day*msPerDay;
var sunday = 0;
if(count === "last"){
for(var last_sunday = month_start+DaysInMonth(m, leap)*msPerDay;
WeekDay(last_sunday)>0;
last_sunday -= msPerDay
){};
sunday = last_sunday;
}
else {
for(var first_sunday = month_start;
WeekDay(first_sunday)>0;
first_sunday += msPerDay
){};
sunday = first_sunday+7*msPerDay*(count-1);
}
return sunday;
}
function DaylightSavingTA(t) {
t = t-LocalTZA;
var DST_start = GetSundayInMonth(t, $DST_start_month, $DST_start_sunday)
+$DST_start_hour*msPerHour
+$DST_start_minutes*msPerMinute;
var k = new Date(DST_start);
var DST_end = GetSundayInMonth(t, $DST_end_month, $DST_end_sunday)
+$DST_end_hour*msPerHour
+$DST_end_minutes*msPerMinute;
if ( t >= DST_start && t < DST_end ) {
return msPerHour;
} else {
return 0;
}
}
//15.9.1.9 Local Time
function LocalTime(t){
return t+LocalTZA+DaylightSavingTA(t);
}
function UTC(t) {
return t-LocalTZA-DaylightSavingTA(t-LocalTZA);
}
//15.9.1.10 Hours, Minutes, Second, and Milliseconds
function HourFromTime(t){
return Math.floor(t/msPerHour)%HoursPerDay;
}
function MinFromTime(t){
return Math.floor(t/msPerMinute)%MinutesPerHour;
}
function SecFromTime(t){
return Math.floor(t/msPerSecond)%SecondsPerMinute;
}
function msFromTime(t){
return t%msPerSecond;
}
//15.9.1.11 MakeTime (hour, min, sec, ms)
function MakeTime(hour, min, sec, ms){
if ( !isFinite(hour) || !isFinite(min) || !isFinite(sec) || !isFinite(ms)) {
return Number.NaN;
}
hour = ToInteger(hour);
min = ToInteger(min);
sec = ToInteger(sec);
ms = ToInteger(ms);
return ((hour*msPerHour) + (min*msPerMinute) + (sec*msPerSecond) + ms);
}
//15.9.1.12 MakeDay (year, month, date)
function MakeDay(year, month, date) {
if ( !isFinite(year) || !isFinite(month) || !isFinite(date)) {
return Number.NaN;
}
year = ToInteger(year);
month = ToInteger(month);
date = ToInteger(date );
var result5 = year + Math.floor(month/12);
var result6 = month%12;
var sign = ( year < 1970 ) ? -1 : 1;
var t = ( year < 1970 ) ? 1 : 0;
var y = ( year < 1970 ) ? 1969 : 1970;
if( sign == -1 ){
for ( y = 1969; y >= year; y += sign ) {
t += sign * DaysInYear(y)*msPerDay;
}
} else {
for ( y = 1970 ; y < year; y += sign ) {
t += sign * DaysInYear(y)*msPerDay;
}
}
var leap = 0;
for ( var m = 0; m < month; m++ ) {
//if year is changed, than we need to recalculate leep
leap = InLeapYear(t);
t += DaysInMonth(m, leap)*msPerDay;
}
if ( YearFromTime(t) != result5 ) {
return Number.NaN;
}
if ( MonthFromTime(t) != result6 ) {
return Number.NaN;
}
if ( DateFromTime(t) != 1 ) {
return Number.NaN;
}
return Day(t)+date-1;
}
//15.9.1.13 MakeDate (day, time)
function MakeDate( day, time ) {
if(!isFinite(day) || !isFinite(time)) {
return Number.NaN;
}
return day*msPerDay+time;
}
//15.9.1.14 TimeClip (time)
function TimeClip(time) {
if(!isFinite(time) || Math.abs(time) > 8.64e15){
return Number.NaN;
}
return ToInteger(time);
}
//Test Functions
function ConstructDate(year, month, date, hours, minutes, seconds, ms){
/*
* 1. Call ToNumber(year)
* 2. Call ToNumber(month)
* 3. If date is supplied use ToNumber(date); else use 1
* 4. If hours is supplied use ToNumber(hours); else use 0
* 5. If minutes is supplied use ToNumber(minutes); else use 0
* 6. If seconds is supplied use ToNumber(seconds); else use 0
* 7. If ms is supplied use ToNumber(ms); else use 0
* 8. If Result(1) is not NaN and 0 <= ToInteger(Result(1)) <= 99, Result(8) is
* 1900+ToInteger(Result(1)); otherwise, Result(8) is Result(1)
* 9. Compute MakeDay(Result(8), Result(2), Result(3))
* 10. Compute MakeTime(Result(4), Result(5), Result(6), Result(7))
* 11. Compute MakeDate(Result(9), Result(10))
* 12. Set the [[Value]] property of the newly constructed object to TimeClip(UTC(Result(11)))
*/
var r1 = Number(year);
var r2 = Number(month);
var r3 = ((date && arguments.length > 2) ? Number(date) : 1);
var r4 = ((hours && arguments.length > 3) ? Number(hours) : 0);
var r5 = ((minutes && arguments.length > 4) ? Number(minutes) : 0);
var r6 = ((seconds && arguments.length > 5) ? Number(seconds) : 0);
var r7 = ((ms && arguments.length > 6) ? Number(ms) : 0);
var r8 = r1;
if(!isNaN(r1) && (0 <= ToInteger(r1)) && (ToInteger(r1) <= 99))
r8 = 1900+r1;
var r9 = MakeDay(r8, r2, r3);
var r10 = MakeTime(r4, r5, r6, r7);
var r11 = MakeDate(r9, r10);
return TimeClip(UTC(r11));
}

View File

@ -0,0 +1,18 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function SputnikError(message) {
this.message = message;
}
SputnikError.prototype.toString = function () {
return "SputnikError: " + this.message;
};
function testFailed(message) {
throw new SputnikError(message);
}
function testPrint(message) {
}

View File

@ -0,0 +1,18 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
var prec;
function isEqual(num1, num2)
{
if ((num1 === Infinity)&&(num2 === Infinity))
{
return(true);
}
if ((num1 === -Infinity)&&(num2 === -Infinity))
{
return(true);
}
prec = getPrecision(Math.min(Math.abs(num1), Math.abs(num2)));
return(Math.abs(num1 - num2) <= prec);
//return(num1 === num2);
}

View File

@ -0,0 +1,13 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function getPrecision(num)
{
//TODO: Create a table of prec's,
// because using Math for testing Math isn't that correct.
log2num = Math.log(Math.abs(num))/Math.LN2;
pernum = Math.ceil(log2num);
return(2 * Math.pow(2, -52 + pernum));
//return(0);
}

View File

@ -0,0 +1,21 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
function ToInteger(p) {
x = Number(p);
if(isNaN(x)){
return +0;
}
if((x === +0)
|| (x === -0)
|| (x === Number.POSITIVE_INFINITY)
|| (x === Number.NEGATIVE_INFINITY)){
return x;
}
var sign = ( x < 0 ) ? -1 : 1;
return (sign*Math.floor(Math.abs(x)));
}

View File

@ -0,0 +1,39 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.1_T1;
* @section: 7.2, 7.5;
* @assertion: HORIZONTAL TAB (U+0009) between any two tokens is allowed;
* @description: Insert HORIZONTAL TAB(\u0009 and \t) between tokens of var x=1;
*/
// CHECK#1
eval("\u0009var\u0009x\u0009=\u00091\u0009");
if (x !== 1) {
$ERROR('#1: eval("\\u0009var\\u0009x\\u0009=\\u00091\\u0009"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u0009" + "var" + "\u0009" + "x" + "\u0009" + "=" + "\u0009" + "1" + "\u0009");
if (x !== 1) {
$ERROR('#2: eval("\\u0009" + "var" + "\\u0009" + "x" + "\\u0009" + "=" + "\\u0009" + "1" + "\\u0009"); x === 1. Actual: ' + (x));
}
//CHECK#3
eval("\tvar\tx\t=\t1\t");
if (x !== 1) {
$ERROR('#3: eval("\\tvar\\tx\\t=\\t1\\t"); x === 1. Actual: ' + (x));
}
//CHECK#4
eval("\t" + "var" + "\t" + "x" + "\t" + "=" + "\t" + "1" + "\t");
if (x !== 1) {
$ERROR('#4: eval("\\t" + "var" + "\\t" + "x" + "\\t" + "=" + "\\t" + "1" + "\\t"); x === 1. Actual: ' + (x));
}
//CHECK#5
eval("\u0009" + "var" + "\t" + "x" + "\u0009" + "=" + "\t" + "1" + "\u0009");
if (x !== 1) {
$ERROR('#5: eval("\\u0009" + "var" + "\\t" + "x" + "\\u0009" + "=" + "\\t" + "1" + "\\u0009"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,21 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.1_T2;
* @section: 7.2, 7.5;
* @assertion: HORIZONTAL TAB (U+0009) between any two tokens is allowed;
* @description: Insert real HORIZONTAL TAB between tokens of var x=1;
*/
//CHECK#1
var x = 1 ;
if (x !== 1) {
$ERROR('#1: var x = 1 ; x === 1. Actual: ' + (x));
}
//CHECK#2
eval(" var\tx =\t2 ");
if (x !== 2) {
$ERROR('#2: var\\tx =\\t1 ; x === 2. Actual: ' + (x));
}

View File

@ -0,0 +1,39 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.2_T1;
* @section: 7.2, 7.5;
* @assertion: VERTICAL TAB (U+000B) between any two tokens is allowed;
* @description: Insert VERTICAL TAB(\u000B and \v) between tokens of var x=1;
*/
// CHECK#1
eval("\u000Bvar\u000Bx\u000B=\u000B1\u000B");
if (x !== 1) {
$ERROR('#1: eval("\\u000Bvar\\u000Bx\\u000B=\\u000B1\\u000B"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u000B" + "var" + "\u000B" + "x" + "\u000B" + "=" + "\u000B" + "1" + "\u000B");
if (x !== 1) {
$ERROR('#2: eval("\\u000B" + "var" + "\\u000B" + "x" + "\\u000B" + "=" + "\\u000B" + "1" + "\\u000B"); x === 1. Actual: ' + (x));
}
//CHECK#3
eval("\vvar\vx\v=\v1\v");
if (x !== 1) {
$ERROR('#3: eval("\\vvar\\vx\\v=\\v1\\v"); x === 1. Actual: ' + (x));
}
//CHECK#4
eval("\v" + "var" + "\v" + "x" + "\v" + "=" + "\v" + "1" + "\v");
if (x !== 1) {
$ERROR('#4: eval("\\v" + "var" + "\\v" + "x" + "\\v" + "=" + "\\v" + "1" + "\\v"); x === 1. Actual: ' + (x));
}
//CHECK#5
eval("\u000B" + "var" + "\v" + "x" + "\u000B" + "=" + "\v" + "1" + "\u000B");
if (x !== 1) {
$ERROR('#5: eval("\\u000B" + "var" + "\\v" + "x" + "\\u000B" + "=" + "\\v" + "1" + "\\u000B"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,22 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.2_T2;
* @section: 7.2, 7.5;
* @assertion: VERTICAL TAB (U+000B) between any two tokens is allowed;
* @description: Insert real VERTICAL TAB between tokens of var x=1;
*/
//CHECK#1
var x = 1 ;
if (x !== 1) {
$ERROR('#1: var x = 1 ; x === 1. Actual: ' + (x));
}
//CHECK#2
eval(" var\vx =\v1 ");
if (x !== 1) {
$ERROR('#2: var\\vx =\\v1 ; x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,39 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.3_T1;
* @section: 7.2, 7.5;
* @assertion: FORM FEED (U+000C) between any two tokens is allowed;
* @description: Insert FORM FEED(\u000C and \f) between tokens of var x=1;
*/
// CHECK#1
eval("\u000Cvar\u000Cx\u000C=\u000C1\u000C");
if (x !== 1) {
$ERROR('#1: eval("\\u000Cvar\\u000Cx\\u000C=\\u000C1\\u000C"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u000C" + "var" + "\u000C" + "x" + "\u000C" + "=" + "\u000C" + "1" + "\u000C");
if (x !== 1) {
$ERROR('#2: eval("\\u000C" + "var" + "\\u000C" + "x" + "\\u000C" + "=" + "\\u000C" + "1" + "\\u000C"); x === 1. Actual: ' + (x));
}
//CHECK#3
eval("\fvar\fx\f=\f1\f");
if (x !== 1) {
$ERROR('#3: eval("\\fvar\\fx\\f=\\f1\\f"); x === 1. Actual: ' + (x));
}
//CHECK#4
eval("\f" + "var" + "\f" + "x" + "\f" + "=" + "\f" + "1" + "\f");
if (x !== 1) {
$ERROR('#4: eval("\\f" + "var" + "\\f" + "x" + "\\f" + "=" + "\\f" + "1" + "\\f"); x === 1. Actual: ' + (x));
}
//CHECK#5
eval("\u000C" + "var" + "\f" + "x" + "\u000C" + "=" + "\f" + "1" + "\u000C");
if (x !== 1) {
$ERROR('#5: eval("\\u000C" + "var" + "\\f" + "x" + "\\u000C" + "=" + "\\f" + "1" + "\\u000C"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,22 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.3_T2;
* @section: 7.2, 7.5;
* @assertion: FORM FEED (U+000C) between any two tokens is allowed;
* @description: Insert real FORM FEED between tokens of var x=1;
*/
//CHECK#1
var x = 1 ;
if (x !== 1) {
$ERROR('#1: var x = 1 ; x === 1. Actual: ' + (x));
}
//CHECK#2
eval(" var\fx =\f1 ");
if (x !== 1) {
$ERROR('#2: var\\fx =\\f1 ; x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,21 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.4_T1;
* @section: 7.2, 7.5;
* @assertion: SPACE (U+0020) between any two tokens is allowed;
* @description: Insert SPACE(\u0020) between tokens of var x=1;
*/
// CHECK#1
eval("\u0020var\u0020x\u0020=\u00201\u0020");
if (x !== 1) {
$ERROR('#1: eval("\\u0020var\\u0020x\\u0020=\\u00201\\u0020"); x === 1;');
}
//CHECK#2
eval("\u0020" + "var" + "\u0020" + "x" + "\u0020" + "=" + "\u0020" + "1" + "\u0020");
if (x !== 1) {
$ERROR('#2: eval("\\u0020" + "var" + "\\u0020" + "x" + "\\u0020" + "=" + "\\u0020" + "1" + "\\u0020"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,22 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.4_T2;
* @section: 7.2, 7.5;
* @assertion: SPACE (U+0020) between any two tokens is allowed;
* @description: Insert real SPACE between tokens of var x=1;
*/
//CHECK#1
eval("\u0020var x\u0020= 1\u0020");
if (x !== 1) {
$ERROR('#1: eval("\\u0020var x\\u0020= 1\\u0020"); x === 1. Actual: ' + (x));
}
//CHECK#2
var x = 1 ;
if (x !== 1) {
$ERROR('#2: var x = 1 ; x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,21 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.5_T1;
* @section: 7.2, 7.5;
* @assertion: NO-BREAK SPACE (U+00A0) between any two tokens is allowed;
* @description: Insert NO-BREAK SPACE(\u00A0) between tokens of var x=1;
*/
// CHECK#1
eval("\u00A0var\u00A0x\u00A0=\u00A01\u00A0");
if (x !== 1) {
$ERROR('#1: eval("\\u00A0var\\u00A0x\\u00A0=\\u00A01\\u00A0"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u00A0" + "var" + "\u00A0" + "x" + "\u00A0" + "=" + "\u00A0" + "1" + "\u00A0");
if (x !== 1) {
$ERROR('#2: eval("\\u00A0" + "var" + "\\u00A0" + "x" + "\\u00A0" + "=" + "\\u00A0" + "1" + "\\u00A0"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,22 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A1.5_T2;
* @section: 7.2, 7.5;
* @assertion: NO-BREAK SPACE (U+00A0) between any two tokens is allowed;
* @description: Insert real NO-BREAK SPACE between tokens of var x=1;
*/
//CHECK#1
eval("\u00A0var x\u00A0= 1\u00A0");
if (x !== 1) {
$ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x));
}
//CHECK#2
 var x = 1 ;
if (x !== 1) {
$ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.1_T1;
* @section: 7.2, 7.8.4;
* @assertion: HORIZONTAL TAB (U+0009) may occur within strings;
* @description: Use HORIZONTAL TAB(\u0009 and \t);
*/
// CHECK#1
if (eval("'\u0009str\u0009ing\u0009'") !== "\u0009str\u0009ing\u0009") {
$ERROR('#1: eval("\'\\u0009str\\u0009ing\\u0009\'") === "\\u0009str\\u0009ing\\u0009"');
}
//CHECK#2
if (eval("'\tstr\ting\t'") !== "\tstr\ting\t") {
$ERROR('#2: eval("\'\\tstr\\ting\\t\'") === "\\tstr\\ting\\t"');
}

View File

@ -0,0 +1,14 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.1_T2;
* @section: 7.2, 7.8.4;
* @assertion: HORIZONTAL TAB (U+0009) may occur within strings;
* @description: Use real HORIZONTAL TAB;
*/
//CHECK#1
if (" str ing " !== "\u0009str\u0009ing\u0009") {
$ERROR('#1: " str ing " === "\\u0009str\\u0009ing\\u0009"');
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.2_T1;
* @section: 7.2, 7.8.4;
* @assertion: VERTICAL TAB (U+000B) may occur within strings;
* @description: Use VERTICAL TAB(\u000B and \v);
*/
// CHECK#1
if (eval("'\u000Bstr\u000Bing\u000B'") !== "\u000Bstr\u000Bing\u000B") {
$ERROR('#1: eval("\'\\u000Bstr\\u000Bing\\u000B\'") === "\\u000Bstr\\u000Bing\\u000B"');
}
//CHECK#2
if (eval("'\vstr\ving\v'") !== "\vstr\ving\v") {
$ERROR('#2: eval("\'\\vstr\\ving\\v\'") === "\\vstr\\ving\\v"');
}

View File

@ -0,0 +1,14 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.2_T2;
* @section: 7.2, 7.8.4;
* @assertion: VERTICAL TAB (U+000B) may occur within strings;
* @description: Use real VERTICAL TAB;
*/
//CHECK#1
if (" str ing " !== "\u000Bstr\u000Bing\u000B") {
$ERROR('#1: " str ing " === "\\u000Bstr\\u000Bing\\u000B"');
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.3_T1;
* @section: 7.2, 7.8.4;
* @assertion: FORM FEED (U+000C) may occur within strings;
* @description: Use FORM FEED(\u000C and \f);
*/
// CHECK#1
if (eval("'\u000Cstr\u000Cing\u000C'") !== "\u000Cstr\u000Cing\u000C") {
$ERROR('#1: eval("\'\\u000Cstr\\u000Cing\\u000C\'") === "\\u000Cstr\\u000Cing\\u000C"');
}
//CHECK#2
if (eval("'\fstr\fing\f'") !== "\fstr\fing\f") {
$ERROR('#2: eval("\'\\fstr\\fing\\f\'") === "\\fstr\\fing\\f"');
}

View File

@ -0,0 +1,14 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.3_T2;
* @section: 7.2, 7.8.4;
* @assertion: FORM FEED (U+000C) may occur within strings;
* @description: Use real FORM FEED;
*/
//CHECK#1
if (" str ing " !== "\u000Cstr\u000Cing\u000C") {
$ERROR('#1: " str ing " === "\\u000Cstr\\u000Cing\\u000C"');
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.4_T1;
* @section: 7.2, 7.8.4;
* @assertion: SPACE (U+0020) may occur within strings;
* @description: Use SPACE(\u0020);
*/
// CHECK#1
if (eval("'\u0020str\u0020ing\u0020'") !== "\u0020str\u0020ing\u0020") {
$ERROR('#1: eval("\'\\u0020str\\u0020ing\\u0020\'") === "\\u0020str\\u0020ing\\u0020"');
}
//CHECK#2
if (eval("' str ing '") !== " str ing ") {
$ERROR('#2: eval("\' str ing \'") === " str ing "');
}

View File

@ -0,0 +1,14 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.4_T2;
* @section: 7.2, 7.8.4;
* @assertion: SPACE (U+0020) may occur within strings;
* @description: Use real SPACE;
*/
//CHECK#1
if (" str ing " !== "\u0020str\u0020ing\u0020") {
$ERROR('#1: " str ing " === "\\u0020str\\u0020ing\\u0020"');
}

View File

@ -0,0 +1,14 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.5_T1;
* @section: 7.2, 7.8.4;
* @assertion: NO-BREAK SPACE (U+00A0) may occur within strings;
* @description: Use NO-BREAK SPACE(\u00A0);
*/
// CHECK#1
if (eval("'\u00A0str\u00A0ing\u00A0'") !== "\u00A0str\u00A0ing\u00A0") {
$ERROR('#1: eval("\'\\u00A0str\\u00A0ing\\u00A0\'") === "\\u00A0str\\u00A0ing\\u00A0"');
}

View File

@ -0,0 +1,14 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A2.5_T2;
* @section: 7.2, 7.8.4;
* @assertion: NO-BREAK SPACE (U+00A0) may occur within strings;
* @description: Use real NO-BREAK SPACE;
*/
//CHECK#1
if (" str ing " !== "\u00A0str\u00A0ing\u00A0") {
$ERROR('#1: " str ing " === "\\u00A0str\\u00A0ing\\u00A0"');
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.1_T1;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain HORIZONTAL TAB (U+0009);
* @description: Use HORIZONTAL TAB(\u0009);
*/
// CHECK#1
eval("//\u0009 single line \u0009 comment \u0009");
//CHECK#2
var x = 0;
eval("//\u0009 single line \u0009 comment \u0009 x = 1;");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("//\\u0009 single line \\u0009 comment \\u0009 x = 1;"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.1_T2;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain HORIZONTAL TAB (U+0009);
* @description: Use real HORIZONTAL TAB;
*/
//CHECK#1
var x = 0;
// single line comment x = 1;
if (x !== 0) {
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.2_T1;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain VERTICAL TAB (U+000B);
* @description: Use VERTICAL TAB(\u000B);
*/
// CHECK#1
eval("//\u000B single line \u000B comment \u000B");
//CHECK#2
var x = 0;
eval("//\u000B single line \u000B comment \u000B x = 1;");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("//\\u000B single line \\u000B comment \\u000B x = 1;"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.2_T2;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain VERTICAL TAB (U+000B);
* @description: Use real VERTICAL TAB;
*/
//CHECK#1
var x = 0;
// single line comment x = 1;
if (x !== 0) {
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.3_T1;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain FORM FEED (U+000C);
* @description: Use FORM FEED(\u000C);
*/
// CHECK#1
eval("//\u000C single line \u000C comment \u000C");
//CHECK#2
var x = 0;
eval("//\u000C single line \u000C comment \u000C x = 1;");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("//\\u000C single line \\u000C comment \\u000C x = 1;"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.3_T2;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain FORM FEED (U+000C);
* @description: Use real FORM FEED;
*/
//CHECK#1
var x = 0;
// single line comment x = 1;
if (x !== 0) {
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.4_T1;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain SPACE (U+0020);
* @description: Use SPACE(\u0020);
*/
// CHECK#1
eval("//\u0020 single line \u0020 comment \u0020");
//CHECK#2
var x = 0;
eval("//\u0020 single line \u0020 comment \u0020 x = 1;");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("//\\u0020 single line \\u0020 comment \\u0020 x = 1;"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.4_T2;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain SPACE (U+0020);
* @description: Use real SPACE;
*/
//CHECK#1
var x = 0;
// single line comment x = 1;
if (x !== 0) {
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.5_T1;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain NO-BREAK SPACE (U+00A0);
* @description: Use NO-BREAK SPACE(\u00A0);
*/
// CHECK#1
eval("//\u00A0 single line \u00A0 comment \u00A0");
//CHECK#2
var x = 0;
eval("//\u00A0 single line \u00A0 comment \u00A0 x = 1;");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("//\\u00A0 single line \\u00A0 comment \\u00A0 x = 1;"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A3.5_T2;
* @section: 7.2, 7.4;
* @assertion: Single line comment can contain NO-BREAK SPACE (U+00A0);
* @description: Use real NO-BREAK SPACE;
*/
//CHECK#1
var x = 0;
// single line comment x = 1;
if (x !== 0) {
$ERROR('#1: var x = 0; // single line comment x = 1; x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.1_T1;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain HORIZONTAL TAB (U+0009);
* @description: Use HORIZONTAL TAB(\u0009);
*/
// CHECK#1
eval("/*\u0009 multi line \u0009 comment \u0009*/");
//CHECK#2
var x = 0;
eval("/*\u0009 multi line \u0009 comment \u0009 x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u0009 multi line \\u0009 comment \\u0009 x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.1_T2;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain HORIZONTAL TAB (U+0009);
* @description: Use real HORIZONTAL TAB;
*/
/*CHECK#1*/
var x = 0;
/* multi line comment x = 1;*/
if (x !== 0) {
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.2_T1;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain VERTICAL TAB (U+000B);
* @description: Use VERTICAL TAB(\u000B);
*/
// CHECK#1
eval("/*\u000B multi line \u000B comment \u000B*/");
//CHECK#2
var x = 0;
eval("/*\u000B multi line \u000B comment \u000B x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u000B multi line \\u000B comment \\u000B x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.2_T2;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain VERTICAL TAB (U+000B);
* @description: Use real VERTICAL TAB;
*/
/*CHECK#1*/
var x = 0;
/* multi line comment x = 1;*/
if (x !== 0) {
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.3_T1;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain FORM FEED (U+000C);
* @description: Use FORM FEED(\u000C);
*/
// CHECK#1
eval("/*\u000C multi line \u000C comment \u000C*/");
//CHECK#2
var x = 0;
eval("/*\u000C multi line \u000C comment \u000C x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u000C multi line \\u000C comment \\u000C x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.3_T2;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain FORM FEED (U+000C);
* @description: Use real FORM FEED;
*/
/*CHECK#1*/
var x = 0;
/* multi line comment x = 1;*/
if (x !== 0) {
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.4_T1;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain SPACE (U+0020);
* @description: Use SPACE(\u0020);
*/
// CHECK#1
eval("/*\u0020 multi line \u0020 comment \u0020*/");
//CHECK#2
var x = 0;
eval("/*\u0020 multi line \u0020 comment \u0020 x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u0020 multi line \\u0020 comment \\u0020 x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.4_T2;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain SPACE (U+0020);
* @description: Use real SPACE;
*/
/*CHECK#1*/
var x = 0;
/* multi line comment x = 1;*/
if (x !== 0) {
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.5_T1;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain NO-BREAK SPACE (U+00A0);
* @description: Use NO-BREAK SPACE(\u00A0);
*/
// CHECK#1
eval("/*\u00A0 multi line \u00A0 comment \u00A0*/");
//CHECK#2
var x = 0;
eval("/*\u00A0 multi line \u00A0 comment \u00A0 x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u00A0 multi line \\u00A0 comment \\u00A0 x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A4.5_T2;
* @section: 7.2, 7.4;
* @assertion: Multi line comment can contain NO-BREAK SPACE (U+00A0);
* @description: Use real NO-BREAK SPACE;
*/
/*CHECK#1*/
var x = 0;
/* multi line comment x = 1;*/
if (x !== 0) {
$ERROR('#1: var x = 0; /* multi line comment x = 1;*/ x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A5_T1;
* @section: 7.2;
* @assertion: White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Use TAB (U+0009);
* @negative
*/
var\u0009x;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A5_T2;
* @section: 7.2;
* @assertion: White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Use VERTICAL TAB (U+000B);
* @negative
*/
var\u000Bx;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A5_T3;
* @section: 7.2;
* @assertion: White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Use FORM FEED (U+000C);
* @negative
*/
var\u000Cx;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A5_T4;
* @section: 7.2;
* @assertion: White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Use SPACE (U+0020);
* @negative
*/
var\u0020x;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.2_A5_T5;
* @section: 7.2;
* @assertion: White space cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Use NO-BREAK SPACE (U+00A0);
* @negative
*/
var\u00A0x;

View File

@ -0,0 +1,39 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A1.1_T1;
* @section: 7.3;
* @assertion: LINE FEED (U+000A) may occur between any two tokens;
* @description: Insert LINE FEED (\u000A and \n) between tokens of var x=1;
*/
// CHECK#1
eval("\u000Avar\u000Ax\u000A=\u000A1\u000A");
if (x !== 1) {
$ERROR('#1: eval("\\u000Avar\\u000Ax\\u000A=\\u000A1\\u000A"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u000A" + "var" + "\u000A" + "x" + "\u000A" + "=" + "\u000A" + "1" + "\u000A");
if (x !== 1) {
$ERROR('#2: eval("\\u000A" + "var" + "\\u000A" + "x" + "\\u000A" + "=" + "\\u000A" + "1" + "\\u000A"); x === 1. Actual: ' + (x));
}
//CHECK#3
eval("\nvar\nx\n=\n1\n");
if (x !== 1) {
$ERROR('#3: eval("\\nvar\\nx\\n=\\n1\\n"); x === 1. Actual: ' + (x));
}
//CHECK#4
eval("\n" + "var" + "\n" + "x" + "\n" + "=" + "\n" + "1" + "\n");
if (x !== 1) {
$ERROR('#4: eval("\\n" + "var" + "\\n" + "x" + "\\n" + "=" + "\\n" + "1" + "\\n"); x === 1. Actual: ' + (x));
}
//CHECK#5
eval("\u000A" + "var" + "\n" + "x" + "\u000A" + "=" + "\n" + "1" + "\u000A");
if (x !== 1) {
$ERROR('#5: eval("\\u000A" + "var" + "\\n" + "x" + "\\u000A" + "=" + "\\n" + "1" + "\\u000A"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,18 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A1.1_T2;
* @section: 7.3;
* @assertion: LINE FEED (U+000A) may occur between any two tokens;
* @description: Insert real LINE FEED between tokens of var x=1;
*/
//CHECK#1
var
x
=
1;
if (x !== 1) {
$ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,39 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A1.2_T1;
* @section: 7.3;
* @assertion: CARRIAGE RETURN (U+000D) may occur between any two tokens;
* @description: Insert CARRIAGE RETURN (\u000D and \r) between tokens of var x=1;
*/
// CHECK#1
eval("\u000Dvar\u000Dx\u000D=\u000D1\u000D");
if (x !== 1) {
$ERROR('#1: eval("\\u000Dvar\\u000Dx\\u000D=\\u000D1\\u000D"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u000D" + "var" + "\u000D" + "x" + "\u000D" + "=" + "\u000D" + "1" + "\u000D");
if (x !== 1) {
$ERROR('#2: eval("\\u000D" + "var" + "\\u000D" + "x" + "\\u000D" + "=" + "\\u000D" + "1" + "\\u000D"); x === 1. Actual: ' + (x));
}
//CHECK#3
eval("\rvar\rx\r=\r1\r");
if (x !== 1) {
$ERROR('#3: eval("\\rvar\\rx\\r=\\r1\\r"); x === 1. Actual: ' + (x));
}
//CHECK#4
eval("\r" + "var" + "\r" + "x" + "\r" + "=" + "\r" + "1" + "\r");
if (x !== 1) {
$ERROR('#4: eval("\\r" + "var" + "\\r" + "x" + "\\r" + "=" + "\\r" + "1" + "\\r"); x === 1. Actual: ' + (x));
}
//CHECK#5
eval("\u000D" + "var" + "\r" + "x" + "\u000D" + "=" + "\r" + "1" + "\u000D");
if (x !== 1) {
$ERROR('#5: eval("\\u000D" + "var" + "\\r" + "x" + "\\u000D" + "=" + "\\r" + "1" + "\\u000D"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,11 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A1.2_T2;
* @section: 7.3;
* @assertion: CARRIAGE RETURN (U+000D) may occur between any two tokens;
* @description: Insert real CARRIAGE RETURN between tokens of var x=1;
*/
//CHECK#1 var x
= 1; if (x !== 1) { $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); }

View File

@ -0,0 +1,22 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A1.3;
* @section: 7.3;
* @assertion: LINE SEPARATOR (U+2028) may occur between any two tokens;
* @description: Insert LINE SEPARATOR (\u2028) between tokens of var x=1;
*/
// CHECK#1
eval("\u2028var\u2028x\u2028=\u20281\u2028");
if (x !== 1) {
$ERROR('#1: eval("\\u2028var\\u2028x\\u2028=\\u20281\\u2028"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u2028" + "var" + "\u2028" + "x" + "\u2028" + "=" + "\u2028" + "1" + "\u2028");
if (x !== 1) {
$ERROR('#2: eval("\\u2028" + "var" + "\\u2028" + "x" + "\\u2028" + "=" + "\\u2028" + "1" + "\\u2028"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,24 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A1.4;
* @section: 7.3;
* @assertion: PARAGRAPH SEPARATOR (U+2029) may occur between any two tokens;
* @description: Insert PARAGRAPH SEPARATOR (\u2029) between tokens of var x=1;
*/
// CHECK#1
eval("\u2029var\u2029x\u2029=\u20291\u2029");
if (x !== 1) {
$ERROR('#1: eval("\\u2029var\\u2029x\\u2029=\\u20291\\u2029"); x === 1. Actual: ' + (x));
}
//CHECK#2
eval("\u2029" + "var" + "\u2029" + "x" + "\u2029" + "=" + "\u2029" + "1" + "\u2029");
if (x !== 1) {
$ERROR('#2: eval("\\u2029" + "var" + "\\u2029" + "x" + "\\u2029" + "=" + "\\u2029" + "1" + "\\u2029"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,15 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A2.1_T1;
* @section: 7.3;
* @assertion: LINE FEED (U+000A) within strings is not allowed;
* @description: Insert LINE FEED (\u000A) into string;
* @negative
*/
// CHECK#1
if (eval("'\u000Astr\u000Aing\u000A'") === "\u000Astr\u000Aing\u000A") {
$ERROR('#1: eval("\'\\u000Astr\\u000Aing\\u000A\'") === "\\u000Astr\\u000Aing\\u000A"');
}

View File

@ -0,0 +1,16 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A2.1_T2;
* @section: 7.3;
* @assertion: LINE FEED (U+000A) within strings is not allowed;
* @description: Use real LINE FEED into string;
* @negative
*/
//CHECK#1
"
str
ing
";

View File

@ -0,0 +1,15 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A2.2_T1;
* @section: 7.3;
* @assertion: CARRIAGE RETURN (U+000D) within strings is not allowed;
* @description: Insert CARRIAGE RETURN (\u000D) into string;
* @negative
*/
// CHECK#1
if (eval("'\u000Dstr\u000Ding\u000D'") === "\u000Dstr\u000Ding\u000D") {
$ERROR('#1: eval("\'\\u000Dstr\\u000Ding\\u000D\'") === "\\u000Dstr\\u000Ding\\u000D"');
}

View File

@ -0,0 +1,11 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A2.2_T2;
* @section: 7.3;
* @assertion: CARRIAGE RETURN (U+000D) within strings is not allowed;
* @description: Insert real CARRIAGE RETURN into string;
* @negative
*/
//CHECK#1 " str ing ";

View File

@ -0,0 +1,15 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A2.3;
* @section: 7.3;
* @assertion: LINE SEPARATOR (U+2028) within strings is not allowed;
* @description: Insert LINE SEPARATOR (\u2028) into string;
* @negative
*/
// CHECK#1
if (eval("'\u2028str\u2028ing\u2028'") === "\u2028str\u2028ing\u2028") {
$ERROR('#1: eval("\'\\u2028str\\u2028ing\\u2028\'") === "\\u2028str\\u2028ing\\u2028"');
}

View File

@ -0,0 +1,15 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A2.4;
* @section: 7.3;
* @assertion: PARAGRAPH SEPARATOR (U+2029) within strings is not allowed;
* @description: Insert PARAGRAPH SEPARATOR (\u2029) into string;
* @negative
*/
// CHECK#1
if (eval("'\u2029str\u2029ing\u2029'") === "\u2029str\u2029ing\u2029") {
$ERROR('#1: eval("\'\\u2029str\\u2029ing\\u2029\'") === "\\u2029str\\u2029ing\\u2029"');
}

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.1_T1; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain LINE FEED (U+000A) inside; * @description: Insert LINE FEED (\u000A) into single line comment; * @negative */ // CHECK#1 eval("// single line \u000A comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.1_T2; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain LINE FEED (U+000A) inside; * @description: Insert LINE FEED (\u000A) into begin of single line comment; * @negative */ // CHECK#1 eval("//\u000A single line comment");

View File

@ -0,0 +1,7 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.1_T3; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain LINE FEED (U+000A) inside; * @description: Insert real LINE FEED into single line comment; * @negative */
// CHECK#1
//single
line comment

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.2_T1; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain CARRIAGE RETURN (U+000D) inside; * @description: Insert CARRIAGE RETURN (\u000D) into single line comment; * @negative */ // CHECK#1 eval("// single line \u000D comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.2_T2; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain CARRIAGE RETURN (U+000D) inside; * @description: Insert CARRIAGE RETURN (\u000D) into begin of single line comment; * @negative */ // CHECK#1 eval("//\u000D single line comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.2_T3; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain CARRIAGE RETURN (U+000D) inside; * @description: Insert real CARRIAGE RETURN into single line comment; * @negative */ // CHECK#1 //single line comment

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.3_T1; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain LINE SEPARATOR (U+2028) inside; * @description: Insert LINE SEPARATOR (\u2028) into single line comment; * @negative */ // CHECK#1 eval("// single line \u2028 comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.3_T2; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain LINE SEPARATOR (U+2028) inside; * @description: Insert LINE SEPARATOR (\u2028) into begin of single line comment; * @negative */ // CHECK#1 eval("//\u2028 single line comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.4_T1; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain PARAGRAPH SEPARATOR (U+2029) inside; * @description: Insert PARAGRAPH SEPARATOR (\u2029) into single line comment; * @negative */ // CHECK#1 eval("// single line \u2029 comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A3.4_T2; * @section: 7.3, 7.4; * @assertion: Single line comments can not contain PARAGRAPH SEPARATOR (U+2029) inside; * @description: Insert PARAGRAPH SEPARATOR (\u2029) into begin of single line comment; * @negative */ // CHECK#1 eval("//\u2029 single line comment");

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A4_T1; * @section: 7.3, 7.4; * @assertion: Single line comments can contain Line Terminator at the end of line; * @description: Insert LINE FEED (U+000A) into the end of single line comment; */ // CHECK#1 eval("// single line comment\u000A"); // CHECK#2 var x = 0; eval("// single line comment\u000A x = 1;"); if (x !== 1) { $ERROR('#1: var x = 0; eval("// single line comment\\u000A x = 1;"); x === 1. Actual: ' + (x)); }

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A4_T2; * @section: 7.3, 7.4; * @assertion: Single line comments can contain Line Terminator at the end of line; * @description: Insert CARRIAGE RETURN (U+000D) into the end of single line comment; */ // CHECK#1 eval("// single line comment\u000D"); // CHECK#2 var x = 0; eval("// single line comment\u000D x = 1;"); if (x !== 1) { $ERROR('#1: var x = 0; eval("// single line comment\\u000D x = 1;"); x === 1. Actual: ' + (x)); }

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A4_T3; * @section: 7.3, 7.4; * @assertion: Single line comments can contain Line Terminator at the end of line; * @description: Insert LINE SEPARATOR (U+2028) into the end of single line comment; */ // CHECK#1 eval("// single line comment\u2028"); // CHECK#2 var x = 0; eval("// single line comment\u2028 x = 1;"); if (x !== 1) { $ERROR('#1: var x = 0; eval("// single line comment\\u2028 x = 1;"); x === 1. Actual: ' + (x)); }

View File

@ -0,0 +1,4 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/** * @name: S7.3_A4_T4; * @section: 7.3, 7.4; * @assertion: Single line comments can contain Line Terminator at the end of line; * @description: Insert PARAGRAPH SEPARATOR (U+2029) into the end of single line comment; */ // CHECK#1 eval("// single line comment\u2029"); // CHECK#2 var x = 0; eval("// single line comment\u2029 x = 1;"); if (x !== 1) { $ERROR('#1: var x = 0; eval("// single line comment\\u2029 x = 1;"); x === 1. Actual: ' + (x)); }

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A5.1_T1;
* @section: 7.3, 7.4;
* @assertion: Multi line comment can contain LINE FEED (U+000A);
* @description: Insert LINE FEED (U+000A) into multi line comment;
*/
// CHECK#1
eval("/*\u000A multi line \u000A comment \u000A*/");
//CHECK#2
var x = 0;
eval("/*\u000A multi line \u000A comment \u000A x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u000A multi line \\u000A comment \\u000A x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,21 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A5.1_T2;
* @section: 7.3, 7.4;
* @assertion: Multi line comment can contain LINE FEED (U+000A);
* @description: Insert real LINE FEED into multi line comment;
*/
/*CHECK#1*/
var x = 0;
/*
multi
line
comment
x = 1;
*/
if (x !== 0) {
$ERROR('#1: var x = 0; /*\\nmulti\\nline\\ncomment\\nx = 1;\\n*/ x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A5.2_T1;
* @section: 7.3, 7.4;
* @assertion: Multi line comment can contain CARRIAGE RETURN (U+000D);
* @description: Insert CARRIAGE RETURN (U+000D) into multi line comment;
*/
// CHECK#1
eval("/*\u000D multi line \u000D comment \u000D*/");
//CHECK#2
var x = 0;
eval("/*\u000D multi line \u000D comment \u000D x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u000D multi line \\u000D comment \\u000D x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,10 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A5.2_T2;
* @section: 7.3, 7.4;
* @assertion: Multi line comment can contain CARRIAGE RETURN (U+000D);
* @description: Insert real CARRIAGE RETURN into multi line comment;
*/
/*CHECK#1*/ var x = 0; /* multi line comment x = 1; */ if (x !== 0) { $ERROR('#1: var x = 0; /*\\rmulti\\rline\\rcomment\\rx = 1;\\r*/ x === 0. Actual: ' + (x)); }

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A5.3;
* @section: 7.3, 7.4;
* @assertion: Multi line comment can contain LINE SEPARATOR (U+2028);
* @description: Insert LINE SEPARATOR (U+2028) into multi line comment;
*/
// CHECK#1
eval("/*\u2028 multi line \u2028 comment \u2028*/");
//CHECK#2
var x = 0;
eval("/*\u2028 multi line \u2028 comment \u2028 x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u2028 multi line \\u2028 comment \\u2028 x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,19 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A5.4;
* @section: 7.3, 7.4;
* @assertion: Multi line comment can contain LINE SEPARATOR (U+2029);
* @description: Insert PARAGRAPH SEPARATOR (U+2029) into multi line comment;
*/
// CHECK#1
eval("/*\u2029 multi line \u2029 comment \u2029*/");
//CHECK#2
var x = 0;
eval("/*\u2029 multi line \u2029 comment \u2029 x = 1;*/");
if (x !== 0) {
$ERROR('#1: var x = 0; eval("/*\\u2029 multi line \\u2029 comment \\u2029 x = 1;*/"); x === 0. Actual: ' + (x));
}

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A6_T1;
* @section: 7.3;
* @assertion: Line Terminator cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Insert LINE FEED (U+000A) in var x;
* @negative
*/
var\u000Ax;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A6_T2;
* @section: 7.3;
* @assertion: Line Terminator cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Insert CARRIAGE RETURN (U+000D) in var x;
* @negative
*/
var\u000Dx;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A6_T3;
* @section: 7.3;
* @assertion: Line Terminator cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Insert LINE SEPARATOR (U+2028) in var x;
* @negative
*/
var\u2028x;

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A6_T4;
* @section: 7.3;
* @assertion: Line Terminator cannot be expressed as a Unicode escape sequence consisting of six characters, namely \u plus four hexadecimal digits;
* @description: Insert PARAGRAPH SEPARATOR (U+2029) in var x;
* @negative
*/
var\u2029x;

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T1;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y+z;
*/
// CHECK#1
var y=2;
var z=3;
var
x
=
y
+
z
;
if (x !== 5) {
$ERROR('#1: var\\nx\\n=\\ny\\n+\\nz\\n; x === 5. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=2;
var z=3;
var
x
=
y
+
z
;
if (x !== 5) {
$ERROR('#2: var\\nx\\n=\\ny\\n+\\nz\\n; x === 5. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=2;
var z=3;
eval("\u2028var\u2028x\u2028=\u2028y\u2028+\u2028z\u2028");
if (x !== 5) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028+\\u2028z\\u2028"); x === 5. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=2;
var z=3;
eval("\u2029var\u2029x\u2029=\u2029y\u2029+\u2029z\u2029");
if (x !== 5) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029+\\u2029z\\u2029"); x === 5. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T2;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y-z;
*/
// CHECK#1
var y=3;
var z=2;
var
x
=
y
-
z
;
if (x !== 1) {
$ERROR('#1: var\\nx\\n=\\ny\\n-\\nz\\n; x === 1. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=3;
var z=2;
var
x
=
y
-
z
;
if (x !== 1) {
$ERROR('#2: var\\nx\\n=\\ny\\n-\\nz\\n; x === 1. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=3;
var z=2;
eval("\u2028var\u2028x\u2028=\u2028y\u2028-\u2028z\u2028");
if (x !== 1) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028-\\u2028z\\u2028"); x === 1. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=3;
var z=2;
eval("\u2029var\u2029x\u2029=\u2029y\u2029-\u2029z\u2029");
if (x !== 1) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029-\\u2029z\\u2029"); x === 1. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T3;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y*z;
*/
// CHECK#1
var y=3;
var z=2;
var
x
=
y
*
z
;
if (x !== 6) {
$ERROR('#1: var\\nx\\n=\\ny\\n*\\nz\\n; x === 6. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=3;
var z=2;
var
x
=
y
*
z
;
if (x !== 6) {
$ERROR('#2: var\\nx\\n=\\ny\\n*\\nz\\n; x === 6. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=3;
var z=2;
eval("\u2028var\u2028x\u2028=\u2028y\u2028*\u2028z\u2028");
if (x !== 6) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028*\\u2028z\\u2028"); x === 6. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=3;
var z=2;
eval("\u2029var\u2029x\u2029=\u2029y\u2029*\u2029z\u2029");
if (x !== 6) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029*\\u2029z\\u2029"); x === 6. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T4;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y/z;
*/
// CHECK#1
var y=12;
var z=2;
var
x
=
y
/
z
;
if (x !== 6) {
$ERROR('#1: var\\nx\\n=\\ny\\n/\\nz\\n; x === 6. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=12;
var z=2;
var
x
=
y
/
z
;
if (x !== 6) {
$ERROR('#2: var\\nx\\n=\\ny\\n/\\nz\\n; x === 6. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=12;
var z=2;
eval("\u2028var\u2028x\u2028=\u2028y\u2028/\u2028z\u2028");
if (x !== 6) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028/\\u2028z\\u2028"); x === 6. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=12;
var z=2;
eval("\u2029var\u2029x\u2029=\u2029y\u2029/\u2029z\u2029");
if (x !== 6) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029/\\u2029z\\u2029"); x === 6. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T5;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y%z;
*/
// CHECK#1
var y=16;
var z=10;
var
x
=
y
%
z
;
if (x !== 6) {
$ERROR('#1: var\\nx\\n=\\ny\\n%\\nz\\n; x === 6. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=16;
var z=10;
var
x
=
y
%
z
;
if (x !== 6) {
$ERROR('#2: var\\nx\\n=\\ny\\n%\\nz\\n; x === 6. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=16;
var z=10;
eval("\u2028var\u2028x\u2028=\u2028y\u2028%\u2028z\u2028");
if (x !== 6) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028%\\u2028z\\u2028"); x === 6. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=16;
var z=10;
eval("\u2029var\u2029x\u2029=\u2029y\u2029%\u2029z\u2029");
if (x !== 6) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029%\\u2029z\\u2029"); x === 6. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T6;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y>>z;
*/
// CHECK#1
var y=16;
var z=3;
var
x
=
y
>>
z
;
if (x !== 2) {
$ERROR('#1: var\\nx\\n=\\ny\\n>>\\nz\\n; x === 2. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=16;
var z=3;
var
x
=
y
>>
z
;
if (x !== 2) {
$ERROR('#2: var\\nx\\n=\\ny\\n>>\\nz\\n; x === 2. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=16;
var z=3;
eval("\u2028var\u2028x\u2028=\u2028y\u2028>>\u2028z\u2028");
if (x !== 2) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028>>\\u2028z\\u2028"); x === 2. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=16;
var z=3;
eval("\u2029var\u2029x\u2029=\u2029y\u2029>>\u2029z\u2029");
if (x !== 2) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029>>\\u2029z\\u2029"); x === 2. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T7;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y<<z;
*/
// CHECK#1
var y=2;
var z=3;
var
x
=
y
<<
z
;
if (x !== 16) {
$ERROR('#1: var\\nx\\n=\\ny\\n<<\\nz\\n; x === 16. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=2;
var z=3;
var
x
=
y
<<
z
;
if (x !== 16) {
$ERROR('#2: var\\nx\\n=\\ny\\n<<\\nz\\n; x ===16 ');
}
x=0;
// CHECK#3
var y=2;
var z=3;
eval("\u2028var\u2028x\u2028=\u2028y\u2028<<\u2028z\u2028");
if (x !== 16) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028<<\\u2028z\\u2028"); x === 16. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=2;
var z=3;
eval("\u2029var\u2029x\u2029=\u2029y\u2029<<\u2029z\u2029");
if (x !== 16) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029<<\\u2029z\\u2029"); x === 16. Actual: ' + (x));
}

View File

@ -0,0 +1,56 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.3_A7_T8;
* @section: 7.3;
* @assertion: Line Terminators between operators are allowed;
* @description: Insert Line Terminator in var x=y<z;
*/
// CHECK#1
var y=2;
var z=3;
var
x
=
y
<
z
;
if (x !== true) {
$ERROR('#1: var\\nx\\n=\\ny\\n<\\nz\\n; x === true. Actual: ' + (x));
}
x=0;
// CHECK#2
var y=2;
var z=3;
var
x
=
y
<
z
;
if (x !== true) {
$ERROR('#2: var\\nx\\n=\\ny\\n<\\nz\\n; x === true. Actual: ' + (x));
}
x=0;
// CHECK#3
var y=2;
var z=3;
eval("\u2028var\u2028x\u2028=\u2028y\u2028<\u2028z\u2028");
if (x !== true) {
$ERROR('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028<\\u2028z\\u2028"); x === true. Actual: ' + (x));
}
x=0;
// CHECK#4
var y=2;
var z=3;
eval("\u2029var\u2029x\u2029=\u2029y\u2029<\u2029z\u2029");
if (x !== true) {
$ERROR('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029<\\u2029z\\u2029"); x === true. Actual: ' + (x));
}

View File

@ -0,0 +1,43 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.4_A1_T1;
* @section: 7.4;
* @assertion: Correct interpretation of single line comments;
* @description: Create comments with any code;
*/
//CHECK#1
// $ERROR('#1: Correct interpretation single line comments');
//CHECK#2
var x = 0;
// x = 1;
if (x !== 0) {
$ERROR('#2: var x = 0; // x = 1; x === 0. Actual: ' + (x));
}
//CHECK#3
var // y = 1;
y;
if (y !== undefined) {
$ERROR('#3: var // y = 1; \\n y; y === undefined. Actual: ' + (y));
}
//CHECK#4
//$ERROR('#4: Correct interpretation single line comments') //$ERROR('#4: Correct interpretation single line comments'); //
////CHECK#5
//var x = 1;
//if (x === 1) {
// $ERROR('#5: Correct interpretation single line comments');
//}
//CHECK#6
//var this.y = 1;
this.y++;
if (isNaN(y) !== true) {
$ERROR('#6: //var this.y = 1; \\n this.y++; y === Not-a-Number. Actual: ' + (y));
}

View File

@ -0,0 +1,12 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.4_A1_T2;
* @section: 7.4;
* @assertion: Correct interpretation of single line comments;
* @description: Simple test, create empty comment: ///;
*/
//CHECK#1
///

View File

@ -0,0 +1,77 @@
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S7.4_A2_T1;
* @section: 7.4;
* @assertion: Correct interpretation of multi line comments;
* @description: Create comments with any code;
*/
/*CHECK#1*/
/* $ERROR('#1: Correct interpretation multi line comments');
*/
/*CHECK#2*/
var x = 0;
/* x = 1;*/
if (x !== 0) {
$ERROR('#2: var x = 0; /* x = 1;*/ x === 0. Actual: ' + (x));
}
//CHECK#3
var /* y = 1;*/
y;
if (y !== undefined) {
$ERROR('#3: var /* y = 1; */ \\n y; y === undefined. Actual: ' + (y));
}
//CHECK#4
var /* y = 1;*/ y;
if (y !== undefined) {
$ERROR('#4: var /* y = 1; */ y; y === undefined. Actual: ' + (y));
}
/*CHECK#5*/
/*var x = 1;
if (x === 1) {
$ERROR('#5: Correct interpretation multi line comments');
}
*/
/*CHECK#6*/
/*var this.y = 1;*/
this.y++;
if (isNaN(y) !== true) {
$ERROR('#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*/") {
$ERROR('#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") {
$ERROR('#8: var string = "/*var y = 0" /* y = 1;*/ string === "//var y = 0"');
}
/*CHECK#9*/
/** $ERROR('#9: Correct interpretation multi line comments');
*/
/*CHECK#10*/
/* $ERROR('#10: Correct interpretation multi line comments');
**/
/*CHECK#11*/
/****** $ERROR('#11: Correct interpretation multi line comments');*********
***********
*
**********
**/

Some files were not shown because too many files have changed in this diff Show More