Skip to content
Snippets Groups Projects
Select Git revision
  • 111c1d109ebb9089ba5dc446de80319d82580e88
  • main default
  • feature/cleanup-for-registry protected
  • kinetic
  • 0.3.7
  • 0.3.6
  • 0.3.5
  • 0.3.4
  • 0.3.3
  • 0.3.2
  • 0.2.2
  • 0.3.1
  • 0.3.0
  • 0.2.1
  • 0.1.6
  • 0.1.5
  • 0.2.0
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.0.1
  • 0.0.0
23 results

BUILD

Blame
  • OrTests.kt 639 B
    package jackrat
    
    import de.timklge.jackrat.AtomParser
    import de.timklge.jackrat.OrParser
    import jackrat.de.timklge.jackrat.Scanner
    import kotlin.test.Test
    import kotlin.test.assertEquals
    
    class OrTests {
        @Test
        fun TestOr() {
            val input = "World"
            val scanner = Scanner(input)
            val helloParser = AtomParser("Hello", true)
            val worldParser = AtomParser("World", true)
            val helloOrWorldParser = OrParser(listOf(helloParser, worldParser))
            val node = helloOrWorldParser.parse(scanner)
            assertEquals(node.parser, helloOrWorldParser)
            assertEquals(1, node.children.count())
        }
    }