Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(true, false, null, null);
var opts = new Options(true, false, "", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -186,7 +186,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(false, true, null, null);
var opts = new Options(false, true, "", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -272,7 +272,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(true, true, null, null);
var opts = new Options(true, true, "", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -358,7 +358,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(false, false, null, null);
var opts = new Options(false, false, "", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -444,7 +444,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(true, false, "-_", null);
var opts = new Options(true, false, "-_", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -561,7 +561,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(false, true, "-_", null);
var opts = new Options(false, true, "-_", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -678,82 +678,82 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(true, true, "-_", null);
var opts = new Options(true, true, "-_", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}

@Test
void convertSnakeCase() {
var opts = new Options(true, true, "_", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions("abc_def_ghi", opts);
assertThat(result).isEqualTo("abcDefGhi");

opts = new Options(true, true, "-", null);
result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
result = camelCaseWithOptions("abc_def_ghi", opts);
assertThat(result).isEqualTo("abc_Def_Ghi");
}

@Test
void convertKebabCase() {
var opts = new Options(true, true, "-", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions("abc-def-ghi", opts);
assertThat(result).isEqualTo("abcDefGhi");

opts = new Options(true, true, "_", null);
result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
result = camelCaseWithOptions("abc-def-ghi", opts);
assertThat(result).isEqualTo("abc-Def-Ghi");
}

@Test
void convertTrainCase() {
var opts = new Options(true, true, "-", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions("Abc-Def-Ghi", opts);
assertThat(result).isEqualTo("abcDefGhi");

opts = new Options(true, true, "_", null);
result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
result = camelCaseWithOptions("Abc-Def-Ghi", opts);
assertThat(result).isEqualTo("abc-Def-Ghi");
}

@Test
void convertMacroCase() {
var opts = new Options(true, true, "_", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions("ABC_DEF_GHI", opts);
assertThat(result).isEqualTo("abcDefGhi");

opts = new Options(true, true, "-", null);
result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
result = camelCaseWithOptions("ABC_DEF_GHI", opts);
assertThat(result).isEqualTo("abc_Def_Ghi");
}

@Test
void convertCobolCase() {
var opts = new Options(true, true, "-", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions("ABC-DEF-GHI", opts);
assertThat(result).isEqualTo("abcDefGhi");

opts = new Options(true, true, "_", null);
result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
result = camelCaseWithOptions("ABC-DEF-GHI", opts);
assertThat(result).isEqualTo("abc-Def-Ghi");
}

@Test
void convertWithKeepingDigits() {
var opts = new Options(true, true, "-", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions("abc123-456defG89HIJklMN12", opts);
assertThat(result).isEqualTo("abc123456DefG89HiJklMn12");

opts = new Options(true, true, "_", null);
result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
result = camelCaseWithOptions("abc123-456defG89HIJklMN12", opts);
assertThat(result).isEqualTo("abc123-456DefG89HiJklMn12");
}

@Test
void convertWithSymbolsAsSeparators() {
var opts = new Options(true, true, ":@$&()/", null);
var result = camelCaseWithOptions("", opts);
assertThat(result).isEqualTo("");
var result = camelCaseWithOptions(":.abc~!@def#$ghi%&jk(lm)no/?", opts);
assertThat(result).isEqualTo(".Abc~!Def#Ghi%JkLmNo?");
}

@Test
Expand Down Expand Up @@ -795,7 +795,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(false, false, "-_", null);
var opts = new Options(false, false, "-_", "");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -912,7 +912,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(true, false, null, "-_");
var opts = new Options(true, false, "", "-_");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -1022,7 +1022,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(false, true, null, "-_");
var opts = new Options(false, true, "", "-_");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -1132,7 +1132,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(true, true, null, "-_");
var opts = new Options(true, true, "", "-_");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down Expand Up @@ -1242,7 +1242,7 @@ void convertCamelCase() {

@Test
void convertPascalCase() {
var opts = new Options(false, false, null, "-_");
var opts = new Options(false, false, "", "-_");
var result = camelCaseWithOptions("AbcDefGHIjk", opts);
assertThat(result).isEqualTo("abcDefGhIjk");
}
Expand Down