Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2005, 2009 IBM Corporation and others. |
2 |
* Copyright (c) 2005, 2010 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 22-28
Link Here
|
22 |
public static Test suite() { |
22 |
public static Test suite() { |
23 |
return buildAllCompliancesTestSuite(testClass()); |
23 |
return buildAllCompliancesTestSuite(testClass()); |
24 |
} |
24 |
} |
25 |
|
25 |
public static Class testClass() { |
|
|
26 |
return CharOperationTest.class; |
27 |
} |
26 |
public void test001() { |
28 |
public void test001() { |
27 |
char[] array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' }; |
29 |
char[] array = { 'a' , 'b', 'b', 'c', 'a', 'b', 'c', 'a' }; |
28 |
char[] toBeReplaced = { 'b', 'c' }; |
30 |
char[] toBeReplaced = { 'b', 'c' }; |
Lines 120-126
Link Here
|
120 |
char[] array2 = new char[] { 'a' , 'b', 'c', 'a', 'a'}; |
122 |
char[] array2 = new char[] { 'a' , 'b', 'c', 'a', 'a'}; |
121 |
assertTrue(CharOperation.indexOf(array, array2, false, -1) < 0); |
123 |
assertTrue(CharOperation.indexOf(array, array2, false, -1) < 0); |
122 |
} |
124 |
} |
123 |
public static Class testClass() { |
125 |
//test new API org.eclipse.jdt.core.compiler.CharOperation.prefixEquals(char[], char[], boolean, int) |
124 |
return CharOperationTest.class; |
126 |
public void test010() { |
|
|
127 |
char[] name = new char[] { 'a' , 'b', 'c', 'a', 'a' }; |
128 |
char[] prefix = new char[] { 'c', 'a', 'a' }; |
129 |
assertTrue(CharOperation.prefixEquals(prefix, name, false, 2)); |
130 |
prefix = new char[] { 'c', 'a', 'a', 'a' }; |
131 |
assertFalse(CharOperation.prefixEquals(prefix, name, false, 2)); |
132 |
prefix = new char[] { 'c', 'a', 'A' }; |
133 |
assertFalse(CharOperation.prefixEquals(prefix, name, true, 2)); |
134 |
prefix = new char[] { 'b', 'c' }; |
135 |
assertFalse(CharOperation.prefixEquals(prefix, name, false, 2)); |
136 |
assertTrue(CharOperation.prefixEquals(prefix, name, false, 1)); |
125 |
} |
137 |
} |
126 |
} |
138 |
} |