1
1
Fork 0

Regenerated samples

This commit is contained in:
Svetlana Isakova 2020-04-16 22:18:59 +02:00
parent ea45a18ae9
commit 94d5f1f2d7
9 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
// LambdaWithReceiver/StateMachine.kt
// LambdaWithReceiver/LWRStateMachine.kt
package statemachine
import statemachine.State.*

View File

@ -5,6 +5,6 @@ fun newStateMachine1(
operate: (StateMachine) -> Unit
) {
val stateMachine = StateMachine()
stateMachine.start()
stateMachine.start()
operate(stateMachine)
}

View File

@ -6,7 +6,7 @@ fun newStateMachine1(
operate: (StateMachine) -> Unit // [1]
) {
val stateMachine = StateMachine()
stateMachine.start()
stateMachine.start()
operate(stateMachine) // [2]
}

View File

@ -1,4 +1,5 @@
// LambdaWithReceiver/StringBuilder.kt
package lambdawithreceiver
import atomictest.eq
fun main() {

View File

@ -1,6 +1,6 @@
type: theory
files:
- name: src/StateMachine.kt
- name: src/LWRStateMachine.kt
visible: true
- name: src/UseNewStateMachine1.kt
visible: true

View File

@ -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)
}

View File

@ -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)
}

View File

@ -3,7 +3,7 @@ package resourcecleanup
import checkinstructions.dataFile
fun main() {
dataFile("results.txt").forEachLine {
dataFile("Results.txt").forEachLine {
if (it.startsWith("#"))
println("'$it'")
}

View File

@ -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