diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-07 15:31:00 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-07 20:29:14 +0100 |
commit | f7716ac1a87649cad96242f2d5bf0a987d7f430c (patch) | |
tree | b4b84951ef468fd644c42e9e0fee535d879f0387 /tests/cpp.scm | |
parent | Cleanup in (hnh util path). (diff) | |
download | calp-f7716ac1a87649cad96242f2d5bf0a987d7f430c.tar.gz calp-f7716ac1a87649cad96242f2d5bf0a987d7f430c.tar.xz |
Add new tests.
Diffstat (limited to '')
-rw-r--r-- | tests/cpp.scm | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/tests/cpp.scm b/tests/cpp.scm deleted file mode 100644 index 84bd4b92..00000000 --- a/tests/cpp.scm +++ /dev/null @@ -1,43 +0,0 @@ -;;; Commentary: -;; Tests my parser for a subset of the C programming language. -;;; Code: - -(((c lex) lex) - ((c parse) parse-lexeme-tree)) - -(define run (compose parse-lexeme-tree lex)) - -(test-equal - '(+ (post-increment (dereference C)) 3) - (run "(*C)++ + 3")) - - -(test-equal - '(+ (post-increment (dereference C)) 3) - (run "*C++ + 3")) - -(test-equal - '(post-increment (dereference C)) - (run "*C++")) - -(test-equal - '(+ (post-increment C) (post-increment C)) - (run "C++ + C++")) - -(test-equal - '(+ (pre-increment C) (pre-increment C)) - (run "++C + ++C")) - - -(test-equal - '(+ 2 (* 2 2)) - (run "2 + 2 * 2")) - -(test-equal - '(+ (* 2 2) 2) - (run "2 * 2 + 2")) - -(test-equal - '(+ 2 2 2) - (run "2+2+2")) - |