################## TEST 1 ##################
ciao! at line 29 == 29
hello at line 22 == 22
ERROR: test1.sh failed at line 30, rc: 1
onerror() at line 16 == 16
mytest should have failed at line 30
pippo
ERROR: test1.sh failed at line 34, rc: 1
onerror() at line 16 == 16
exit in () at line 1 == 34 with pippo but not pluto
#############################################

################## TEST 2 ##################
ciao! at line 29 == 29
hello at line 22 == 22
ERROR: test2.sh failed at line 30, rc: 1
onerror() at line 16 == 16
mytest should have failed at line 30
pippo
ERROR: test2.sh failed at line 34, rc: 1
onerror() at line 16 == 16
exit at line 1 == 34 with pippo but not pluto
#############################################

################## TEST 4 ##################
hello by mytest() at line 22 == 22
ERROR: test4.sh failed at line 30, rc: 1
onerror() at line 16 == 16
Tracing error in function starts here (set -E)
hello by mytest() at line 22 == 22
ERROR: test4.sh failed in mytest() at line 23, rc: 1
onerror() at line 16 == 16
ERROR: test4.sh failed at line 34, rc: 1
onerror() at line 16 == 16
ciao! at line 36 == 36
hello by mytest() at line 22 == 22
ERROR: test4.sh failed in mytest() at line 23, rc: 1
onerror() at line 16 == 16
exit in mytest() at line 1 == 23 without any onerror print
#############################################

################## TEST 5 ##################
funcname in script: '' == ''
ciao! at line 29 == 29
hello at line 22 == 22
ERROR: test5.sh failed at line 30, rc: 1
onerror() at line 16 == 16
mytest should have failed at line 30
pippo
ERROR: test5.sh failed at line 34, rc: 1
onerror() at line 16 == 16
this is a multi-line trap which begins at line 11 == 9
exit at line 2 == 34 with pippo but not pluto
this is a multi-line trap which ends at line 11 == 11
#############################################

################## TEST 6 ##################
ciao! at line 29 == 29
hello by mytest() at line 22 == 22
exit in mytest() at line 1 == 30 with pippo but not pluto
#############################################

################## TEST 7 ##################
ciao! at line 29 == 29
hello by mytest() at line 22 == 22
pippo
hello by mytest() at line 22 == 22
ERROR: test7.sh failed in mytest() at line 23, rc: 1
onerror() at line 16 == 16
mytest should have failed at line 30 and it will again at line 36
hello by mytest() at line 22 == 22
ERROR: test7.sh failed in mytest() at line 23, rc: 1
onerror() at line 16 == 16
exit in mytest() at line 1 == 23 with pippo but not pluto
#############################################

################## TEST 8 ##################
ciao! at line 29 == 29
hello by mytest() at line 22 == 22
pippo, exit status 0 == 0
LINENO=34
LINENO=35
tests/test8.sh: line 35: set: invalid: invalid option name
ERROR: test8.sh failed at line 35, rc: 2
onerror() at line 16 == 16
exit in () at line 1 == 35 with pippo but not pluto
#############################################

################## TEST 9 ##################
shell: bash
LINENO=0
#############################################

################## TEST A ##################
ciao! at line 29 == 29, FUNCNAME = ''
hello by mytest() at line 22 == 22
ciao! at line 31 == 31, FUNCNAME = ''
pippo
tests/testA.sh: line 33: /access-denied: Permission denied
ERROR: testA.sh failed at line 33, rc: 1
onerror() at line 16 == 16
The script should have failed at line 33 with ERROR message, exitstatus 1 != 0
hello by mytest() at line 22 == 22
ERROR: testA.sh failed in mytest() at line 23, rc: 1
onerror() at line 16 == 16
exit in mytest() at line 1 == 23 with pippo but not pluto
#############################################

################## TEST B ##################
hello by myecho() at line 27
FUNCNAME = , LINENO = 45, EXITSTATUS: 0
FUNCNAME = , LINENO = 46
hello by mytrue() at line 36
FUNCNAME = , LINENO = 47, EXITSTATUS: 0
FUNCNAME = , LINENO = 48
hello by myfalse() at line 31
FUNCNAME = , LINENO = 50
hello by myfalse() at line 31
FUNCNAME = , LINENO = 51, EXITSTATUS: 1
FUNCNAME = , LINENO = 52
hello by mytrue() at line 36
FUNCNAME = , LINENO = 53, EXITSTATUS: 0
FUNCNAME = , LINENO = 54
hello by myfalse() at line 31
ERROR: testB.sh failed in myfalse() at line 32, rc: 1
onerror() at line 16 == 16
ERROR: testB.sh failed at line 55, rc: 1
onerror() at line 16 == 16
FUNCNAME = , LINENO = 55, EXITSTATUS: 1
FUNCNAME = , LINENO = 56
hello by myexit() at line 22
exit in myexit() at line 1 == 60, EXITSTATUS: 1
#############################################

################## TEST C ##################
hello by myecho() at line 27
FUNCNAME = , LINENO = 45, EXITSTATUS: 0
FUNCNAME = , LINENO = 46
hello by mytrue() at line 36
FUNCNAME = , LINENO = 47, EXITSTATUS: 0
FUNCNAME = , LINENO = 48
hello by myfalse() at line 31
FUNCNAME = , LINENO = 50
hello by myfalse() at line 31
FUNCNAME = , LINENO = 51, EXITSTATUS: 1
FUNCNAME = , LINENO = 52
hello by mytrue() at line 36
FUNCNAME = , LINENO = 53, EXITSTATUS: 0
FUNCNAME = , LINENO = 54
hello by myfalse() at line 31
ERROR: testC.sh failed in myfalse() at line 32, rc: 1
onerror() at line 16 == 16
ERROR: testC.sh failed at line 55, rc: 1
onerror() at line 16 == 16
FUNCNAME = , LINENO = 55, EXITSTATUS: 1
FUNCNAME = , LINENO = 56
hello by myfalse() at line 31
ERROR: testC.sh failed in myfalse() at line 32, rc: 1
onerror() at line 16 == 16
exit in myfalse() at line 1 == 32, EXITSTATUS: 1
#############################################

################## TEST D ##################
trap -- ')' ERR
-----------
tests/testD.sh: error trap: line 4: syntax error near unexpected token `)'
tests/testD.sh: error trap: line 4: `)'
tests/testD.sh: error trap: line 4: syntax error near unexpected token `)'
tests/testD.sh: error trap: line 4: `)'
tests/testD.sh: error trap: line 4: syntax error near unexpected token `)'
tests/testD.sh: error trap: line 4: `)'
FUNCNAME='cmdevalfalse'
FUNCNAME=''
-----------
trap -- 'echo ERR' ERR
still running
ERR
1
still running after false
#############################################

