spec test index / oilshell.org
77 passed, 4 OK, 4 not implemented, 9 BUG, 1 failed, 0 timeouts, 0 cases skipped 1 failed under osh
bash | 1 set associative array to indexed array literal (very surprising bash behavior) stdout: foo spam eggs k1 k2 [] []stderr: /home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 4: assoc: foo: must use subscript when assigning associative array /home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 4: assoc: 'spam eggs': must use subscript when assigning associative array |
bash | 2 Can't initialize assoc array with indexed array stdout: status=0stderr: /home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: A: 1: must use subscript when assigning associative array /home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: A: 2: must use subscript when assigning associative array /home/andy/git/oilshell/oil/_tmp/spec-bin/bash: line 1: A: 3: must use subscript when assigning associative array |
bash | 3 Initializing indexed array with assoc array stdout: status=0 ['3']stderr: |
osh | 8 coerce to string with ${A[*]}, etc. [osh stdout] Expected "['xx yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n", got "['xx', 'yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n" stdout: ['xx', 'yy'] ['X X Y Y'] ['xx', 'yy'] ['X', 'X', 'Y', 'Y']stderr: |
osh_ALT | 8 coerce to string with ${A[*]}, etc. [osh_ALT stdout] Expected "['xx yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n", got "['xx', 'yy']\n['X X Y Y']\n['xx', 'yy']\n['X', 'X', 'Y', 'Y']\n" stdout: ['xx', 'yy'] ['X X Y Y'] ['xx', 'yy'] ['X', 'X', 'Y', 'Y']stderr: |
osh | 11 ${assoc} disallowed in OSH, like ${assoc[0]} in bash stdout: stderr: echo "${a}" ^~ [ stdin ]:3: fatal: Array 'a' can't be referred to as a scalar (without @ or *) |
osh_ALT | 11 ${assoc} disallowed in OSH, like ${assoc[0]} in bash stdout: stderr: echo "${a}" ^~ [ stdin ]:3: fatal: Array 'a' can't be referred to as a scalar (without @ or *) |
bash | 17 lookup by unquoted string doesn't work in OSH because it's a variable stdout: cstderr: |
bash | 18 bash bug: "i+1" and i+1 are the same key stdout: array[i]=6 array[i+1]=7 assoc[i]=string assoc[i+1]=string+1 assoc[i]=string assoc[i+1]=string+1stderr: |
bash | 22 Slice of associative array doesn't make sense in bash stdout: ['2', '1', '5'] ['2', '1', '5'] ['1', '5', '4'] ['5', '4', '3'] ['4', '3'] ['3']stderr: |
osh | 23 bash variable can have an associative array part and a string part stdout: stderr: echo ${assoc[1]} ${assoc[2]} ${assoc} ^~ [ stdin ]:4: fatal: Array 'assoc' can't be referred to as a scalar (without @ or *) |
osh_ALT | 23 bash variable can have an associative array part and a string part stdout: stderr: echo ${assoc[1]} ${assoc[2]} ${assoc} ^~ [ stdin ]:4: fatal: Array 'assoc' can't be referred to as a scalar (without @ or *) |
osh | 24 Associative array expressions inside (( )) with keys that look like numbers stdout: 42stderr: (( var = assoc[0] )) ^~ [ stdin ]:5: fatal: Can't evaluate associative arrays in arithmetic contexts |
osh_ALT | 24 Associative array expressions inside (( )) with keys that look like numbers stdout: 42stderr: (( var = assoc[0] )) ^~ [ stdin ]:5: fatal: Can't evaluate associative arrays in arithmetic contexts |
bash | 27 setting key to itself (from bash-bug mailing list) stdout: value1 value2stderr: |
osh | 28 readonly associative array can't be modified stdout: stderr: A['x']=1 ^~ [ stdin ]:2: fatal: Can't assign to readonly associative array |
osh_ALT | 28 readonly associative array can't be modified stdout: stderr: A['x']=1 ^~ [ stdin ]:2: fatal: Can't assign to readonly associative array |
bash | 30 bash mangles array #1 stdout: v2 v2stderr: |
bash | 31 bash mangles array and brace #2 stdout: [k2]=-a-stderr: |