26 lines
No EOL
654 B
Kotlin
26 lines
No EOL
654 B
Kotlin
package prolog
|
|
|
|
import org.junit.jupiter.api.Assertions.assertFalse
|
|
import org.junit.jupiter.api.Assertions.assertTrue
|
|
import org.junit.jupiter.api.Test
|
|
import prolog.components.Program
|
|
import prolog.components.expressions.Fact
|
|
import prolog.components.terms.Atom
|
|
|
|
class EvaluationTest {
|
|
@Test
|
|
fun successful_single_clause_program_query() {
|
|
val fact = Fact(Atom("a"))
|
|
Program.load(listOf(fact))
|
|
|
|
assertTrue(Program.query(Atom("a")))
|
|
}
|
|
|
|
@Test
|
|
fun failing_single_clause_program_query() {
|
|
val fact = Fact(Atom("a"))
|
|
Program.load(listOf(fact))
|
|
|
|
assertFalse(Program.query(Atom("b")))
|
|
}
|
|
} |