aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-13 01:14:35 +0900
committernsfisis <nsfisis@gmail.com>2025-08-15 10:06:21 +0900
commit15c8a2f45b3916f840665b317afb344cbc08f5a4 (patch)
tree77cfd6866c5100f836adfee8603c122aefaf21b0 /tests
parent9c12de31ab03385cea3b7bc78582ef4fdb9b22cc (diff)
downloadducc-15c8a2f45b3916f840665b317afb344cbc08f5a4.tar.gz
ducc-15c8a2f45b3916f840665b317afb344cbc08f5a4.tar.zst
ducc-15c8a2f45b3916f840665b317afb344cbc08f5a4.zip
feat: implement block-based variable scope
Diffstat (limited to 'tests')
-rw-r--r--tests/088.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/088.sh b/tests/088.sh
new file mode 100644
index 0000000..6630cf0
--- /dev/null
+++ b/tests/088.sh
@@ -0,0 +1,35 @@
+set -e
+
+cat <<'EOF' > expected
+0
+1
+2
+3
+4
+0
+1
+2
+3
+4
+43
+42
+EOF
+
+bash ../../test_diff.sh <<'EOF'
+int printf();
+
+int main() {
+ for (int i = 0; i < 5; i++) {
+ printf("%d\n", i);
+ }
+ for (int i = 0; i < 5; i++) {
+ printf("%d\n", i);
+ }
+ int x = 42;
+ {
+ int x = 43;
+ printf("%d\n", x);
+ }
+ printf("%d\n", x);
+}
+EOF