-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved project coverage and minor code fixes (#36)
* branch coverage is now at 90% for all project * invalid `expression` was returning `true` instead of `failing` (`onFailure` is used when evaluating invalid expressions) * `Kotlin` evaluator was not considering unprotected string `"null"` as `null` value, `"\"null\""` is still considered as `string` with value `null`
- Loading branch information
Showing
18 changed files
with
276 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
core/src/main/kotlin/com/rapatao/projects/ruleset/engine/types/errors/UnknownOperator.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,7 @@ | ||
import kotlinx.kover.gradle.plugin.dsl.MetricType | ||
|
||
dependencies { | ||
api project(":core") | ||
api("org.graalvm.polyglot:polyglot:24.0.2") | ||
api("org.graalvm.polyglot:js-community:24.0.2") | ||
|
||
testImplementation project(":tests") | ||
} | ||
|
||
koverReport { | ||
verify { | ||
rule { | ||
enabled = true | ||
bound { | ||
enabled = true | ||
metric = MetricType.BRANCH | ||
minValue = 80 | ||
} | ||
bound { | ||
enabled = true | ||
metric = MetricType.LINE | ||
minValue = 90 | ||
} | ||
bound { | ||
enabled = true | ||
metric = MetricType.INSTRUCTION | ||
minValue = 90 | ||
} | ||
} | ||
} | ||
|
||
defaults { | ||
html { | ||
onCheck = true | ||
} | ||
} | ||
} |
9 changes: 8 additions & 1 deletion
9
...test/kotlin/com/rapatao/projects/ruleset/engine/evaluator/graaljs/GraalJSEvaluatorTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
package com.rapatao.projects.ruleset.engine.evaluator.graaljs | ||
|
||
import com.rapatao.projects.ruleset.engine.BaseEvaluatorTest | ||
import com.rapatao.projects.ruleset.engine.helper.ExposeEngineTestOperator | ||
|
||
class GraalJSEvaluatorTest : BaseEvaluatorTest(GraalJSEvaluator()) | ||
class GraalJSEvaluatorTest : BaseEvaluatorTest( | ||
GraalJSEvaluator( | ||
operators = listOf( | ||
ExposeEngineTestOperator(), | ||
), | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,5 @@ | ||
import kotlinx.kover.gradle.plugin.dsl.MetricType | ||
|
||
dependencies { | ||
api project(":core") | ||
|
||
testImplementation project(":tests") | ||
} | ||
|
||
koverReport { | ||
verify { | ||
rule { | ||
enabled = true | ||
bound { | ||
enabled = true | ||
metric = MetricType.BRANCH | ||
minValue = 70 | ||
} | ||
bound { | ||
enabled = true | ||
metric = MetricType.LINE | ||
minValue = 90 | ||
} | ||
bound { | ||
enabled = true | ||
metric = MetricType.INSTRUCTION | ||
minValue = 90 | ||
} | ||
} | ||
} | ||
|
||
defaults { | ||
html { | ||
onCheck = true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 8 additions & 1 deletion
9
...c/test/kotlin/com/rapatao/projects/ruleset/engine/evaluator/kotlin/KotlinEvaluatorTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
package com.rapatao.projects.ruleset.engine.evaluator.kotlin | ||
|
||
import com.rapatao.projects.ruleset.engine.BaseEvaluatorTest | ||
import com.rapatao.projects.ruleset.engine.helper.ExposeEngineTestOperator | ||
|
||
class KotlinEvaluatorTest : BaseEvaluatorTest(KotlinEvaluator()) | ||
class KotlinEvaluatorTest : BaseEvaluatorTest( | ||
KotlinEvaluator( | ||
operators = listOf( | ||
ExposeEngineTestOperator(), | ||
), | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,6 @@ | ||
import kotlinx.kover.gradle.plugin.dsl.MetricType | ||
|
||
dependencies { | ||
api project(":core") | ||
api("org.mozilla:rhino:${rhinoVersion}") | ||
|
||
testImplementation project(":tests") | ||
} | ||
|
||
koverReport { | ||
verify { | ||
rule { | ||
enabled = true | ||
bound { | ||
enabled = true | ||
metric = MetricType.BRANCH | ||
minValue = 80 | ||
} | ||
bound { | ||
enabled = true | ||
metric = MetricType.LINE | ||
minValue = 90 | ||
} | ||
bound { | ||
enabled = true | ||
metric = MetricType.INSTRUCTION | ||
minValue = 90 | ||
} | ||
} | ||
} | ||
|
||
defaults { | ||
html { | ||
onCheck = true | ||
} | ||
} | ||
} |
9 changes: 8 additions & 1 deletion
9
...src/test/kotlin/com/rapatao/projects/ruleset/engine/evaluator/rhino/RhinoEvaluatorTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
package com.rapatao.projects.ruleset.engine.evaluator.rhino | ||
|
||
import com.rapatao.projects.ruleset.engine.BaseEvaluatorTest | ||
import com.rapatao.projects.ruleset.engine.helper.ExposeEngineTestOperator | ||
|
||
class RhinoEvaluatorTest : BaseEvaluatorTest(RhinoEvaluator()) | ||
class RhinoEvaluatorTest : BaseEvaluatorTest( | ||
RhinoEvaluator( | ||
operators = listOf( | ||
ExposeEngineTestOperator(), | ||
), | ||
), | ||
) |
Oops, something went wrong.