ninja: no work to do. /// /// Cases in Files /// ===== CASE: FILE test/parse-errors/01-bad-func.sh ===== foo (,) ^ test/parse-errors/01-bad-func.sh:15: Syntax error in expression (near Id.Arith_Comma) ===== CASE: FILE test/parse-errors/02-bad-func.sh ===== foo() ^ test/parse-errors/02-bad-func.sh:3: Unexpected word while parsing compound command (Id.Eof_Real) ===== CASE: FILE test/parse-errors/05-unterminated-single.sh ===== A B echo 'C ^ test/parse-errors/05-unterminated-single.sh:5: Unexpected EOF in single-quoted string that began here ===== CASE: FILE test/parse-errors/06-unterminated-double-long.sh ===== A B echo 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 " ^ test/parse-errors/06-unterminated-double-long.sh:9: Unexpected EOF reading double-quoted string that began here ===== CASE: FILE test/parse-errors/06-unterminated-double.sh ===== A B echo "0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789 ^ test/parse-errors/06-unterminated-double.sh:6: Unexpected EOF reading double-quoted string that began here ===== CASE: FILE test/parse-errors/07-unterminated-here-doc-2.sh ===== cat << "$@" ^ test/parse-errors/07-unterminated-here-doc-2.sh:2: Invalid here doc delimiter ===== CASE: FILE test/parse-errors/07-unterminated-here-doc.sh ===== cat < init:(arith_expr.BinaryAssign op_id:Arith_Equal left: right:(w ) ) cond:(arith_expr.Binary op: left: right:(w ) ) update:(arith_expr.UnaryAssign op_id:Node_PostDPlus child: ) body:(command.DoGroup left: children:[ (command.Sentence child:(C (w ) (w ($ x))) terminator: ) ] right: ) ) ===== CASE: -n -c for ((; x<5; x++)); do echo $x; done ===== (command.ForExpr keyword: init:(arith_expr.EmptyZero) cond:(arith_expr.Binary op: left: right:(w ) ) update:(arith_expr.UnaryAssign op_id:Node_PostDPlus child: ) body:(command.DoGroup left: children:[ (command.Sentence child:(C (w ) (w ($ x))) terminator: ) ] right: ) ) ===== CASE: -n -c for ((; ; x++)); do echo $x; done ===== (command.ForExpr keyword: init:(arith_expr.EmptyZero) cond:...0x3ffffffc update:(arith_expr.UnaryAssign op_id:Node_PostDPlus child: ) body:(command.DoGroup left: children:[ (command.Sentence child:(C (w ) (w ($ x))) terminator: ) ] right: ) ) ===== CASE: -n -c for ((; ;)); do echo $x; done ===== (command.ForExpr keyword: init:(arith_expr.EmptyZero) cond:...0x3ffffffc update:...0x3ffffffc body:(command.DoGroup left: children:[ (command.Sentence child:(C (w ) (w ($ x))) terminator: ) ] right: ) ) ===== CASE: -n -c for ((x=0; x<5; x++ b)); do echo $x; done ===== for ((x=0; x<5; x++ b)); do echo $x; done ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Word_Compound != Id.Arith_RParen) ===== CASE: -n -c for ((x=0 b; x<5; x++)); do echo $x; done ===== for ((x=0 b; x<5; x++)); do echo $x; done ^ [ -c flag ]:1: Expected ; here ===== CASE: -n -c for ((x=0; x<5 b; x++)); do echo $x; done ===== for ((x=0; x<5 b; x++)); do echo $x; done ^ [ -c flag ]:1: Expected ; here ===== CASE: -n -c ${a:1+2 b} ===== ${a:1+2 b} ^ [ -c flag ]:1: Expected : or } in slice ===== CASE: -n -c ${a:1+2:3+4 b} ===== ${a:1+2:3+4 b} ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Word_Compound != Id.Arith_RBrace) ===== CASE: -n -c ${a[1+2 b]} ===== ${a[1+2 b]} ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Word_Compound != Id.Arith_RBracket) OK test-arith-integration *** Running test-arith-sub ===== CASE: -n -c echo $(( )) ===== (C (w ) (w (word_part.ArithSub left: anode:(arith_expr.EmptyZero) right: ) ) ) ===== CASE: -n -c echo $(()) ===== (C (w ) (w (word_part.ArithSub left: anode:(arith_expr.EmptyZero) right: ) ) ) ===== CASE: -n -c echo $(()x ===== echo $(()x ^ [ -c flag ]:1: Expected second ) to end arith sub ===== CASE: -n -c echo $(() ===== echo $(() ^ [ -c flag ]:1: Expected second ) to end arith sub ===== CASE: -n -c echo $(( 1 + 2 ; ===== echo $(( 1 + 2 ; ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Arith_Semi != Id.Arith_RParen) ===== CASE: -n -c echo $(( 1 + 2 ); ===== echo $(( 1 + 2 ); ^ [ -c flag ]:1: Expected second ) to end arith sub ===== CASE: -n -c echo $(( ===== echo $(( ^ [ -c flag ]:1: Unexpected end of input ===== CASE: -n -c echo $(( 1 ===== echo $(( 1 ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Eof_Real != Id.Arith_RParen) OK test-arith-sub *** Running test-array-literal ===== CASE: -n -c a=(1 & 2) ===== a=(1 & 2) ^ [ -c flag ]:1: Unexpected token in array literal ===== CASE: -n -c a= (1 2) ===== a= (1 2) ^ [ -c flag ]:1: Expected ( after = ===== CASE: -n -c a=(1 2 ===== a=(1 2 ^ [ -c flag ]:1: Unexpected token in array literal ===== CASE: -n -c a=(1 ${2@} ) ===== a=(1 ${2@} ) ^ [ -c flag ]:1: Unexpected token in ${} (VOp3) OK test-array-literal *** Running test-bool-expr ===== CASE: -n -c [[ a b ]] ===== [[ a b ]] ^ [ -c flag ]:1: Expected ]] ===== CASE: -n -c [[ a "a"$(echo hi)"b" ]] ===== [[ a "a"$(echo hi)"b" ]] ^ [ -c flag ]:1: Invalid word while parsing command list ===== CASE: -n -c [[ a == ]] ===== [[ a == ]] ^ [ -c flag ]:1: Expected ]] ===== CASE: -n -c [[ ( 1 == 2 - ]] ===== [[ ( 1 == 2 - ]] ^ [ -c flag ]:1: Expected ), got word.Compound ===== CASE: -n -c [[ ) ]] ===== [[ ) ]] ^ [ -c flag ]:1: Unexpected token in boolean expression (Id.Op_RParen) ===== CASE: -n -c [[ ( ]] ===== [[ ( ]] ^ [ -c flag ]:1: Expected ), got word.Operator ===== CASE: -n -c [[ ;;; ]] ===== [[ ;;; ]] ^~ [ -c flag ]:1: Unexpected token in boolean expression (Id.Op_DSemi) ===== CASE: -n -c [[ ===== [[ ^ [ -c flag ]:1: Expected ]] ===== CASE: -n -c [[ ( a == b foo${var} ]] ===== [[ ( a == b foo${var} ]] ^~~ [ -c flag ]:1: Expected ), got word.Compound OK test-bool-expr *** Running test-braced-var-sub ===== CASE: -n -c echo ${x*} ===== echo ${x*} ^ [ -c flag ]:1: Unexpected token in ${} (VOp3) ===== CASE: -n -c echo ${x@} ===== echo ${x@} ^ [ -c flag ]:1: Unexpected token in ${} (VOp3) ===== CASE: -n -c echo ${x.} ===== echo ${x.} ^ [ -c flag ]:1: Expected } to close ${ OK test-braced-var-sub *** Running test-case --- test-case YES case $x in foo) echo esac ===== CASE: -n -c case $x in foo) echo esac ===== (command.Case case_kw: to_match:(case_arg.Word w:(w ($ x))) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[(C (w ))] ) ] arms_end: ) bash=0 --- test-case YES case $x in foo) echo ;; esac ===== CASE: -n -c case $x in foo) echo ;; esac ===== (command.Case case_kw: to_match:(case_arg.Word w:(w ($ x))) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[(C (w ))] right: ) ] arms_end: ) bash=0 --- test-case YES case $x in foo) echo ;& esac ===== CASE: -n -c case $x in foo) echo ;& esac ===== (command.Case case_kw: to_match:(case_arg.Word w:(w ($ x))) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[(C (w ))] right: ) ] arms_end: ) bash=0 --- test-case YES case $x in foo) echo ;;& esac ===== CASE: -n -c case $x in foo) echo ;;& esac ===== (command.Case case_kw: to_match:(case_arg.Word w:(w ($ x))) arms_start: arms:[ (CaseArm left: pattern:(pat.Words words:[(w )]) middle: action:[(C (w ))] right: ) ] arms_end: ) bash=0 --- test-case NO ;& ===== CASE: -n -c ;& ===== ;& ^~ [ -c flag ]:1: Invalid word while parsing command bash: -c: line 1: syntax error near unexpected token `;&' bash: -c: line 1: `;&' bash=2 --- test-case NO echo ;& ===== CASE: -n -c echo ;& ===== echo ;& ^~ [ -c flag ]:1: Invalid word while parsing command line (Id.Op_SemiAmp) bash: -c: line 1: syntax error near unexpected token `;&' bash: -c: line 1: `echo ;&' bash=2 --- test-case NO echo ;;& ===== CASE: -n -c echo ;;& ===== echo ;;& ^~~ [ -c flag ]:1: Invalid word while parsing command line (Id.Op_DSemiAmp) bash: -c: line 1: syntax error near unexpected token `;;&' bash: -c: line 1: `echo ;;&' bash=2 OK test-case *** Running test-cmd-parse ===== CASE: -n -c FOO=1 break ===== FOO=1 break ^~~~ [ -c flag ]:1: Control flow shouldn't have environment bindings ===== CASE: -n -c break 1 2 ===== break 1 2 ^ [ -c flag ]:1: Unexpected argument to 'break' ===== CASE: -n -c x"y"() { echo hi; } ===== x"y"() { echo hi; } ^ [ -c flag ]:1: Invalid function name ===== CASE: -n -c function x"y" { echo hi; } ===== function x"y" { echo hi; } ^ [ -c flag ]:1: Invalid KSH-style function name ===== CASE: -n -c } ===== } ^ [ -c flag ]:1: Unexpected right brace ===== CASE: -n -c case foo in *) echo ===== case foo in *) echo ^ [ -c flag ]:1: Expected ;; or esac ===== CASE: -n -c case foo in x|) echo ===== case foo in x|) echo ^ [ -c flag ]:1: Expected case pattern ===== CASE: -n -c ls foo| ===== ls foo| ^ [ -c flag ]:1: Unexpected EOF while parsing command ===== CASE: -n -c ls foo&& ===== ls foo&& ^ [ -c flag ]:1: Unexpected EOF while parsing command ===== CASE: -n -c foo() ===== foo() ^ [ -c flag ]:1: Unexpected word while parsing compound command (Id.Eof_Real) ===== CASE: -n -c break >out ===== (command.ControlFlow keyword:) ===== CASE: -n -c break >out ===== break >out ^~~~~ [ -c flag ]:1: Control flow shouldn't have redirects ===== CASE: -n -c [ ( x ] ===== [ ( x ] ^ [ -c flag ]:1: Syntax error in expression (near Id.Op_RBracket) OK test-cmd-parse *** Running test-command-sub ===== CASE: -n -c echo line 2 echo $( echo ===== echo $( echo ^ [ -c flag ]:3: Invalid word while parsing command list ===== CASE: -n -c echo line 2 echo ` echo ===== echo ` echo ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: -n -c echo line 2 echo ` echo \` ===== echo ` echo \` ^ [ -c flag ]:3: Unexpected EOF while looking for closing backtick ===== CASE: -n -c echo line 2 echo ` echo \`unclosed ` ===== echo ` echo \`unclosed ` ^ [ backticks in [ -c flag ] ]:3: Unexpected EOF while looking for closing backtick ===== CASE: -n -c echo `for x in` ===== echo `for x in` ^ [ backticks in [ -c flag ] ]:1: Invalid word in for loop OK test-command-sub *** Running test-dparen ===== CASE: -n -c (()) ===== (command.DParen left: child:(arith_expr.EmptyZero) right: ) ===== CASE: -n -c (( )) ===== (command.DParen left: child:(arith_expr.EmptyZero) right: ) ===== CASE: -n -c (( ) ===== (( ) ^ [ -c flag ]:1: Invalid word while parsing command ===== CASE: -n -c (( )x ===== (( )x ^ [ -c flag ]:1: Invalid word while parsing command ===== CASE: -n -c $(echo $(( 1 + 2 ))) ===== $(echo $(( 1 + 2 ))) ^ [ -c flag ]:1: Invalid word while parsing command list test/parse-errors.sh: fatal: Should parse with _bin/cxx-asan/osh: expected status 0, got 2 FAIL test-dparen