File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -380,3 +380,22 @@ def test_set_with_condition():
380
380
381
381
result = catch_output ('{ $x | x > 2 } >>= echo $.x' , shell = shell )
382
382
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' }
You can’t perform that action at this time.
0 commit comments