Results for var-op-len.test.sh

statusoshosh-cpp
pass 85
FAIL 14
total99
caseoshosh-cppdescription
0pass pass String length
1pass pass Unicode string length (UTF-8)
2pass FAIL Unicode string length (spec/testdata/utf8-chars.txt)
details
3pass FAIL String length with incomplete utf-8
details
4pass FAIL String length with invalid utf-8 continuation bytes
details
5pass pass Length of undefined variable
6pass pass Length of undefined variable with nounset
7pass pass Length operator can't be followed by test operator
8FAIL FAIL ${#s} respects LC_ALL - length in bytes or code points
detailsdetails
13 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

osh-cpp2 Unicode string length (spec/testdata/utf8-chars.txt)

[osh-cpp stdout] Expected '7\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  v=$(cat $REPO_ROOT/spec/testdata/utf8-chars.txt)
                                                 ^
[ stdin ]:1: Invalid word while parsing command list
osh-cpp3 String length with incomplete utf-8

[osh-cpp stdout] Expected '0\n1\n2\n-1\n3\n4\n-1\n-1\n5\n6\n-1\n-1\n-1\n7\n[ stdin ]:3: warning: UTF-8 decode: Truncated bytes at offset 2 in string of 3 bytes\n[ stdin ]:3: warning: UTF-8 decode: Truncated bytes at offset 5 in string of 6 bytes\n[ stdin ]:3: warning: UTF-8 decode: Truncated bytes at offset 5 in string of 7 bytes\n[ stdin ]:3: warning: UTF-8 decode: Truncated bytes at offset 9 in string of 10 bytes\n[ stdin ]:3: warning: UTF-8 decode: Truncated bytes at offset 9 in string of 11 bytes\n[ stdin ]:3: warning: UTF-8 decode: Truncated bytes at offset 9 in string of 12 bytes\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
    s=$(head -c $num_bytes $REPO_ROOT/spec/testdata/utf8-chars.txt)
                                                                  ^
[ stdin ]:2: Invalid word while parsing command list
osh-cpp4 String length with invalid utf-8 continuation bytes

[osh-cpp stdout] Expected '-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n-1\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 0 in string of 1 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 1 in string of 2 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 2 in string of 3 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 2 in string of 4 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 4 in string of 5 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 5 in string of 6 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 5 in string of 7 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 5 in string of 8 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 8 in string of 9 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 9 in string of 10 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 9 in string of 11 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 9 in string of 12 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 9 in string of 13 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 13 in string of 14 bytes\n[ stdin ]:3: warning: UTF-8 decode: Bad encoding at offset 13 in string of 14 bytes\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
    s=$(head -c $num_bytes $REPO_ROOT/spec/testdata/utf8-chars.txt)$(echo -e "\xFF")
                                                                  ^
[ stdin ]:2: Invalid word while parsing command list
osh8 ${#s} respects LC_ALL - length in bytes or code points

[osh stdout] Expected 'len=1\nlen=2\n\nlen=1\nlen=4\n\n' Got 'len=1\nlen=1\n\nlen=1\nlen=1\n\n'

stdout:
len=1
len=1

len=1
len=1

stderr:
osh-cpp8 ${#s} respects LC_ALL - length in bytes or code points

[osh-cpp stdout] Expected 'len=1\nlen=2\n\nlen=1\nlen=4\n\n' Got 'len=1\nlen=1\n\nlen=1\nlen=1\n\n'

stdout:
len=1
len=1

len=1
len=1

stderr: