nashorn/test/script/basic/JDK-8023650.js
author sundar
Thu, 13 Mar 2014 15:58:24 +0530
changeset 23374 f470afc89c6c
parent 19634 67426988370f
child 24778 2ff5d7041566
permissions -rw-r--r--
8015958: DataView constructor is not defined Reviewed-by: attila, hannesw, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19634
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     1
/*
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     4
 * 
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     7
 * published by the Free Software Foundation.
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     8
 * 
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    13
 * accompanied this code).
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    14
 * 
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    18
 * 
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    21
 * questions.
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    22
 */
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    23
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    24
/**
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    25
 * JDK-8023650: Regexp m flag does not recognize CRNL or CR
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    26
 *
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    27
 * @test
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    28
 * @run
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    29
 */
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    30
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    31
if (!/^Connection: close$/m.test('\r\n\r\nConnection: close\r\n\r\n')) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    32
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    33
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    34
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    35
if (!/^Connection: close$/m.test('\n\nConnection: close\n\n')) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    36
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    37
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    38
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    39
if (!/^Connection: close$/m.test('\r\rConnection: close\r\r')) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    40
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    41
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    42
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    43
if (!/^Connection: close$/m.test('\u2028\u2028Connection: close\u2028\u2028')) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    44
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    45
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    46
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    47
if (!/^Connection: close$/m.test('\u2029\u2029Connection: close\u2029\u2029')) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    48
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    49
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    50
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    51
var result = /a(.*)/.exec("a\r");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    52
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    53
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    54
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    55
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    56
result = /a(.*)/m.exec("a\r");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    57
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    58
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    59
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    60
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    61
result = /a(.*)/.exec("a\n");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    62
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    63
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    64
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    65
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    66
result = /a(.*)/m.exec("a\n");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    67
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    68
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    69
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    70
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    71
result = /a(.*)/.exec("a\r\n");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    72
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    73
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    74
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    75
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    76
result = /a(.*)/m.exec("a\r\n");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    77
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    78
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    79
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    80
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    81
result = /a(.*)/.exec("a\u2028");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    82
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    83
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    84
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    85
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    86
result = /a(.*)/m.exec("a\u2029");
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    87
if (!result || result[0] != 'a' || result[1] != '') {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    88
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    89
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    90
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    91
if (/a$/.test("a\n")) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    92
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    93
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    94
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    95
if (/a$/.test("a\r")) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    96
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    97
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    98
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
    99
if (/a$/.test("a\r\n")) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   100
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   101
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   102
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   103
if (/a$/.test("a\u2028")) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   104
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   105
}
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   106
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   107
if (/a$/.test("a\u2029")) {
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   108
    throw new Error();
67426988370f 8023650: Regexp m flag does not recognize CRNL or CR
hannesw
parents:
diff changeset
   109
}