Skip to content

Commit 73b594a

Browse files
committed
repackaging (answers)
1 parent a941d51 commit 73b594a

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

src/main/kotlin/dsl/StateFlow.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/main/kotlin/dsl/Event.kt renamed to src/main/kotlin/dsl/answers/Event.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dsl
1+
package dsl.answers
22

33
data class Event(val raw: String) {
44

src/main/kotlin/dsl/Fsm.kt renamed to src/main/kotlin/dsl/answers/Fsm.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dsl
1+
package dsl.answers
22

33
data class Fsm(
44
val transitions: Map<Event, StateFlow>,
@@ -13,7 +13,8 @@ data class Fsm(
1313
}
1414
}
1515

16-
fun returnToInitialState(): Fsm = Fsm(transitions, initial, initial)
16+
fun returnToInitialState(): Fsm =
17+
Fsm(transitions, initial, initial)
1718

1819
fun fire(event: String): Fsm {
1920
return getTransitionFor(event)

src/main/kotlin/dsl/FsmSpec.kt renamed to src/main/kotlin/dsl/answers/FsmSpec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dsl
1+
package dsl.answers
22

33
class FsmSpec(
44
private val transitions: MutableList<Transition> = mutableListOf(),

src/main/kotlin/dsl/State.kt renamed to src/main/kotlin/dsl/answers/State.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dsl
1+
package dsl.answers
22

33
data class State(val raw: String) {
44

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package dsl.answers
2+
3+
import dsl.answers.State
4+
5+
data class StateFlow(val from: State, val into: State) {
6+
7+
constructor(from: String, into: String): this(
8+
State(from),
9+
State(into)
10+
)
11+
12+
override fun toString(): String = "$from->$into"
13+
}

src/main/kotlin/dsl/Transition.kt renamed to src/main/kotlin/dsl/answers/Transition.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dsl
1+
package dsl.answers
22

33
data class Transition(val event: Event, val stateFlow: StateFlow) {
44

src/main/kotlin/dsl/TransitionSpec.kt renamed to src/main/kotlin/dsl/answers/TransitionSpec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package dsl
1+
package dsl.answers
22

33
class TransitionSpec(
44
private var event: String = "",

src/test/groovy/answers/FsmTest.groovy renamed to src/test/groovy/dsl/answers/FsmTest.groovy

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
package answers
1+
package dsl.answers
22

3-
import dsl.Fsm
4-
import dsl.State
5-
import dsl.StateFlow
63
import spock.lang.Specification
74

85
class FsmTest extends Specification {

src/test/kotlin/answers/FsmTestExample.kt renamed to src/test/kotlin/dsl/answers/FsmTestExample.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
package answers
1+
package dsl.answers
22

3-
import dsl.Fsm
4-
import dsl.FsmSpec
5-
import dsl.State
63
import io.kotest.core.spec.style.BehaviorSpec
74
import io.kotest.matchers.maps.haveSize
85
import io.kotest.matchers.shouldBe

0 commit comments

Comments
 (0)