Checkpoint
This commit is contained in:
parent
39c3af4ba5
commit
da21d890fb
39 changed files with 1166 additions and 48 deletions
26
tests/prolog/EvaluationTest.kt
Normal file
26
tests/prolog/EvaluationTest.kt
Normal file
|
@ -0,0 +1,26 @@
|
|||
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")))
|
||||
}
|
||||
}
|
Reference in a new issue