diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:26:40 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-10-02 19:28:44 +0200 |
commit | 712654d4c023a2ab13190c6905d313e0ba897965 (patch) | |
tree | b8505b420d6621022fa6a46271340071d8881322 /tests/test/cpp.scm | |
parent | Made displayln into a library export. (diff) | |
download | calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.gz calp-712654d4c023a2ab13190c6905d313e0ba897965.tar.xz |
Rewrite test running system.
Diffstat (limited to 'tests/test/cpp.scm')
-rw-r--r-- | tests/test/cpp.scm | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/test/cpp.scm b/tests/test/cpp.scm deleted file mode 100644 index 9c720fde..00000000 --- a/tests/test/cpp.scm +++ /dev/null @@ -1,39 +0,0 @@ -;;; Commentary: -;; Tests my parser for a subset of the C programming language. -;;; Code: - -(define-module (test cpp) - :use-module (srfi srfi-64) - :use-module (srfi srfi-88) - :use-module ((c lex) :select (lex)) - :use-module ((c parse) :select (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")) - - |