summaryrefslogtreecommitdiff
path: root/t/parse.lisp
blob: bd1310f3633e2f6e0b31f541777035db631a646a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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 ())))