Skip to content

Commit 761a694

Browse files
committed
update test
1 parent 7451104 commit 761a694

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/shell/test_shell.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,22 @@ def test_set_with_condition():
380380

381381
result = catch_output('{ $x | x > 2 } >>= echo $.x', shell=shell)
382382
assert result.splitlines() == ['3', '4']
383+
384+
def test_set_multivariate():
385+
shell = Shell()
386+
shell.ignore_invalid_syntax = False
387+
388+
run_command('x <- range 3', shell=shell)
389+
run_command('y <- range 10 13', shell=shell)
390+
run_command('z <- { $x $y }', shell=shell)
391+
assert len(shell.env['z']) == 9
392+
assert shell.env['z'][0] == {'x': '0', 'y': '10'}
393+
394+
result = catch_output('{ $x $y } >>= echo $.y', shell=shell)
395+
assert result.splitlines()[0] == '10'
396+
assert result.splitlines()[2] == '12'
397+
398+
run_command('z <- { $x $y | x < 2 }', shell=shell)
399+
assert len(shell.env['z']) == 6
400+
assert shell.env['z'][0] == {'x': '0', 'y': '10'}
401+
assert shell.env['z'][4] == {'x': '1', 'y': '11'}

0 commit comments

Comments
 (0)