1
1
Fork 0

Regenerated samples

This commit is contained in:
Svetlana Isakova 2020-11-18 18:35:46 +01:00
parent 2aa7c8653a
commit ecd3426819
8 changed files with 35 additions and 6 deletions

View File

@ -1,3 +1,4 @@
## AtomicTest
Examples accompanying the atom.
Examples accompanying the atom.
[Read "AtomicTest" atom online.](https://stepik.org/lesson/440525/step/1)

View File

@ -1,3 +1,4 @@
## Java Interoperability
Examples accompanying the atom.
Examples accompanying the atom.
[Read "Java Interoperability" atom online.](https://stepik.org/lesson/440526/step/1)

View File

@ -1,4 +1,4 @@
## Higher-Order Functions
Examples accompanying the atom.
[Read "Higher-Order Functions" atom online.](https://stepik.org/lesson/350540/step/1)
[Read "Higher-Order Functions" atom online.](https://stepik.org/lesson/107892/step/1)

View File

@ -0,0 +1,20 @@
// Interfaces/SamConversion.kt
package interfaces
import atomictest.trace
fun interface Action {
fun act()
}
fun delayAction(action: Action) {
trace("Delaying...")
action.act()
}
fun main() {
delayAction { trace("Hey!") }
trace eq """
Delaying...
Hey!
""".trimIndent()
}

View File

@ -10,3 +10,5 @@ files:
visible: true
- name: src/SAMImplementation.kt
visible: true
- name: src/SamConversion.kt
visible: true

View File

@ -1,7 +1,7 @@
## Check Instructions (#3)
This exercise further explores ranges, introduced in [Looping &
Ranges], and shows how they can be used with check
Ranges](https://stepik.org/lesson/104311/step/1), and shows how they can be used with check
instructions.
Create a class `Level` with two constructor arguments: `val range: IntRange`,

View File

@ -5,8 +5,8 @@ and passes it to the base-class constructor. Write a function `fail(msg:
String)` that passes `msg` to `trace()`, and then throws a `Failure`.
Now write your own versions of `require()` and `check()` (from [Check
Instructions]) that use `fail()`. The starter code in `main()` tests your
functions.
Instructions](https://stepik.org/lesson/350665/step/1)) that use `fail()`. The starter code in
`main()` tests your functions.
<sub> This task doesn't contain automatic tests,
so it's always marked as "Correct" when you run "Check".

View File

@ -1666,6 +1666,11 @@ public class TestAllExamples extends AbstractTestExamples {
testExample("Object-Oriented Programming/Interfaces/Examples/src/Hotness.kt", interfaces.HotnessKt::main);
}
@Test
public void testSamConversion() {
testExample("Object-Oriented Programming/Interfaces/Examples/src/SamConversion.kt", interfaces.SamConversionKt::main);
}
@Test
public void testSAMImplementation() {
testExample("Object-Oriented Programming/Interfaces/Examples/src/SAMImplementation.kt", interfaces.SAMImplementationKt::main);