Debian Codegraph @

rhino/testsrc/tests/ecma/String/15.5.4.5-4.js

raw symbols SCIP
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 gTestfile = '15.5.4.5-4.js';
7
8 /**
9 File Name: 15.5.4.5-4.js
10 ECMA Section: 15.5.4.5 String.prototype.charCodeAt(pos)
11
12 Description: Returns a nonnegative integer less than 2^16.
13
14 Author: [email protected]
15 Date: 28 october 1997
16
17 */
18 var VERSION = "0697";
19 startTest();
20 var SECTION = "15.5.4.5-4";
21
22 writeHeaderToLog( SECTION + " String.prototype.charCodeAt(pos)" );
23
24 var MAXCHARCODE = Math.pow(2,16);
25 var item=0, CHARCODE;
26
27 for ( CHARCODE=0; CHARCODE <256; CHARCODE++ ) {
28 new TestCase( SECTION,
29 "(String.fromCharCode("+CHARCODE+")).charCodeAt(0)",
30 CHARCODE,
31 (String.fromCharCode(CHARCODE)).charCodeAt(0) );
32 }
33 for ( CHARCODE=256; CHARCODE < 65536; CHARCODE+=999 ) {
34 new TestCase( SECTION,
35 "(String.fromCharCode("+CHARCODE+")).charCodeAt(0)",
36 CHARCODE,
37 (String.fromCharCode(CHARCODE)).charCodeAt(0) );
38 }
39
40 new TestCase( SECTION, "(String.fromCharCode(65535)).charCodeAt(0)", 65535, (String.fromCharCode(65535)).charCodeAt(0) );
41
42 test();