redirection parsing: parse redirections for cmdgroup

This commit is contained in:
Khaïs COLIN 2025-03-19 16:26:45 +01:00
parent c258fa6077
commit 448458b37f
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 129 additions and 2 deletions

23
test.sh
View file

@ -102,4 +102,27 @@ expecting <<EOF
╰─ (no redirections)
EOF
when_run <<EOF "redirections are parsed"
echo hello < in hi > out
EOF
expecting <<EOF
╰─ t_cmdgroup
├─ t_cmdlist
│ ├─ num_cmds = 1
│ ╰─ cmd[0]
│ ├─ t_cmdlist_item
│ │ ╰─ t_pipeline
│ │ ├─ num_cmd = 1
│ │ ╰─ cmd[0]
│ │ ╰─ t_simple_cmd
│ │ ├─ words = [echo][hello][hi]
│ │ ╰─ t_redir_list
│ │ ├─ redirection[0]
│ │ │ ╰─ t_redirection
│ │ ╰─ redirection[1]
│ │ ╰─ t_redirection
│ ╰─ t_operator = END
╰─ (no redirections)
EOF
finalize