aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.1_T2.js
blob: 00b66d18df218ece3d075c138c7a1a1fad8c5446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
 * @name: S7.8.4_A4.1_T2;
 * @section: 7.8.4;
 * @assertion: CharacterEscapeSequnce :: SingleEscapeSequence;  
 * @description: SingleEscapeSequence :: one of ' " \;
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S7.8.4_A4.1_T2",

path: "TestCases/07_Lexical_Conventions/7.8_Literals/7.8.4_String_Literals/S7.8.4_A4.1_T2.js",

assertion: "CharacterEscapeSequnce :: SingleEscapeSequence",

description: "SingleEscapeSequence :: one of \' \" \\",

test: function testcase() {
   //CHECK#1
if (String.fromCharCode(0x0027) !== "\'") {
  $ERROR('#1: String.fromCharCode(0x0027) === "\\\'"');
}

//CHECK#2
if (String.fromCharCode(0x0022) !== '\"') {
  $ERROR('#2: String.fromCharCode(0x0027) === \'\\\"\'');
}

//CHECK#3
if (String.fromCharCode(0x005C) !== "\\") {
  $ERROR('#3: String.fromCharCode(0x005C) === "\\\"');
}

//CHECK#4
if ("\'" !== "'") {
  $ERROR('#4: "\'" === "\\\'"');
}

//CHECK#5
if ('\"' !== '"') {
  $ERROR('#5: \'\"\' === \'\\\"\'');
}

 }
});