AbstractTermificatorTest

Base class for test suites exercising a Termificator implementation, such as Termificator.default or Termificator.legacy: concrete subclasses implement createTermificator and then write @Test methods using assertTermificationWorks/assertTermificationFails to check how individual values get converted.

The companion object pre-builds one representative instance of each input shape a Termificator is expected to handle (an Array, a List, a Set, a Sequence, a Pair, a Triple, a Map and one of its Map.Entrys), plus unconvertible, a value with no registered conversion — so subclasses (and further subclasses overriding individual @Test methods, as TestDefaultTermifier does over TestLegacyTermifier) can assert on the same fixtures while differing only in the expected Term shape.

A typical concrete test looks like:

class TestLegacyTermifier : AbstractTermificatorTest() {
override fun createTermificator(scope: Scope): Termificator = Termificator.legacy(scope)

@Test
open fun testSets() {
assertTermificationWorks(set, { set.map { intOf(it) }.let(this::logicListOf) })
}
}

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun setup()