Checkpoint
This commit is contained in:
parent
5bfa1691dd
commit
a85169dced
27 changed files with 377 additions and 250 deletions
|
@ -2,13 +2,13 @@ package parser.builtins
|
|||
|
||||
import com.github.h0tk3y.betterParse.grammar.Grammar
|
||||
import com.github.h0tk3y.betterParse.grammar.parseToEnd
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.BeforeEach
|
||||
import org.junit.jupiter.api.Test
|
||||
import parser.grammars.TermsGrammar
|
||||
import prolog.ast.terms.Atom
|
||||
import prolog.ast.terms.Structure
|
||||
import prolog.ast.terms.Term
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class DatabaseOperatorsParserTests {
|
||||
private lateinit var parser: Grammar<Term>
|
||||
|
@ -62,4 +62,14 @@ class DatabaseOperatorsParserTests {
|
|||
|
||||
assertEquals(expected, result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `parse dynamic declaration`() {
|
||||
val input = "dynamic declaration/1"
|
||||
val expected = Structure(Atom("dynamic"), listOf(Atom("declaration/1")))
|
||||
|
||||
val result = parser.parseToEnd(input)
|
||||
|
||||
assertEquals(expected, result)
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue