Skip to content

Commit

Permalink
test: add regression test for detecting error in Constructor overloading
Browse files Browse the repository at this point in the history
  • Loading branch information
anitvam authored and DanySK committed Nov 11, 2024
1 parent 0b1b30b commit 9ab596c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package it.unibo.alchemist.test

import another.location.MyTestEnv
import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.nulls.beNull
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNot
import io.kotest.matchers.types.instanceOf
import it.unibo.alchemist.test.AlchemistTesting.loadAlchemistFromResource

class TestConstructorOverloading : StringSpec({
"constructor overloading should not be ambiguous during loading" {
val loader = loadAlchemistFromResource("regression/2024-depots-ambiguous-constructors.yml")
loader shouldNot beNull()
loader.getDefault<Nothing, Nothing>().environment shouldBe instanceOf(MyTestEnv::class)
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
incarnation: protelis

deployments:
agent1:
type: Point
parameters: [-7, -6]
programs:
- time-distribution: 3
type: Event
actions:
- type: EuclideanConfigurableMoveNode
parameters:
routing-strategy:
type: StraightLine
target-selection-strategy:
type: GoTo
parameters: [7, 6]
speed: 0.005

0 comments on commit 9ab596c

Please sign in to comment.