[1/4] cxx asan '' cpp/frontend_pyreadline.cc _build/obj/cxx-asan/cpp/frontend_pyreadline.o [2/4] cxx asan '' cpp/core.cc _build/obj/cxx-asan/cpp/core.o [3/4] LINK cxx asan _bin/cxx-asan/oils-for-unix _build/obj/cxx-asan/_gen/bin/oils_for_unix.mycpp.o _build/obj/cxx-asan/_gen/bin/text_files.o _build/obj/cxx-asan/_gen/core/runtime.asdl.o _build/obj/cxx-asan/_gen/core/value.asdl.o _build/obj/cxx-asan/_gen/cpp/build_stamp.o _build/obj/cxx-asan/cpp/core.o _build/obj/cxx-asan/cpp/data_lang.o _build/obj/cxx-asan/cpp/fanos.o _build/obj/cxx-asan/cpp/fanos_shared.o _build/obj/cxx-asan/cpp/frontend_flag_spec.o _build/obj/cxx-asan/cpp/frontend_match.o _build/obj/cxx-asan/cpp/frontend_pyreadline.o _build/obj/cxx-asan/cpp/libc.o _build/obj/cxx-asan/cpp/osh.o _build/obj/cxx-asan/cpp/osh_tdop.o _build/obj/cxx-asan/cpp/pgen2.o _build/obj/cxx-asan/cpp/pylib.o _build/obj/cxx-asan/cpp/stdlib.o _build/obj/cxx-asan/_gen/data_lang/nil8.asdl.o _build/obj/cxx-asan/_gen/data_lang/pretty.asdl.o _build/obj/cxx-asan/_gen/frontend/arg_types.o _build/obj/cxx-asan/_gen/frontend/consts.o _build/obj/cxx-asan/_gen/frontend/help_meta.o _build/obj/cxx-asan/_gen/frontend/id_kind.asdl.o _build/obj/cxx-asan/_gen/frontend/signal.o _build/obj/cxx-asan/_gen/frontend/syntax.asdl.o _build/obj/cxx-asan/mycpp/bump_leak_heap.o _build/obj/cxx-asan/mycpp/gc_builtins.o _build/obj/cxx-asan/mycpp/gc_mops.o _build/obj/cxx-asan/mycpp/gc_mylib.o _build/obj/cxx-asan/mycpp/gc_str.o _build/obj/cxx-asan/mycpp/hash.o _build/obj/cxx-asan/mycpp/mark_sweep_heap.o _build/obj/cxx-asan/_gen/osh/arith_parse.o _build/obj/cxx-asan/_gen/ysh/grammar_tables.o [4/4] SYMLINK _bin/cxx-asan oils-for-unix osh 'osh' -> 'oils-for-unix' /// /// 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 ===== 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 <out ===== (command.ControlFlow keyword: (Token id: Id.ControlFlow_Break col: 0 length: 5 span_id: 0 line: (SourceLine line_num:1 content:"break >out" src:(source.CFlag)) tval: break ) ) ===== 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-eval_parse_error ===== CASE: -c x="echo )" eval $x ===== echo ) ^ [ eval word at line 3 of [ -c flag ] ]:1: Invalid word while parsing command line OK test-eval_parse_error *** Running test-extra-newlines ===== CASE: -n -c for do done ===== for ^ [ -c flag ]:2: Expected loop variable (a constant word) ===== CASE: -n -c case in esac ===== case ^ [ -c flag ]:2: Expected a word to match against ===== CASE: -n -c while do done ===== do ^~ [ -c flag ]:3: Expected a condition ===== CASE: -n -c if then fi ===== then ^~~~ [ -c flag ]:3: Expected a condition ===== CASE: -n -c if true then elif then fi ===== then ^~~~ [ -c flag ]:5: Expected a condition ===== CASE: -n -c case | in esac ===== case | ^ [ -c flag ]:2: Expected a word to match against ===== CASE: -n -c case ; in esac ===== case ; ^ [ -c flag ]:2: Expected a word to match against ===== CASE: -n -c if true then fi ===== (command.If if_kw: (Token id: Id.KW_If col: 2 length: 2 span_id: 2 line: (SourceLine line_num:2 content:" if\n" src:(source.CFlag)) tval: if ) arms: [ (IfArm keyword: ...0x13f6 cond: (condition.Shell commands: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 5 line: (SourceLine line_num:3 content:" true\n" src:...0x3ffffffc) tval: "true" ) more_env: [] words: [(CompoundWord parts:[...0x13da])] redirects: [] do_fork: T ) ] ) then_kw: (Token id: Id.KW_Then col: 2 length: 4 span_id: 8 line: (SourceLine line_num:4 content:" then\n" src:...0x3ffffffc) tval: then ) action: [] spids: [2 8] ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi col: 2 length: 2 span_id: 11 line: (SourceLine line_num:5 content:" fi\n" src:...0x3ffffffc) tval: fi ) redirects: [] ) ===== CASE: -n -c while false do done ===== (command.WhileUntil keyword: (Token id: Id.KW_While col: 2 length: 5 span_id: 2 line: (SourceLine line_num:2 content:" while\n" src:(source.CFlag)) tval: while ) cond: (condition.Shell commands: [ (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 5 span_id: 5 line: (SourceLine line_num:3 content:" false\n" src:...0x3ffffffc) tval: "false" ) more_env: [] words: [(CompoundWord parts:[...0x13d2])] redirects: [] do_fork: T ) ] ) body: (command.DoGroup left: (Token id: Id.KW_Do col: 2 length: 2 span_id: 8 line: (SourceLine line_num:4 content:" do\n" src:...0x3ffffffc) tval: do ) children: [] right: (Token id: Id.KW_Done col: 2 length: 4 span_id: 11 line: (SourceLine line_num:5 content:" done\n" src:...0x3ffffffc) tval: done ) ) redirects: [] ) ===== CASE: -n -c while true; false do done ===== (command.WhileUntil keyword: (Token id: Id.KW_While col: 2 length: 5 span_id: 2 line: (SourceLine line_num:2 content:" while\n" src:(source.CFlag)) tval: while ) cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 4 span_id: 5 line: (SourceLine line_num:3 content:" true;\n" src:...0x3ffffffc) tval: "true" ) more_env: [] words: [(CompoundWord parts:[...0x13d6])] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:6 length:1 span_id:6 line:...0x13de) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 2 length: 5 span_id: 9 line: (SourceLine line_num:4 content:" false\n" src:...0x3ffffffc) tval: "false" ) more_env: [] words: [(CompoundWord parts:[...0x139e])] redirects: [] do_fork: T ) ] ) body: (command.DoGroup left: (Token id: Id.KW_Do col: 2 length: 2 span_id: 12 line: (SourceLine line_num:5 content:" do\n" src:...0x3ffffffc) tval: do ) children: [] right: (Token id: Id.KW_Done col: 2 length: 4 span_id: 15 line: (SourceLine line_num:6 content:" done\n" src:...0x3ffffffc) tval: done ) ) redirects: [] ) ===== CASE: -n -c if true then fi ===== (command.If if_kw: (Token id: Id.KW_If col: 2 length: 2 span_id: 2 line: (SourceLine line_num:2 content:" if true\n" src:(source.CFlag)) tval: if ) arms: [ (IfArm keyword: ...0x13ee cond: (condition.Shell commands: [ (command.Simple blame_tok: (Token id:Id.Lit_Chars col:5 length:4 span_id:4 line:...0x13f6 tval:"true") more_env: [] words: [(CompoundWord parts:[...0x13de])] redirects: [] do_fork: T ) ] ) then_kw: (Token id: Id.KW_Then col: 2 length: 4 span_id: 7 line: (SourceLine line_num:3 content:" then\n" src:...0x3ffffffc) tval: then ) action: [] spids: [2 7] ) ] else_action: [] fi_kw: (Token id: Id.KW_Fi col: 2 length: 2 span_id: 10 line: (SourceLine line_num:4 content:" fi\n" src:...0x3ffffffc) tval: fi ) redirects: [] ) ===== CASE: -n -c while true; false do done ===== (command.WhileUntil keyword: (Token id: Id.KW_While col: 2 length: 5 span_id: 2 line: (SourceLine line_num:2 content:" while true;\n" src:(source.CFlag)) tval: while ) cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars col:8 length:4 span_id:4 line:...0x13fe tval:"true") more_env: [] words: [(CompoundWord parts:[...0x13e6])] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:12 length:1 span_id:5 line:...0x13fe) ) (command.Simple blame_tok: (Token id: Id.Lit_Chars col: 8 length: 5 span_id: 8 line: (SourceLine line_num:3 content:" false\n" src:...0x3ffffffc) tval: "false" ) more_env: [] words: [(CompoundWord parts:[...0x13aa])] redirects: [] do_fork: T ) ] ) body: (command.DoGroup left: (Token id: Id.KW_Do col: 2 length: 2 span_id: 11 line: (SourceLine line_num:4 content:" do\n" src:...0x3ffffffc) tval: do ) children: [] right: (Token id: Id.KW_Done col: 2 length: 4 span_id: 14 line: (SourceLine line_num:5 content:" done\n" src:...0x3ffffffc) tval: done ) ) redirects: [] ) OK test-extra-newlines *** Running test-here-doc ===== CASE: -n -c cat < >> ) ===== echo $( echo > >> ) ^~ [ -c flag ]:1: Invalid token after redirect operator OK test-redirect *** Running test-shell_for ===== CASE: -n -c for x in & ===== for x in & ^ [ -c flag ]:1: Invalid word in for loop ===== CASE: -n -c for (( i=0; i<10; i++ )) ls ===== for (( i=0; i<10; i++ )) ls ^~ [ -c flag ]:1: Invalid word after for expression ===== CASE: -n -c for ( i=0; i<10; i++ ) ===== for ( i=0; i<10; i++ ) ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: -n -c for $x in 1 2 3; do echo $i; done ===== for $x in 1 2 3; do echo $i; done ^~ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: -n -c for x.y in 1 2 3; do echo $i; done ===== for x.y in 1 2 3; do echo $i; done ^~~ [ -c flag ]:1: Invalid loop variable name 'x.y' ===== CASE: -n -c for x in 1 2 3; & ===== for x in 1 2 3; & ^ [ -c flag ]:1: Expected word type Id.KW_Do, got Id.Op_Amp ===== CASE: -n -c for foo BAD ===== for foo BAD ^ [ -c flag ]:1: Expected loop variable (a constant word) ===== CASE: -n -c for var in x; do echo $var; done ===== (command.ForEach keyword: (Token id: Id.KW_For col: 0 length: 3 span_id: 0 line: (SourceLine line_num:1 content:"for var in x; do echo $var; done" src:(source.CFlag)) tval: for ) iter_names: [var] iterable: (for_iter.Words words: [ (CompoundWord parts: [(Token id:Id.Lit_Chars col:11 length:1 span_id:6 line:...0x1412 tval:x)] ) ] ) semi_tok: (Token id:Id.Op_Semi col:12 length:1 span_id:7 line:...0x1412) body: (command.DoGroup left: (Token id:Id.KW_Do col:14 length:2 span_id:9 line:...0x1412 tval:do) children: [ (command.Sentence child: (command.Simple blame_tok: (Token id:Id.Lit_Chars col:17 length:4 span_id:11 line:...0x1412 tval:echo) more_env: [] words: [ (CompoundWord parts:[...0x13ae]) (CompoundWord parts: [ (NameTok left: (Token id: Id.VSub_DollarName col: 22 length: 4 span_id: 13 line: ...0x1412 tval: "$var" ) var_name: var ) ] ) ] redirects: [] do_fork: T ) terminator: (Token id:Id.Op_Semi col:26 length:1 span_id:14 line:...0x1412) ) ] right: (Token id:Id.KW_Done col:28 length:4 span_id:16 line:...0x1412 tval:done) ) redirects: [] ) OK test-shell_for *** Running test-simple-command ===== CASE: -n -c PYTHONPATH=. FOO=(1 2) python ===== PYTHONPATH=. FOO=(1 2) python ^~~~ [ -c flag ]:1: Environment bindings can't contain array literals ===== CASE: -n -c PYTHONPATH+=1 python ===== PYTHONPATH+=1 python ^~~~~~~~~~~~ [ -c flag ]:1: Expected = in environment binding, got += ===== CASE: -n -c =var ===== =var ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it ===== CASE: -n -c =f(x) ===== =f(x) ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it ===== CASE: -n -c =var ===== =var ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it ===== CASE: -n -c =f(x) ===== =f(x) ^ [ -c flag ]:1: =word isn't allowed. Hint: add a space after =, or quote it OK test-simple-command *** Running test-test-builtin ===== CASE: -c [ x -a y f ] ===== [ x -a y f ] ^ [ -c flag ]:1: (test) Unexpected trailing word 'f' ===== CASE: -c test x -a y f ===== test x -a y f ^ [ -c flag ]:1: (test) Unexpected trailing word 'f' ===== CASE: -c [ x ===== [ x ^ [ -c flag ]:1: missing closing ] ===== CASE: -c [ x x ] ===== [ x x ] ^ [ -c flag ]:1: (test) Expected unary operator, got 'x' (2 args) ===== CASE: -c [ x x "a b" ] ===== [ x x "a b" ] ^ [ -c flag ]:1: (test) Expected binary operator, got 'x' (3 args) ===== CASE: -c [ -t xxx ] ===== [ -t xxx ] ^~~ [ -c flag ]:1: (test) Invalid file descriptor 'xxx' ===== CASE: -c [ \( x -a -y -a z ] ===== [??? no location ???] (test) Expected ), got EOF OK test-test-builtin *** Running test-word-parse ===== CASE: -n -c echo ${ ===== echo ${ ^ [ -c flag ]:1: Unexpected token in ${} ===== CASE: -n -c ${foo:} ===== ${foo:} ^ [ -c flag ]:1: Token can't be used in prefix position ===== CASE: -n -c echo ${a[@Z ===== echo ${a[@Z ^ [ -c flag ]:1: Expected ] to close subscript ===== CASE: -n -c echo ${x.} ===== echo ${x.} ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c echo ${!x.} ===== echo ${!x.} ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c echo ${a:1;} ===== echo ${a:1;} ^ [ -c flag ]:1: Expected : or } in slice ===== CASE: -n -c echo ${a:1:2;} ===== echo ${a:1:2;} ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Arith_Semi != Id.Arith_RBrace) ===== CASE: -n -c echo ${#a. ===== echo ${#a. ^ [ -c flag ]:1: Expected } after length expression ===== CASE: -n -c for (( i = 0; i < 10; i++ ; ===== for (( i = 0; i < 10; i++ ; ^ [ -c flag ]:1: Unexpected token after arithmetic expression (Id.Arith_Semi != Id.Arith_RParen) ===== CASE: -n -c for (( i = 0; i < 10; i++ / ===== for (( i = 0; i < 10; i++ / ^ [ -c flag ]:1: Unexpected end of input ===== CASE: -n -c echo @(extglob|foo ===== echo @(extglob|foo ^~ [ -c flag ]:1: Unexpected EOF reading extended glob that began here ===== CASE: -n -c ${undef:- ===== ${undef:- ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${undef:-$ ===== ${undef:-$ ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${undef:-$F ===== ${undef:-$F ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${x@ ===== ${x@ ^ [ -c flag ]:1: Unexpected token in ${} (VOp3) ===== CASE: -n -c ${x@Q ===== ${x@Q ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${x% ===== ${x% ^ [ -c flag ]:1: Expected } to close ${ ===== CASE: -n -c ${x/ ===== ${x/ ^ [ -c flag ]:1: Expected } after replacement string, got Id.Eof_Real ===== CASE: -n -c ${x/a/ ===== ${x/a/ ^ [ -c flag ]:1: Expected } after replacement string, got Id.Eof_Real ===== CASE: -n -c ${x/a/b ===== ${x/a/b ^ [ -c flag ]:1: Expected } after replacement string, got Id.Eof_Real ===== CASE: -n -c ${x: ===== ${x: ^ [ -c flag ]:1: Unexpected end of input OK test-word-parse test/parse-errors.sh: 28 tests passed.