diff --git a/tests/test_parse.py b/tests/test_parse.py index 1e8f0a2..9518eea 100644 --- a/tests/test_parse.py +++ b/tests/test_parse.py @@ -3,6 +3,15 @@ from src import parse +# Test with no data at all +def test_parser_empty(): + tokenizer = parse.Tokenizer("", "") + tokens = tokenizer.tokenize() + assert tokens[0].type == "EOF" + assert tokens[0].location.line == 1 + assert tokens[0].location.column == 0 + assert tokens[0].location.file == "" + # General fuzz test, make sure the parser doesn't fall apart and spew # uncontrolled errors.