StringObjectUse should not be a structure check for the original string object structure
[WebKit-https.git] / LayoutTests / sputnik / Conformance / 07_Lexical_Conventions / 7.8_Literals / 7.8.4_String_Literals / S7.8.4_A7.3_T1.html
1 <html>
2 <head>
3 <meta charset='utf-8'>
4 <style>
5 .pass {
6     font-weight: bold;
7     color: green;
8 }
9 .fail {
10     font-weight: bold;
11     color: red;
12 }
13 </style>
14
15 <script>
16 if (window.testRunner)
17     testRunner.dumpAsText();
18
19 function SputnikError(message)
20 {
21     this.message = message;
22 }
23
24 SputnikError.prototype.toString = function ()
25 {
26     return 'SputnikError: ' + this.message;
27 };
28
29 var sputnikException;
30
31 function testPrint(msg)
32 {
33     var span = document.createElement("span");
34     document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace 
35     span.innerHTML = msg + '<br />';
36 }
37
38 function escapeHTML(text)
39 {
40     return text.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;");
41 }
42
43 function printTestPassed(msg)
44 {
45     testPrint('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
46 }
47
48 function printTestFailed(msg)
49 {
50     testPrint('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
51 }
52
53 function testFailed(msg)
54 {
55     throw new SputnikError(msg);
56 }
57
58 var successfullyParsed = false;
59 </script>
60
61 </head>
62 <body>
63 <p>S7.8.4_A7.3_T1</p>
64 <div id='console'></div>
65 <script>
66 try {
67
68 /**
69  * @name: S7.8.4_A7.3_T1;
70  * @section: 7.8.4;
71  * @assertion: \u HexDigit HexDigit HexDigit HexDigit DoubleStringCharacter;
72  * @description: Check similar to ("\u0001F" === String.fromCharCode("1") + "F");
73 */
74
75 //CHECK#1
76 if ("\u0001F" !== String.fromCharCode("1") + "F") {
77   testFailed('#1: "\\u0001F" === String.fromCharCode("1") + "F"');
78 }
79
80 //CHECK#2
81 if ("\u0002E" !== String.fromCharCode("2") + "E") {
82   testFailed('#2: "\\u0002E" === String.fromCharCode("2") + "E"');
83 }
84
85 //CHECK#3
86 if ("\u0003D" !== String.fromCharCode("3") + "D") {
87   testFailed('#3: "\\u0003D" === String.fromCharCode("3") + "D"');
88 }
89
90 //CHECK#4
91 if ("\u0004C" !== String.fromCharCode("4") + "C") {
92   testFailed('#4: "\\u0004C" === String.fromCharCode("4") + "C"');
93 }
94
95 //CHECK#5
96 if ("\u0005B" !== String.fromCharCode("5") + "B") {
97   testFailed('#5: "\\u0005B" === String.fromCharCode("5") + "B"');
98 }
99
100 //CHECK#6
101 if ("\u0006A" !== String.fromCharCode("6") + "A") {
102   testFailed('#6: "\\u0006A" === String.fromCharCode("6") + "A"');
103 }
104
105 //CHECK#7
106 if ("\u00079" !== String.fromCharCode("7") + "9") {
107   testFailed('#7: "\\u00079" === String.fromCharCode("7") + "9"');
108 }
109
110 //CHECK#8
111 if ("\u00088" !== String.fromCharCode("8") + "8") {
112   testFailed('#8: "\\u00088" === String.fromCharCode("8") + "8"');
113 }
114
115 //CHECK#9
116 if ("\u00097" !== String.fromCharCode("9") + "7") {
117   testFailed('#9: "\\u00097" === String.fromCharCode("9") + "7"');
118 }
119
120 //CHECK#A
121 if ("\u000A6" !== String.fromCharCode("10") + "6") {
122   testFailed('#A: "\\u000A6" === String.fromCharCode("10") + "6"');
123 }
124
125 //CHECK#B
126 if ("\u000B5" !== String.fromCharCode("11") + "5") {
127   testFailed('#B: "\\u000B5" === String.fromCharCode("11") + "5"');
128 }
129
130 //CHECK#C
131 if ("\u000C4" !== String.fromCharCode("12") + "4") {
132   testFailed('#C: "\\u000C4" === String.fromCharCode("12") + "4"');
133 }
134
135 //CHECK#D
136 if ("\u000D3" !== String.fromCharCode("13") + "3") {
137   testFailed('#D: "\\u000D3" === String.fromCharCode("13") + "3"');
138 }
139
140 //CHECK#E
141 if ("\u000E2" !== String.fromCharCode("14") + "2") {
142   testFailed('#E: "\\u000E2" === String.fromCharCode("14") + "2"');
143 }
144
145 //CHECK#F
146 if ("\u000F1" !== String.fromCharCode("15") + "1") {
147   testFailed('#F: "\\u000F1" === String.fromCharCode("15") + "1"');
148 }
149
150 } catch (ex) {
151     sputnikException = ex;
152 }
153
154 var successfullyParsed = true;
155 </script>
156
157 <script>
158 if (!successfullyParsed)
159     printTestFailed('successfullyParsed is not set');
160 else if (sputnikException)
161     printTestFailed(sputnikException);
162 else
163     printTestPassed("");
164 testPrint('<br /><span class="pass">TEST COMPLETE</span>');
165 </script>
166 </body>
167 </html>