Results for ysh-for.test.sh

statusysh
pass 19
FAIL 1
total20
caseyshdescription
0pass For loop over expression: List
1FAIL For loop over expression: Dict, not BashAssoc
details
2pass For loop over range
3pass Shell for loop with index (equivalent of enumerate())
4pass 3 indices with (mylist) is a runtime error
5pass Shell for loop can't have 3 indices
6pass Any for loop can't have 4 indices
7pass Expression for loop with index: List
8pass Expression for loop with index: Dict (TODO: define dict iter order)
9pass Dict: index key value loop (TODO: define dict iter order)
10pass Equivalent of zip()
11pass parse_bare_word eliminates confusion
12pass Object that's not iterable
13pass YSH for with brace substitution and glob
14pass for x in (io.stdin) {
15pass I/O error in for x in (stdin) {
16pass Append to List in loop extends the loop (matches JS)
17pass Remove from List in loop shortens it (matches JS)
18pass Adding to Dict in loop does NOT extend the loop (matches JS)
19pass Removing from Dict in loop does NOT change the loop (does NOT match JS)
19 passed, 0 OK, 0 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

ysh1 For loop over expression: Dict, not BashAssoc

[ysh status] Expected 3, got 1
[ysh stderr] Found 'Traceback (most recent'

stdout:
key name
key age
stderr:
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 202, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 171, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 137, in AppBundleMain
    return shell.Main('ysh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1214, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 375, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2174, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 1973, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1700, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 964, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 607, in _RunSimpleCommand
    return self._RunAssignBuiltin(cmd_val)
  File "/home/uke/oil/osh/cmd_eval.py", line 393, in _RunAssignBuiltin
    status = builtin_func.Run(cmd_val)
  File "/home/uke/oil/builtin/assign_osh.py", line 530, in Run
    self.arith_ev, arg.a, arg.A)
  File "/home/uke/oil/builtin/assign_osh.py", line 245, in _AssignVarForBuiltin
    with tagswitch(old_val) as case:
NameError: global name 'tagswitch' is not defined