mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Test renamed
This commit is contained in:
+27
-6
@@ -1,41 +1,62 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.psi;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import com.intellij.psi.codeStyle.NameUtil;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.intellij.psi.codeStyle.NameUtil;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* @author dsl
|
||||
* @author dsl
|
||||
*/
|
||||
public class PsiNameHelperTest extends TestCase {
|
||||
public class NameUtilTest {
|
||||
@Test
|
||||
public void testSplitIntoWords1() throws Exception {
|
||||
assertSplitEquals(new String[]{"I", "Base"}, "IBase");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitIntoWords2() throws Exception {
|
||||
assertSplitEquals(new String[]{"Order", "Index"}, "OrderIndex");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitIntoWords3() throws Exception {
|
||||
assertSplitEquals(new String[]{"order", "Index"}, "orderIndex");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitIntoWords4() throws Exception {
|
||||
assertSplitEquals(new String[]{"Order", "Index"}, "Order_Index");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSplitIntoWords5() throws Exception {
|
||||
assertSplitEquals(new String[]{"ORDER", "INDEX"}, "ORDER_INDEX");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSplitIntoWords6() throws Exception {
|
||||
assertSplitEquals(new String[]{"gg", "J"}, "ggJ");
|
||||
}
|
||||
|
||||
private void assertSplitEquals(String[] expected, String name) {
|
||||
private static void assertSplitEquals(String[] expected, String name) {
|
||||
final String[] result = NameUtil.splitNameIntoWords(name);
|
||||
assertEquals(Arrays.asList(expected).toString(), Arrays.asList(result).toString());
|
||||
}
|
||||
Reference in New Issue
Block a user