nashorn/test/script/basic/JDK-8019987.js
author twisti
Wed, 11 Nov 2015 14:40:38 -1000
changeset 34173 01bb07d23a5b
parent 19633 e1158153db51
permissions -rw-r--r--
8141133: [JVMCI] crash during safepoint deopt if rethrow_exception is set Reviewed-by: twisti Contributed-by: Gilles Duboscq <gilles.m.duboscq@oracle.com>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19633
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     1
/*
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     4
 *
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     8
 *
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    13
 * accompanied this code).
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    14
 *
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    18
 *
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    21
 * questions.
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    22
 */
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    23
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    24
/**
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    25
 * JDK-8019987: String trimRight and trimLeft could be defined.
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    26
 *
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    27
 * @test
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    28
 * @run
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    29
 */
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    30
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    31
var TESTSTRING = "abcde";
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    32
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    33
var SPACES                       = "     ";
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    34
var TESTSTRING_LEFT_SPACES       = SPACES + TESTSTRING;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    35
var TESTSTRING_RIGHT_SPACES      = TESTSTRING + SPACES;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    36
var TESTSTRING_BOTH_SPACES       = SPACES + TESTSTRING + SPACES;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    37
var TESTSTRING_MIDDLE_SPACES     = TESTSTRING + SPACES + TESTSTRING;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    38
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    39
var WHITESPACE =
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    40
        " \t"    + // space and tab
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    41
        "\n\r"   + // newline and return
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    42
        "\u2028" + // line separator
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    43
        "\u2029" + // paragraph separator
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    44
        "\u000b" + // tabulation line
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    45
        "\u000c" + // ff (ctrl-l)
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    46
        "\u00a0" + // Latin-1 space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    47
        "\u1680" + // Ogham space mark
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    48
        "\u180e" + // separator, Mongolian vowel
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    49
        "\u2000" + // en quad
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    50
        "\u2001" + // em quad
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    51
        "\u2002" + // en space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    52
        "\u2003" + // em space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    53
        "\u2004" + // three-per-em space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    54
        "\u2005" + // four-per-em space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    55
        "\u2006" + // six-per-em space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    56
        "\u2007" + // figure space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    57
        "\u2008" + // punctuation space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    58
        "\u2009" + // thin space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    59
        "\u200a" + // hair space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    60
        "\u202f" + // narrow no-break space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    61
        "\u205f" + // medium mathematical space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    62
        "\u3000" + // ideographic space
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    63
        "\ufeff";  // byte order mark
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    64
var TESTSTRING_LEFT_WHITESPACE   = WHITESPACE + TESTSTRING;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    65
var TESTSTRING_RIGHT_WHITESPACE  = TESTSTRING + WHITESPACE;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    66
var TESTSTRING_BOTH_WHITESPACE   = WHITESPACE + TESTSTRING + WHITESPACE;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    67
var TESTSTRING_MIDDLE_WHITESPACE = TESTSTRING + WHITESPACE + TESTSTRING;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    68
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    69
function escape(string) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    70
    var sb = new java.lang.StringBuilder();
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    71
    sb.append("\"");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    72
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    73
    for (var i = 0; i < string.length; i++) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    74
        var ch = string.charAt(i);
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    75
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    76
        switch (ch) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    77
        case '\\':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    78
            sb.append("\\\\");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    79
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    80
        case '"':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    81
            sb.append("\\\"");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    82
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    83
        case '\'':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    84
            sb.append("\\\'");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    85
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    86
        case '\b':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    87
            sb.append("\\b");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    88
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    89
        case '\f':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    90
            sb.append("\\f");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    91
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    92
        case '\n':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    93
            sb.append("\\n");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    94
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    95
        case '\r':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    96
            sb.append("\\r");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    97
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    98
        case '\t':
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
    99
            sb.append("\\t");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   100
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   101
        default:
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   102
            var code = string.charCodeAt(i);
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   103
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   104
            if (code < 0x20 || code >= 0xFF) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   105
                sb.append("\\u");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   106
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   107
                var hex = java.lang.Integer.toHexString(code);
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   108
                for (var i = hex.length; i < 4; i++) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   109
                    sb.append('0');
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   110
                }
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   111
                sb.append(hex);
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   112
            } else {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   113
                sb.append(ch);
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   114
            }
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   115
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   116
            break;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   117
        }
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   118
    }
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   119
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   120
    sb.append("\"");
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   121
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   122
    return sb.toString();
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   123
}
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   124
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   125
var count = 0;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   126
function test(expected, trimmed) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   127
    count++;
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   128
    if (trimmed != expected) {
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   129
        print(count + ": Expected: " + escape(expected) + ", found: " + escape(trimmed));
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   130
    }
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   131
}
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   132
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   133
test("",                           SPACES.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   134
test("",                           SPACES.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   135
test("",                           SPACES.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   136
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   137
test(TESTSTRING,                   TESTSTRING_LEFT_SPACES.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   138
test(TESTSTRING,                   TESTSTRING_LEFT_SPACES.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   139
test(TESTSTRING_LEFT_SPACES,       TESTSTRING_LEFT_SPACES.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   140
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   141
test(TESTSTRING,                   TESTSTRING_RIGHT_SPACES.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   142
test(TESTSTRING_RIGHT_SPACES,      TESTSTRING_RIGHT_SPACES.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   143
test(TESTSTRING,                   TESTSTRING_RIGHT_SPACES.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   144
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   145
test(TESTSTRING,                   TESTSTRING_BOTH_SPACES.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   146
test(TESTSTRING_RIGHT_SPACES,      TESTSTRING_BOTH_SPACES.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   147
test(TESTSTRING_LEFT_SPACES,       TESTSTRING_BOTH_SPACES.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   148
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   149
test(TESTSTRING_MIDDLE_SPACES,     TESTSTRING_MIDDLE_SPACES.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   150
test(TESTSTRING_MIDDLE_SPACES,     TESTSTRING_MIDDLE_SPACES.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   151
test(TESTSTRING_MIDDLE_SPACES,     TESTSTRING_MIDDLE_SPACES.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   152
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   153
test("",                           WHITESPACE.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   154
test("",                           WHITESPACE.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   155
test("",                           WHITESPACE.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   156
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   157
test(TESTSTRING,                   TESTSTRING_LEFT_WHITESPACE.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   158
test(TESTSTRING,                   TESTSTRING_LEFT_WHITESPACE.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   159
test(TESTSTRING_LEFT_WHITESPACE,   TESTSTRING_LEFT_WHITESPACE.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   160
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   161
test(TESTSTRING,                   TESTSTRING_RIGHT_WHITESPACE.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   162
test(TESTSTRING_RIGHT_WHITESPACE,  TESTSTRING_RIGHT_WHITESPACE.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   163
test(TESTSTRING,                   TESTSTRING_RIGHT_WHITESPACE.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   164
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   165
test(TESTSTRING,                   TESTSTRING_BOTH_WHITESPACE.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   166
test(TESTSTRING_RIGHT_WHITESPACE,  TESTSTRING_BOTH_WHITESPACE.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   167
test(TESTSTRING_LEFT_WHITESPACE,   TESTSTRING_BOTH_WHITESPACE.trimRight());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   168
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   169
test(TESTSTRING_MIDDLE_WHITESPACE, TESTSTRING_MIDDLE_WHITESPACE.trim());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   170
test(TESTSTRING_MIDDLE_WHITESPACE, TESTSTRING_MIDDLE_WHITESPACE.trimLeft());
e1158153db51 8019987: String trimRight and trimLeft could be defined
jlaskey
parents:
diff changeset
   171
test(TESTSTRING_MIDDLE_WHITESPACE, TESTSTRING_MIDDLE_WHITESPACE.trimRight());