Regenerated samples
This commit is contained in:
parent
ea45a18ae9
commit
94d5f1f2d7
|
@ -1,4 +1,4 @@
|
|||
// LambdaWithReceiver/StateMachine.kt
|
||||
// LambdaWithReceiver/LWRStateMachine.kt
|
||||
package statemachine
|
||||
import statemachine.State.*
|
||||
|
|
@ -5,6 +5,6 @@ fun newStateMachine1(
|
|||
operate: (StateMachine) -> Unit
|
||||
) {
|
||||
val stateMachine = StateMachine()
|
||||
stateMachine.start()
|
||||
stateMachine.start()
|
||||
operate(stateMachine)
|
||||
}
|
|
@ -6,7 +6,7 @@ fun newStateMachine1(
|
|||
operate: (StateMachine) -> Unit // [1]
|
||||
) {
|
||||
val stateMachine = StateMachine()
|
||||
stateMachine.start()
|
||||
stateMachine.start()
|
||||
operate(stateMachine) // [2]
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// LambdaWithReceiver/StringBuilder.kt
|
||||
package lambdawithreceiver
|
||||
import atomictest.eq
|
||||
|
||||
fun main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
type: theory
|
||||
files:
|
||||
- name: src/StateMachine.kt
|
||||
- name: src/LWRStateMachine.kt
|
||||
visible: true
|
||||
- name: src/UseNewStateMachine1.kt
|
||||
visible: true
|
||||
|
|
|
@ -6,9 +6,8 @@ import java.nio.file.Paths
|
|||
|
||||
fun dataFile(name: String): File {
|
||||
val targetDir = File("DataFiles")
|
||||
require(targetDir.exists()) {
|
||||
"$targetDir does not exist"
|
||||
}
|
||||
if(!targetDir.exists())
|
||||
targetDir.mkdir()
|
||||
return targetDir.resolve(name)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
package checkinstructions
|
||||
import atomictest.*
|
||||
|
||||
val resultFile = dataFile("results.txt")
|
||||
val resultFile = dataFile("Results.txt")
|
||||
|
||||
fun createResultFile(create: Boolean) {
|
||||
if (create)
|
||||
|
@ -19,6 +19,6 @@ fun main() {
|
|||
capture {
|
||||
createResultFile(false)
|
||||
} eq "IllegalStateException: " +
|
||||
"results.txt doesn't exist!"
|
||||
"Results.txt doesn't exist!"
|
||||
createResultFile(true)
|
||||
}
|
|
@ -3,7 +3,7 @@ package resourcecleanup
|
|||
import checkinstructions.dataFile
|
||||
|
||||
fun main() {
|
||||
dataFile("results.txt").forEachLine {
|
||||
dataFile("Results.txt").forEachLine {
|
||||
if (it.startsWith("#"))
|
||||
println("'$it'")
|
||||
}
|
||||
|
|
|
@ -2153,7 +2153,7 @@ public class TestAllExamples extends AbstractTestExamples {
|
|||
|
||||
@Test
|
||||
public void testStringBuilder() {
|
||||
testExample("../AtomicKotlinCourse/Power Tools/Lambda with Receiver/Examples/src/StringBuilder.kt", StringBuilderKt::main);
|
||||
testExample("../AtomicKotlinCourse/Power Tools/Lambda with Receiver/Examples/src/StringBuilder.kt", lambdawithreceiver.StringBuilderKt::main);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue