Skip to content

Commit

Permalink
style: disable ktlint_standard_class-signature only on kotlin tests…
Browse files Browse the repository at this point in the history
…, as per @paul-dingemans' suggestion in pinterest/ktlint#2902
  • Loading branch information
DanySK committed Dec 18, 2024
1 parent 613f86c commit 05f7763
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 35 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[*.{kt,kts}]
indent_size=4
max_line_length = 120
insert_final_newline = true

[**/*{t,T}est/kotlin/**.kt]
ktlint_standard_class-signature = disabled
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import it.unibo.alchemist.model.Position
import it.unibo.alchemist.test.AlchemistTesting.loadAlchemist
import it.unibo.alchemist.test.AlchemistTesting.runInCurrentThread

class TestRemoveNode<T, P : Position<P>> :
StringSpec({
"Nodes can be removed in a continous 2D space" {
val simulation = loadAlchemist<T, P>("remove.yml")
val simulationRun = simulation.runInCurrentThread()
require(simulationRun.error.isEmpty) {
throw simulationRun.error.get()
}
class TestRemoveNode<T, P : Position<P>> : StringSpec({
"Nodes can be removed in a continous 2D space" {
val simulation = loadAlchemist<T, P>("remove.yml")
val simulationRun = simulation.runInCurrentThread()
require(simulationRun.error.isEmpty) {
throw simulationRun.error.get()
}
})
}
})
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,26 @@ import it.unibo.alchemist.boundary.LoadAlchemist
import it.unibo.alchemist.boundary.launchers.DefaultLauncher
import org.kaikikm.threadresloader.ResourceLoader

class RegressionTestOnRealCases :
FreeSpec(
{
"convoluted variable loading should work" {
val loader = LoadAlchemist.from(ResourceLoader.getResource("synthetic/convoluted_variables.yml"))
loader.getDefault<Nothing, Nothing>() shouldNotBe null
loader.variables should haveSize(3)
loader.variables.keys shouldContain "algorithm"
loader.variables
.getValue("algorithm")
.stream()
.count()
.toInt() shouldBeExactly 4 * 7 + 1
}
"the default loader should be configurable with two parameters" {
val loader = LoadAlchemist.from(ResourceLoader.getResource("synthetic/launcherWithoutAutostart.yml"))
loader.getDefault<Nothing, Nothing>() shouldNotBe null
loader.launcher should beOfType<DefaultLauncher>()
(loader.launcher as DefaultLauncher).autoStart shouldBe false
}
"it should be possible to run a parallel batch" {
val loader = LoadAlchemist.from(ResourceLoader.getResource("synthetic/batch-boostrap.yml"))
loader.launch()
}
},
)
class RegressionTestOnRealCases : FreeSpec({
"convoluted variable loading should work" {
val loader = LoadAlchemist.from(ResourceLoader.getResource("synthetic/convoluted_variables.yml"))
loader.getDefault<Nothing, Nothing>() shouldNotBe null
loader.variables should haveSize(3)
loader.variables.keys shouldContain "algorithm"
loader.variables
.getValue("algorithm")
.stream()
.count()
.toInt() shouldBeExactly 4 * 7 + 1
}
"the default loader should be configurable with two parameters" {
val loader = LoadAlchemist.from(ResourceLoader.getResource("synthetic/launcherWithoutAutostart.yml"))
loader.getDefault<Nothing, Nothing>() shouldNotBe null
loader.launcher should beOfType<DefaultLauncher>()
(loader.launcher as DefaultLauncher).autoStart shouldBe false
}
"it should be possible to run a parallel batch" {
val loader = LoadAlchemist.from(ResourceLoader.getResource("synthetic/batch-boostrap.yml"))
loader.launch()
}
})

0 comments on commit 05f7763

Please sign in to comment.