feat(lexer): Scan empty string
This commit is contained in:
parent
4054ed5fce
commit
f72501fde2
5 changed files with 45 additions and 0 deletions
16
tests/lexer/LexerScanTest.kt
Normal file
16
tests/lexer/LexerScanTest.kt
Normal file
|
@ -0,0 +1,16 @@
|
|||
package be.ugent.logprog.lexer
|
||||
|
||||
import lexer.Lexer
|
||||
import lexer.TokenType
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class LexerScanTest {
|
||||
@Test
|
||||
fun scan_emptyString_returnsEOF() {
|
||||
val lexer = Lexer()
|
||||
val tokens = lexer.scan("")
|
||||
assertEquals(1, tokens.size)
|
||||
assertEquals(TokenType.EOF, tokens[0].type)
|
||||
}
|
||||
}
|
Reference in a new issue