Skip to content

Commit

Permalink
typo: fix invalide syntax in test codes (#5446)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanggggg committed Oct 19, 2022
1 parent d643963 commit e946f56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Expand Up @@ -171,7 +171,7 @@ class CognitiveComplexitySpec {
fun `does not increment on just a condition`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) = !cond
fun test(cond: Boolean) = !cond
""".trimIndent()
)

Expand All @@ -185,7 +185,7 @@ class CognitiveComplexitySpec {
fun `adds one for just a &&`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) = !cond && !cond
fun test(cond: Boolean) = !cond && !cond
""".trimIndent()
)

Expand All @@ -196,7 +196,7 @@ class CognitiveComplexitySpec {
fun `adds only one for repeated &&`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) = !cond && !cond && !cond
fun test(cond: Boolean) = !cond && !cond && !cond
""".trimIndent()
)

Expand All @@ -207,7 +207,7 @@ class CognitiveComplexitySpec {
fun `adds one per logical alternate operator`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) = !cond && !cond || cond
fun test(cond: Boolean) = !cond && !cond || cond
""".trimIndent()
)

Expand All @@ -218,7 +218,7 @@ class CognitiveComplexitySpec {
fun `adds one per logical alternate operator with like operators in between`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) {
fun test(cond: Boolean) {
if ( // +1
!cond
&& !cond && !cond // +1
Expand All @@ -236,7 +236,7 @@ class CognitiveComplexitySpec {
fun `adds one for negated but similar operators`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) {
fun test(cond: Boolean) {
if ( // +1
!cond
&& !(cond && cond) // +2
Expand All @@ -252,7 +252,7 @@ class CognitiveComplexitySpec {
fun `adds only one for a negated chain of similar operators`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) {
fun test(cond: Boolean) {
if ( // +1
!cond
&& !(cond && cond && cond) // +2
Expand All @@ -268,7 +268,7 @@ class CognitiveComplexitySpec {
fun `adds one for every negated similar operator chain`() {
val code = compileContentForTest(
"""
fun test(cond_ Boolean) {
fun test(cond: Boolean) {
if ( // +1
!cond
&& !(cond && cond && cond) // +2
Expand Down
Expand Up @@ -47,7 +47,7 @@ class CyclomaticComplexitySpec {
fun `counts while, continue and break`() {
val code = compileContentForTest(
"""
fun test(i_ Int) {
fun test(i: Int) {
var j = i
while(true) { // 1
if (j == 5) { // 1
Expand Down

0 comments on commit e946f56

Please sign in to comment.