Skip to content

Commit

Permalink
Add test for else syntax.
Browse files Browse the repository at this point in the history
  • Loading branch information
CabalCrow committed May 23, 2024
1 parent 9561846 commit 9c55ae6
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions test/corpus/ctrl/else.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=====
else-001-block
=====

if true {} else {}

-----

(nu_script
(pipeline
(pipe_element
(ctrl_if
condition: (val_bool)
then_branch: (block)
else_block: (block)))))

=====
else-002-command
=====

if true {} else ls

-----

(nu_script
(pipeline
(pipe_element
(ctrl_if
condition: (val_bool)
then_branch: (block)
else_block: (command
head: (cmd_identifier))))))

=====
else-003-command
=====

if true {} else ^ls

-----

(nu_script
(pipeline
(pipe_element
(ctrl_if
condition: (val_bool)
then_branch: (block)
else_block: (command
head: (cmd_identifier))))))

=====
else-004-command
=====

if true {} else ^'ls'

-----

(nu_script
(pipeline
(pipe_element
(ctrl_if
condition: (val_bool)
then_branch: (block)
else_block: (command
head: (cmd_identifier))))))

=====
else-005-command
=====

if true {} else ^('ls')

-----

(nu_script
(pipeline
(pipe_element
(ctrl_if
condition: (val_bool)
then_branch: (block)
else_block: (command
head: (cmd_identifier))))))

=====
else-006-expression
=====

if true {} else $expression

-----

(nu_script
(pipeline
(pipe_element
(ctrl_if
condition: (val_bool)
then_branch: (block)
else_block: (val_variable
name: (identifier))))))

0 comments on commit 9c55ae6

Please sign in to comment.