From 17809b0571a038ec9eba3fc3620ba77a38c98afd Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 4 Sep 2025 21:40:06 +0900 Subject: feat: recursive macro expansion --- tests/119.sh | 2 -- tests/120.sh | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 tests/120.sh (limited to 'tests') diff --git a/tests/119.sh b/tests/119.sh index e1dcb80..be485cf 100644 --- a/tests/119.sh +++ b/tests/119.sh @@ -1,5 +1,3 @@ -#!/bin/bash - cat <<'EOF' > expected 1,0 1,1,1 diff --git a/tests/120.sh b/tests/120.sh new file mode 100644 index 0000000..b3724cd --- /dev/null +++ b/tests/120.sh @@ -0,0 +1,21 @@ +cat <<'EOF' > expected +42 +123 +EOF +test_diff <<'EOF' +int printf(const char*, ...); + +int main() { + // TODO: check if "foo" is expanded to "foo" or not once '#' operator is implemented. +#define foo foo + int foo = 42; + printf("%d\n", foo); + + // TODO: check if "a" is expanded to "a" or not once '#' operator is implemented. +#define a b +#define b c +#define c a + int a = 123; + printf("%d\n", a); +} +EOF -- cgit v1.2.3-70-g09d2