From 1d5cace9db9aef76f26b2d7ba54bbb76443b00b2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 20:33:23 +0200 Subject: Adding upstream version 5.0. Signed-off-by: Daniel Baumann --- tests/comsub1.sub | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tests/comsub1.sub (limited to 'tests/comsub1.sub') diff --git a/tests/comsub1.sub b/tests/comsub1.sub new file mode 100644 index 0000000..b1af263 --- /dev/null +++ b/tests/comsub1.sub @@ -0,0 +1,60 @@ +: $(echo \;) + +: $(case a in a) echo ;;# comment +esac) + +: $(case a in a) echo ;; # comment +esac) + +: $(: \;# not a comment ) + +: $(: \ # not a comment) + +echo $(case a in a) echo \#esac ;; +esac) + +: $(case a in a) : ;#esac ;; +esac) + +: $(case a in a) : ;#esac comment ) +esac) + +: $(case a in a) : ; +esac) + +echo $(#comment ) +echo a) + +echo $(case a in (a) echo ok 1;; # comment +esac) + +echo $(case a in (a) echo ok 2;; # comment +(b) echo moo;; +esac) + +echo $(case a in (a) echo ok 3 # comment +;; +esac) + +echo $(case a in a) echo ok 4;; # comment +esac) + +echo $(case a in a) echo ok 5;; # comment +b) echo moo;; +esac) + +echo $(case a in (a) echo ok 6 # comment +;; +esac) + +echo $( # we just took and pasted in some +# code from another script inside a +# command substitution +echo xyz +) + +# problem with parse_comsub through bash-4.4 +case $(echo $$'x\nx') in +x*) echo bad 7;; +*) echo ok 7;; +esac -- cgit v1.2.3