diff options
Diffstat (limited to 't/parse.lisp')
-rw-r--r-- | t/parse.lisp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/parse.lisp b/t/parse.lisp new file mode 100644 index 0000000..bd1310f --- /dev/null +++ b/t/parse.lisp @@ -0,0 +1,26 @@ +(in-package #:rva-tests) + +(def-suite parse-tests + :description "Test functions exported from the parser." + :in all-tests) + +(in-suite parse-tests) + +(test extract-label-is-a-label + (is (not (parse:extract-label '("LOOP" lex::colon))))) + +(test extract-label-not-a-label-one + (let ((lst '("NICE" "TRY"))) + (is (equal lst + (parse:extract-label lst))))) + +(test extract-label-not-a-label-two + (let ((lst '("LOOP" lex::colon lex::colon))) + (is (equal lst + (parse:extract-label lst))))) + +(test extract-line-invalid-type + (handler-case + (progn (parse:tokens->ast '(("foo" LEX::DOLLAR))) + (fail)) + (lex:parser-error ()))) |