|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 |
|
7 /** |
|
8 File Name: 7.3-1.js |
|
9 ECMA Section: 7.3 Comments |
|
10 Description: |
|
11 |
|
12 |
|
13 Author: christine@netscape.com |
|
14 Date: 12 november 1997 |
|
15 |
|
16 */ |
|
17 var SECTION = "7.3-1"; |
|
18 var VERSION = "ECMA_1"; |
|
19 startTest(); |
|
20 var TITLE = "Comments"; |
|
21 |
|
22 writeHeaderToLog( SECTION + " "+ TITLE); |
|
23 |
|
24 var testcase; |
|
25 |
|
26 testcase = new TestCase( SECTION, |
|
27 "a comment with a line terminator string, and text following", |
|
28 "pass", |
|
29 "pass"); |
|
30 |
|
31 // "\u000A" testcase.actual = "fail"; |
|
32 |
|
33 |
|
34 testcase = new TestCase( SECTION, |
|
35 "// test \\n testcase.actual = \"pass\"", |
|
36 "pass", |
|
37 "" ); |
|
38 |
|
39 var x = "// test \n testcase.actual = 'pass'"; |
|
40 |
|
41 testcase.actual = eval(x); |
|
42 |
|
43 test(); |
|
44 |
|
45 // XXX bc replace test() |
|
46 function test() { |
|
47 for ( gTc=0; gTc < gTestcases.length; gTc++ ) { |
|
48 gTestcases[gTc].passed = writeTestCaseResult( |
|
49 gTestcases[gTc].expect, |
|
50 gTestcases[gTc].actual, |
|
51 gTestcases[gTc].description +": "+ |
|
52 gTestcases[gTc].actual ); |
|
53 |
|
54 gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : " ignored chars after line terminator of single-line comment"; |
|
55 } |
|
56 stopTest(); |
|
57 return ( gTestcases ); |
|
58 } |