Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcg committed Nov 7, 2018
1 parent e3a0ed4 commit 365a817
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions core/src/main/kotlin/com/oneeyedmen/minutest/Test.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package com.oneeyedmen.minutest
*/
interface Test<F> : Named, (F) -> F

fun <F> Test<F>.withAction(action: (F)->F): Test<F> =
object : Test<F>, (F)->F by action, Named by this {}
fun <F> Test<F>.withAction(action: (F) -> F): Test<F> =
object : Test<F>, (F) -> F by action, Named by this {}

typealias TestTransform<F> = (Test<F>) -> Test<F>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package com.oneeyedmen.minutest.internal
import com.oneeyedmen.minutest.Named
import com.oneeyedmen.minutest.Test

interface ParentContext<F> : Named {
internal interface ParentContext<F> : Named {
fun runTest(test: Test<F>)
}

internal object RootContext : ParentContext<Unit> {
override val name = ""
override val parent: Nothing? = null
override fun runTest(test: Test<Unit>) = test(Unit)
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
package com.oneeyedmen.minutest.internal

import com.oneeyedmen.minutest.Context
import com.oneeyedmen.minutest.Test
import com.oneeyedmen.minutest.TestDescriptor
import kotlin.reflect.KClass
import kotlin.reflect.KClassifier
import kotlin.reflect.KType
import kotlin.reflect.KTypeProjection

internal object RootContext : ParentContext<Unit> {
override val name = ""
override val parent: Nothing? = null
override fun runTest(test: Test<Unit>) = test(Unit)
}

fun <F> topLevelContext(
name: String,
type: KType,
Expand Down

0 comments on commit 365a817

Please sign in to comment.