Skip to content
Merged
Show file tree
Hide file tree
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 @@ -126,9 +126,9 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" 2nd return statement: return a;\n"

val methodName1 = "testCompareChars_NLessThan1"
val methodName2 = "testCompareChars_0OfCharactertoCharsiEqualsA" // TODO: a weird unclear naming
val methodName3 = "testCompareChars_0OfCharactertoCharsiEqualsB"
val methodName4 = "testCompareChars_0OfCharactertoCharsiNotEqualsB" // TODO: si -> is
val methodName2 = "testCompareChars_0OfCharacterToCharsIEqualsA" // TODO: a weird unclear naming
val methodName3 = "testCompareChars_0OfCharacterToCharsIEqualsB"
val methodName4 = "testCompareChars_0OfCharacterToCharsINotEqualsB"

val displayName1 = "n < 1 : True -> return ' '"
val displayName2 = "Character.toChars(i)[0] == a : True -> return b"
Expand Down Expand Up @@ -196,9 +196,9 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
" returns from: return a;"

val methodName1 = "testInnerVoidCompareChars_NLessThan1"
val methodName2 = "testInnerVoidCompareChars_0OfCharactertoCharsiEqualsA" // TODO: a weird unclear naming
val methodName3 = "testInnerVoidCompareChars_0OfCharactertoCharsiNotEqualsB"
val methodName4 = "testInnerVoidCompareChars_0OfCharactertoCharsiEqualsB" // TODO: si -> is
val methodName2 = "testInnerVoidCompareChars_0OfCharacterToCharsIEqualsA" // TODO: a weird unclear naming
val methodName3 = "testInnerVoidCompareChars_0OfCharacterToCharsINotEqualsB"
val methodName4 = "testInnerVoidCompareChars_0OfCharacterToCharsIEqualsB"

val displayName1 = "n < 1 : True -> return ' '"
val displayName2 = "Character.toChars(i)[0] == a : True -> return b"
Expand Down Expand Up @@ -270,9 +270,9 @@ class SummaryReturnExampleTest : SummaryTestCaseGeneratorTest(
"Test afterwards returns from: return compareChars(a, b, n);\n"

val methodName1 = "testInnerReturnCompareChars_NLessThan1"
val methodName2 = "testInnerReturnCompareChars_0OfCharactertoCharsiEqualsA" // TODO: a weird unclear naming
val methodName3 = "testInnerReturnCompareChars_0OfCharactertoCharsiNotEqualsB"
val methodName4 = "testInnerReturnCompareChars_0OfCharactertoCharsiEqualsB" // TODO: si -> is
val methodName2 = "testInnerReturnCompareChars_0OfCharacterToCharsIEqualsA" // TODO: a weird unclear naming
val methodName3 = "testInnerReturnCompareChars_0OfCharacterToCharsINotEqualsB"
val methodName4 = "testInnerReturnCompareChars_0OfCharacterToCharsIEqualsB"

val displayName1 = "n < 1 : True -> return ' '"
val displayName2 = "Character.toChars(i)[0] == a : True -> return b"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,13 @@ class NodeConvertor {
}

/**
* Filters out all of the symbols that cannot be used in a function name and capitalizes String
* Capitalizes method name.
*
* It splits the text by delimiters, capitalizes each part, removes special characters and concatenates result.
*/
private fun postProcessName(name: String) = name.filter { isLegitSymbolForFunctionName(it) }.capitalize()
private fun postProcessName(name: String) =
name.split(".", "(", ")", ",")
.joinToString("") { it -> it.capitalize().filter { isLegitSymbolForFunctionName(it) } }

/**
* Converts Javaparser BinaryOperator and all of its children into a String
Expand Down