Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 44722 Details for
Bug 125825
[typing] Camel case in case conversion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
tests
125825_tests.txt (text/plain), 8.01 KB, created by
Sebastian Davids
on 2006-06-17 00:53:09 EDT
(
hide
)
Description:
tests
Filename:
MIME Type:
Creator:
Sebastian Davids
Created:
2006-06-17 00:53:09 EDT
Size:
8.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench.texteditor.tests >Index: src/org/eclipse/ui/workbench/texteditor/tests/StringsTest.java >=================================================================== >RCS file: src/org/eclipse/ui/workbench/texteditor/tests/StringsTest.java >diff -N src/org/eclipse/ui/workbench/texteditor/tests/StringsTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/workbench/texteditor/tests/StringsTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,153 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * Sebastian Davids <sdavids@gmx.de> - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui.workbench.texteditor.tests; >+ >+import org.eclipse.ui.internal.texteditor.Strings; >+ >+import junit.framework.TestCase; >+ >+public class StringsTest extends TestCase { >+ >+ private static final String[][] CAPITALIZE_TESTS = new String[][] { >+ { null, null }, { "", "" }, { " ", " " }, { "\t", "\t" }, >+ { "A", "a" }, { "A", "A" }, { "SS", "§" }, { "Ab", "ab" }, >+ { "Ab", "Ab" }, { "1a", "1a" }, { "$a", "$a" }, { " A", " a" }, >+ { " A", " A" }, { " Ab", " ab" }, { " 1a", " 1a" }, >+ { " SS", " §" }, { "A ", "a " }, { "SS ", "§ " }, { "A ", "A " }, >+ { " $a", " $a" }, { "\tA", "\ta" }, { "A\t", "a\t" }, >+ { "\t1ab", "\t1ab" }, { " A\tBa SSd", " a\tba §d" } }; >+ >+ private static final String[][] CONSTANT_CASE_TESTS = new String[][] { >+ { null, null }, { "", "" }, { " ", " " }, { "\t", "\t" }, >+ { "A", "a" }, { "A", "A" }, { "SS", "§" }, { "AB", "ab" }, >+ { "AB", "Ab" }, { "1A", "1a" }, { "$A", "$a" }, { "A_B", "aB" }, >+ { "_AB", "_ab" }, { "_A_B", "_aB" }, { "ABC", "abc" }, >+ { "A_BC", "aBc" }, { "A_B_C", "aBC" }, >+ { "TO_CONSTANT_CASE", "toConstantCase" }, >+ { "NO_LEADING_UNDERSCORE", "NoLeadingUnderscore" }, >+ { "__SOME_EXTRA___UNDERSCORES_", "__someExtra__Underscores_" } }; >+ >+ private static final String[][] INVERT_TESTS = new String[][] { >+ { null, null }, { "", "" }, { " ", " " }, { "\t", "\t" }, >+ { "&abc1", "&ABC1" }, { "a", "A" }, { "B", "b" }, { "aa", "AA" }, >+ { "BB", "bb" }, { "aB", "Ab" }, { "Ab", "aB" }, { "aBa", "AbA" }, >+ { "AbA", "aBa" }, { "aaB", "AAb" }, { "AAb", "aaB" }, >+ { "aBB", "Abb" }, { "Abb", "aBB" }, { "Masse", "mASSE" }, >+ { "mASSE", "Ma§e" }, { "&SS \t\";a4", "&§\t\";A4" } }; >+ >+ private static final String[][] LOWER_CAMEL_TESTS = { { null, null, }, >+ { "", "" }, { " ", " " }, { "\t", "\t" }, { "a", "a" }, >+ { "a", "A" }, { "1", "1" }, { "", "" }, { "", "" }, >+ { "&", "&" }, { "ab", "ab" }, { "ab", "aB" }, { "ab", "Ab" }, >+ { "ab", "AB" }, { "_", "_" }, { "__", "__" }, { "___", "___" }, >+ { "a_", "a_" }, { "a__", "a__" }, { "a___", "a___" }, >+ { "a_", "A_" }, { "a__", "A__" }, { "a___", "A___" }, >+ { "ab_", "ab_" }, { "ab__", "ab__" }, { "ab___", "ab___" }, >+ { "ab_", "Ab_" }, { "ab__", "Ab__" }, { "ab___", "Ab___" }, >+ { "ab_", "aB_" }, { "ab__", "aB__" }, { "ab___", "aB___" }, >+ { "ab_", "AB_" }, { "ab__", "AB__" }, { "ab___", "AB___" }, >+ { "a", "_a" }, { "_A", "__a" }, { "__A", "___a" }, { "a", "_A" }, >+ { "_A", "__A" }, { "__A", "___A" }, { "_Ab", "__ab" }, >+ { "__Ab", "___ab" }, { "ab", "_Ab" }, { "_Ab", "__Ab" }, >+ { "__Ab", "___Ab" }, { "ab", "_aB" }, { "_Ab", "__aB" }, >+ { "__Ab", "___aB" }, { "ab", "_AB" }, { "_Ab", "__AB" }, >+ { "__Ab", "___AB" }, { "aA", "a_a" }, { "aA", "a_A" }, >+ { "aA", "A_a" }, { "aA", "A_A" }, { "a_A", "a__a" }, >+ { "a_A", "a__A" }, { "a_A", "A__a" }, { "a_A", "A__A" }, >+ { "a__A", "a___a" }, { "a__A", "a___A" }, { "a__A", "A___a" }, >+ { "a__A", "A___A" }, { "abA", "ab_a" }, { "abA", "ab_A" }, >+ { "abA", "Ab_a" }, { "abA", "Ab_A" }, { "abA", "aB_a" }, >+ { "abA", "aB_A" }, { "abA", "AB_a" }, { "abA", "AB_A" }, >+ { "aAb", "a_ab" }, { "aAb", "a_Ab" }, { "aAb", "A_ab" }, >+ { "aAb", "A_Ab" }, { "aAb", "a_aB" }, { "aAb", "a_AB" }, >+ { "aAb", "A_aB" }, { "aAb", "A_AB" }, { "aAA", "a_a_a" }, >+ { "aAA", "a_A_A" }, { "aAA", "A_a_a" }, { "aAA", "A_A_A" }, >+ { "aAbA", "a_ab_a" }, { "aAbA", "a_Ab_a" }, { "aAbA", "a_aB_a" }, >+ { "aAbA", "a_AB_a" }, { "aAAb", "a_a_ab" }, { "aAAb", "a_a_Ab" }, >+ { "aAAb", "a_a_aB" }, { "aAAb", "a_a_AB" }, >+ { "iAmOneLongTest", "I_AM_ONE_LONG_TEST" }, >+ { "iAmOneLongTest", "i_am_one_long_test" }, >+ { "toLowerCamelCase", "TO_LOWER_CAMEL_CASE" }, >+ { "leading", "_Leading" }, >+ { "_Someextra_Underscores_", "__someExtra__underscores_" } }; >+ >+ private static final String[][] UPPER_CAMEL_TESTS = { { null, null, }, >+ { "", "" }, { " ", " " }, { "\t", "\t" }, { "A", "a" }, >+ { "A", "A" }, { "1", "1" }, { "", "" }, { "", "" }, >+ { "&", "&" }, { "Ab", "ab" }, { "Ab", "aB" }, { "Ab", "Ab" }, >+ { "Ab", "AB" }, { "_", "_" }, { "__", "__" }, { "___", "___" }, >+ { "A_", "a_" }, { "A__", "a__" }, { "A___", "a___" }, >+ { "A_", "A_" }, { "A__", "A__" }, { "A___", "A___" }, >+ { "Ab_", "ab_" }, { "Ab__", "ab__" }, { "Ab___", "ab___" }, >+ { "Ab_", "Ab_" }, { "Ab__", "Ab__" }, { "Ab___", "Ab___" }, >+ { "Ab_", "aB_" }, { "Ab__", "aB__" }, { "Ab___", "aB___" }, >+ { "Ab_", "AB_" }, { "Ab__", "AB__" }, { "Ab___", "AB___" }, >+ { "A", "_a" }, { "_A", "__a" }, { "__A", "___a" }, { "A", "_A" }, >+ { "_A", "__A" }, { "__A", "___A" }, { "_Ab", "__ab" }, >+ { "__Ab", "___ab" }, { "Ab", "_Ab" }, { "_Ab", "__Ab" }, >+ { "__Ab", "___Ab" }, { "Ab", "_aB" }, { "_Ab", "__aB" }, >+ { "__Ab", "___aB" }, { "Ab", "_AB" }, { "_Ab", "__AB" }, >+ { "__Ab", "___AB" }, { "AA", "a_a" }, { "AA", "a_A" }, >+ { "AA", "A_a" }, { "AA", "A_A" }, { "A_A", "a__a" }, >+ { "A_A", "a__A" }, { "A_A", "A__a" }, { "A_A", "A__A" }, >+ { "A__A", "a___a" }, { "A__A", "a___A" }, { "A__A", "A___a" }, >+ { "A__A", "A___A" }, { "AbA", "ab_a" }, { "AbA", "ab_A" }, >+ { "AbA", "Ab_a" }, { "AbA", "Ab_A" }, { "AbA", "aB_a" }, >+ { "AbA", "aB_A" }, { "AbA", "AB_a" }, { "AbA", "AB_A" }, >+ { "AAb", "a_ab" }, { "AAb", "a_Ab" }, { "AAb", "A_ab" }, >+ { "AAb", "A_Ab" }, { "AAb", "a_aB" }, { "AAb", "a_AB" }, >+ { "AAb", "A_aB" }, { "AAb", "A_AB" }, { "AAA", "a_a_a" }, >+ { "AAA", "a_A_A" }, { "AAA", "A_a_a" }, { "AAA", "A_A_A" }, >+ { "AAbA", "a_ab_a" }, { "AAbA", "a_Ab_a" }, { "AAbA", "a_aB_a" }, >+ { "AAbA", "a_AB_a" }, { "AAAb", "a_a_ab" }, { "AAAb", "a_a_Ab" }, >+ { "AAAb", "a_a_aB" }, { "AAAb", "a_a_AB" }, >+ { "IAmOneLongTest", "I_AM_ONE_LONG_TEST" }, >+ { "IAmOneLongTest", "i_am_one_long_test" }, >+ { "ToUpperCamelCase", "TO_UPPER_CAMEL_CASE" }, >+ { "Leading", "_leading" }, >+ { "_Someextra_Underscores_", "__someExtra__underscores_" } }; >+ >+ public void testCapitalize() { >+ for (int i = 0; i < CAPITALIZE_TESTS.length; i++) >+ assertEquals(String.valueOf(i), CAPITALIZE_TESTS[i][0], Strings >+ .capitalize(CAPITALIZE_TESTS[i][1])); >+ } >+ >+ public void testConstantCase() { >+ for (int i = 0; i < CONSTANT_CASE_TESTS.length; i++) >+ assertEquals(String.valueOf(i), CONSTANT_CASE_TESTS[i][0], Strings >+ .constantCase(CONSTANT_CASE_TESTS[i][1])); >+ } >+ >+ public void testInvertCase() { >+ for (int i = 0; i < INVERT_TESTS.length; i++) >+ assertEquals(String.valueOf(i), INVERT_TESTS[i][0], Strings >+ .invertCase(INVERT_TESTS[i][1])); >+ } >+ >+ public void testLowerCamelCase() { >+ for (int i = 0; i < LOWER_CAMEL_TESTS.length; i++) { >+ String expected = LOWER_CAMEL_TESTS[i][0]; >+ CharSequence value = Strings >+ .lowerCamelCase(LOWER_CAMEL_TESTS[i][1]); >+ assertEquals(Integer.toString(i), expected, value); >+ } >+ } >+ >+ public void testUpperCamelCase() { >+ for (int i = 0; i < UPPER_CAMEL_TESTS.length; i++) { >+ String expected = UPPER_CAMEL_TESTS[i][0]; >+ CharSequence value = Strings >+ .upperCamelCase(UPPER_CAMEL_TESTS[i][1]); >+ assertEquals(Integer.toString(i), expected, value); >+ } >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 125825
:
44721
|
44722