Regenerated samples
This commit is contained in:
parent
2aa7c8653a
commit
ecd3426819
|
@ -1,3 +1,4 @@
|
|||
## AtomicTest
|
||||
|
||||
Examples accompanying the atom.
|
||||
Examples accompanying the atom.
|
||||
[Read "AtomicTest" atom online.](https://stepik.org/lesson/440525/step/1)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
}
|
|
@ -10,3 +10,5 @@ files:
|
|||
visible: true
|
||||
- name: src/SAMImplementation.kt
|
||||
visible: true
|
||||
- name: src/SamConversion.kt
|
||||
visible: true
|
||||
|
|
|
@ -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`,
|
||||
|
|
|
@ -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".
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue