author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Sat, 02 Nov 2013 21:09:52 +0100 | |
changeset 1407 | 32e050a07754 |
parent 1272 | 3ee4ec9577bc |
permissions | -rw-r--r-- |
jaroslav@1272 | 1 |
/** |
jaroslav@1272 | 2 |
* Back 2 Browser Bytecode Translator |
jaroslav@1272 | 3 |
* Copyright (C) 2012 Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@1272 | 4 |
* |
jaroslav@1272 | 5 |
* This program is free software: you can redistribute it and/or modify |
jaroslav@1272 | 6 |
* it under the terms of the GNU General Public License as published by |
jaroslav@1272 | 7 |
* the Free Software Foundation, version 2 of the License. |
jaroslav@1272 | 8 |
* |
jaroslav@1272 | 9 |
* This program is distributed in the hope that it will be useful, |
jaroslav@1272 | 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
jaroslav@1272 | 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
jaroslav@1272 | 12 |
* GNU General Public License for more details. |
jaroslav@1272 | 13 |
* |
jaroslav@1272 | 14 |
* You should have received a copy of the GNU General Public License |
jaroslav@1272 | 15 |
* along with this program. Look for COPYING file in the top folder. |
jaroslav@1272 | 16 |
* If not, see http://opensource.org/licenses/GPL-2.0. |
jaroslav@1272 | 17 |
*/ |
jaroslav@1272 | 18 |
package org.apidesign.bck2brwsr.tck; |
jaroslav@1272 | 19 |
|
jaroslav@1272 | 20 |
import java.util.Arrays; |
jaroslav@1272 | 21 |
import org.apidesign.bck2brwsr.vmtest.Compare; |
jaroslav@1272 | 22 |
import org.apidesign.bck2brwsr.vmtest.VMTest; |
jaroslav@1272 | 23 |
import org.testng.annotations.Factory; |
jaroslav@1272 | 24 |
|
jaroslav@1272 | 25 |
/** |
jaroslav@1272 | 26 |
* |
jaroslav@1272 | 27 |
* @author Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@1272 | 28 |
*/ |
jaroslav@1272 | 29 |
public class RegExpSplitTest { |
jaroslav@1272 | 30 |
|
jaroslav@1272 | 31 |
public @Compare Object splitSpace() { |
jaroslav@1272 | 32 |
return Arrays.asList("How are you today?".split(" ")); |
jaroslav@1272 | 33 |
} |
jaroslav@1272 | 34 |
|
jaroslav@1364 | 35 |
public @Compare String splitNewline() { |
jaroslav@1364 | 36 |
return Arrays.toString("initializer must be able to complete normally".split("\n")); |
jaroslav@1364 | 37 |
} |
jaroslav@1364 | 38 |
|
jaroslav@1272 | 39 |
public @Compare Object splitSpaceTrimMinusOne() { |
jaroslav@1272 | 40 |
return Arrays.asList(" How are you today? ".split(" ", -1)); |
jaroslav@1272 | 41 |
} |
jaroslav@1272 | 42 |
|
jaroslav@1272 | 43 |
public @Compare Object splitSpaceTrimZero() { |
jaroslav@1272 | 44 |
return Arrays.asList(" How are you today? ".split(" ", 0)); |
jaroslav@1272 | 45 |
} |
jaroslav@1272 | 46 |
|
jaroslav@1272 | 47 |
public @Compare Object splitSpaceLimit2() { |
jaroslav@1272 | 48 |
return Arrays.asList("How are you today?".split(" ", 2)); |
jaroslav@1272 | 49 |
} |
jaroslav@1272 | 50 |
|
jaroslav@1272 | 51 |
@Factory public static Object[] create() { |
jaroslav@1272 | 52 |
return VMTest.create(RegExpSplitTest.class); |
jaroslav@1272 | 53 |
} |
jaroslav@1272 | 54 |
} |