From eeccf193ff6313abedede827f3096b84428762eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 11 Jul 2022 22:47:58 +0200 Subject: Remove linear update environment procedures. --- tests/test/cpp/cpp-environment.scm | 6 ++---- tests/test/cpp/preprocessor2.scm | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'tests/test/cpp') diff --git a/tests/test/cpp/cpp-environment.scm b/tests/test/cpp/cpp-environment.scm index df4736fb..1b24676f 100644 --- a/tests/test/cpp/cpp-environment.scm +++ b/tests/test/cpp/cpp-environment.scm @@ -28,7 +28,7 @@ (let ((e (make-environment))) - (let ((e* (add-identifier! + (let ((e* (add-identifier e "key" (object-like-macro identifier: "key" @@ -36,9 +36,7 @@ (let ((result (get-identifier e* "key"))) (test-assert (macro? result)) (test-equal (lex "value") - (macro-body result)))) - ;; (get-identifier e "key") here is undefined - ) + (macro-body result))))) (let ((e (make-environment))) (let ((result (get-identifier e "key"))) diff --git a/tests/test/cpp/preprocessor2.scm b/tests/test/cpp/preprocessor2.scm index 4f0918ff..01c46dff 100644 --- a/tests/test/cpp/preprocessor2.scm +++ b/tests/test/cpp/preprocessor2.scm @@ -738,6 +738,22 @@ wf(x, y) "))) +(test-equal "Usage before #define" + (lex "X") + (run "X + +#define X 100")) + +(test-equal "#undef" + (append (lex "X") (lex "10") (lex "X")) + (run " +X +#define X 10 +X +#undef X +X +") + ) ;; #undef ;; #error -- cgit v1.2.3