[1/1] SYMLINK _bin/cxx-asan/ysh bin/oils_for_unix.mycpp '_bin/cxx-asan/ysh' -> 'bin/oils_for_unix.mycpp' *** Running test-EvalExpr-calls ===== CASE: -c json write (len(42)) ===== json write (len(42)) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c = len(42) ===== = len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c call len(42) ===== call len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c echo $[len(42)] ===== echo $[len(42)] ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c echo $[len(z = 42)] ===== echo $[len(z = 42)] ^ [ -c flag ]:1: fatal: Expected at least 1 typed args, but only got 0 ===== CASE: -c echo @[len(42)] ===== echo @[len(42)] ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c echo @[len(z = 42)] ===== echo @[len(z = 42)] ^ [ -c flag ]:1: fatal: Expected at least 1 typed args, but only got 0 ===== CASE: -c const x = len(42) ===== const x = len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c setvar x += len(42) ===== setvar x += len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c var d = {} setvar d[len(42)] = "foo" ===== setvar d[len(42)] = "foo" ^~ [ -c flag ]:3: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c var d = {} setvar len(42).z = "foo" ===== setvar len(42).z = "foo" ^ [ -c flag ]:3: Subscript/Attribute not allowed on this LHS expression ===== CASE: -c hay define Package Package foo { x = len(42) } ===== x = len(42) ^~ [ -c flag ]:4: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c if (len(42)) { echo hi } ===== if (len(42)) { echo hi } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c while (len(42)) { echo hi } ===== while (len(42)) { echo hi } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c for x in (len(42)) { echo $x } ===== for x in (len(42)) { echo $x } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int OK test-EvalExpr-calls *** Running test-append-usage-error ===== CASE: -c append x ([]) ===== ===== CASE: -c append ===== append ^~~~~~ [ -c flag ]:1: fatal: Expected at least 1 typed args, but only got 0 ===== CASE: -c append x ===== append x ^~~~~~ [ -c flag ]:1: fatal: Expected at least 1 typed args, but only got 0 ===== CASE: -c append x ([], []) ===== append x ([], []) ^ [ -c flag ]:1: fatal: Expected 1 typed args, but got 2 OK test-append-usage-error *** Running test-assert ===== CASE: -c assert [0.0] ===== assert [0.0] ^ [ -c flag ]:1: fatal: Expression isn't true ===== CASE: -c assert [3 > 4] ===== assert [3 > 4] ^ [ -c flag ]:1: fatal: Expression isn't true ===== CASE: -c assert (0) ===== Value isn't true: (Int) 0 assert (0) ^ [ -c flag ]:1: fatal: assertion ===== CASE: -c assert (null === 42) ===== Value isn't true: (Bool) false assert (null === 42) ^ [ -c flag ]:1: fatal: assertion ===== CASE: -c assert [null === 42] ===== Expected: (Null) null Got: (Int) 42 assert [null === 42] ^~~ [ -c flag ]:1: fatal: Not equal ===== CASE: -c assert [null === list(1 ..< 50)] ===== Expected: (Null) null Got: (List) [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 ] assert [null === list(1 ..< 50)] ^~~ [ -c flag ]:1: fatal: Not equal ===== CASE: -c assert [{k: list(3 ..< 40)} === list(1 ..< 50)] ===== Expected: (Dict) { k: [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39 ] } Got: (List) [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49 ] assert [{k: list(3 ..< 40)} === list(1 ..< 50)] ^~~ [ -c flag ]:1: fatal: Not equal OK test-assert *** Running test-attr-error-locs ===== CASE: -c = {}.key ===== = {}.key ^ [ -c flag ]:1: fatal: Dict entry 'key' not found ===== CASE: -c = {}->method ===== = {}->method ^~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/method' not found on builtin type Dict ===== CASE: -c var obj = Object(null, {}); = obj.attr ===== var obj = Object(null, {}); = obj.attr ^ [ -c flag ]:1: fatal: Attribute 'attr' not found on Obj ===== CASE: -c var obj = Object(null, {}); = obj->method ===== var obj = Object(null, {}); = obj->method ^~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/method' not found on Obj prototype chain OK test-attr-error-locs *** Running test-bug-2129 ===== CASE: -i -c proc p (...args) { echo $args } p 1 2 3 echo $[{}] p 1 2 3 ===== echo $args ^~~~~ [ -c flag ]:3: fatal: Word eval got a List, which can't be stringified (OILS-ERR-203) echo $[{}] ^~ [ -c flag ]:8: fatal: Expr sub expected one of (Null Bool Int Float Str Eggex), got Dict echo $args ^~~~~ [ -c flag ]:3: fatal: Word eval got a List, which can't be stringified (OILS-ERR-203) OK test-bug-2129 *** Running test-cannot-stringify-list ===== CASE: -c var mylist = [1,2,3]; write $mylist ===== var mylist = [1,2,3]; write $mylist ^~~~~~~ [ -c flag ]:1: fatal: Word eval got a List, which can't be stringified (OILS-ERR-203) ===== CASE: -c var mylist = [1,2,3]; write $[mylist] ===== var mylist = [1,2,3]; write $[mylist] ^~ [ -c flag ]:1: fatal: Expr sub got a List, which can't be stringified (OILS-ERR-203) ===== CASE: -c = str(/d+/) ===== (Str) '[[:digit:]]+' ===== CASE: -c = str([1,2]) ===== = str([1,2]) ^ [ -c flag ]:1: fatal: str() got a List, which can't be stringified (OILS-ERR-203) ===== CASE: -c = str({}) ===== = str({}) ^ [ -c flag ]:1: fatal: str() expected one of (Null Bool Int Float Str Eggex), got Dict ===== CASE: -c = join([true, null]) ===== (Str) 'truenull' ===== CASE: -c = join([[1,2], null]) ===== = join([[1,2], null]) ^ [ -c flag ]:1: fatal: join() got a List, which can't be stringified (OILS-ERR-203) OK test-cannot-stringify-list *** Running test-const-decl ===== CASE: -c const x = {}; const x = {}; ===== const x = {}; const x = {}; ^ [ -c flag ]:1: fatal: Can't assign to readonly value 'x' ===== CASE: -c const x; const x; ===== const x; const x; ^ [ -c flag ]:1: fatal: Can't assign to readonly value 'x' OK test-const-decl *** Running test-dict-convert ===== CASE: -c = dict(1) ===== = dict(1) ^ [ -c flag ]:1: fatal: dict() expected Dict, Obj, or BashAssoc, got Int ===== CASE: -c = dict("foo") ===== = dict("foo") ^ [ -c flag ]:1: fatal: dict() expected Dict, Obj, or BashAssoc, got Str ===== CASE: -c = dict(len) ===== = dict(len) ^~~ [ -c flag ]:1: fatal: dict() expected Dict, Obj, or BashAssoc, got BuiltinFunc ===== CASE: -c = dict("foo"->startswith) ===== = dict("foo"->startswith) ^~~~~~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/startswith' not found on builtin type Str ===== CASE: -c = dict([["too", "many", "parts"]]) ===== = dict([["too", "many", "parts"]]) ^ [ -c flag ]:1: fatal: dict() expected Dict, Obj, or BashAssoc, got List OK test-dict-convert *** Running test-eggex ===== CASE: -c = / [ \y00 \yff ] / ===== ===== CASE: -c = / [ \y00-\yff ] / ===== ===== CASE: -c = / [ b'\y00 \yff' ] / ===== = / [ b'\y00 \yff' ] / ^~ [ -c flag ]:1: fatal: Use unquoted char literal for byte 255, which is >= 128 (avoid confusing a set of bytes with a sequence) ===== CASE: -c = / [ \u{0} ] / ===== ===== CASE: -c = / [ \u{0}-\u{1} ] / ===== ===== CASE: -c var x =/ [ \y80 ] /; echo $x ===== var x =/ [ \y80 ] /; echo $x ^~~~ [ -c flag ]:1: fatal: ERE can't express high bytes 128 ===== CASE: -c var x = / [ \y7f-\y80 ] /; echo $x ===== var x = / [ \y7f-\y80 ] /; echo $x ^~~~ [ -c flag ]:1: fatal: ERE can't express high bytes 128 ===== CASE: -c = / [ \\ '^-]' 'abc' ] / ===== ===== CASE: -c var x = / [ a-'^' ] /; echo $x ===== var x = / [ a-'^' ] /; echo $x ^ [ -c flag ]:1: fatal: Can't use char 94 as end of range in ERE syntax ===== CASE: -c var x = / [ '-'-z ] /; echo $x ===== var x = / [ '-'-z ] /; echo $x ^ [ -c flag ]:1: fatal: Can't use char 45 as start of range in ERE syntax ===== CASE: -c var x = / [ ']'-z ] /; echo $x ===== var x = / [ ']'-z ] /; echo $x ^ [ -c flag ]:1: fatal: Can't use char 93 as start of range in ERE syntax ===== CASE: -c var x = / ['^'] /; echo $x ===== [^] ===== CASE: -c var i = 42 = / @i / # splice object of wrong type ===== = / @i / # splice object of wrong type ^ [ -c flag ]:3: fatal: Eggex splice expected Str or Eggex, got Int ===== CASE: -c var i = 42 = / [a @i] / # char class splice object of wrong type ===== = / [a @i] / # char class splice object of wrong type ^ [ -c flag ]:3: fatal: Eggex char class splice expected Str, got Int OK test-eggex *** Running test-eggex-2 ===== CASE: -c var sq = / 'foo'+ / ===== ===== CASE: -c var sq = / ('foo')+ / echo $sq var sq2 = / + / echo $sq2 ===== (foo)+ (foo)+ ===== CASE: -c var literal = "foo" var svs = / @literal+ / echo $svs ===== var svs = / @literal+ / ^ [ -c flag ]:3: fatal: POSIX EREs don't have groups without capture, so this node needs () around it. OK test-eggex-2 *** Running test-eggex-api ===== CASE: -c = _group(0) ===== = _group(0) ^ [ -c flag ]:1: fatal: No regex capture groups ===== CASE: -c if ("foo" ~ /[a-z]/) { echo $[_group(1)] } ===== if ("foo" ~ /[a-z]/) { echo $[_group(1)] } ^ [ -c flag ]:1: fatal: Expected capture group less than 1, got 1 ===== CASE: -c if ("foo" ~ /[a-z]/) { echo $[_group("name")] } ===== if ("foo" ~ /[a-z]/) { echo $[_group("name")] } ^ [ -c flag ]:1: fatal: No such group 'name' ===== CASE: -c if ("foo" ~ "[a-z]") { echo $[_group(1)] } ===== if ("foo" ~ "[a-z]") { echo $[_group(1)] } ^ [ -c flag ]:1: fatal: Expected capture group less than 1, got 1 ===== CASE: -c if ("foo" ~ "[a-z]") { echo $[_group("name")] } ===== if ("foo" ~ "[a-z]") { echo $[_group("name")] } ^ [ -c flag ]:1: fatal: ERE captures don't have names ('name') ===== CASE: -c = _group("foo") ===== = _group("foo") ^ [ -c flag ]:1: fatal: No regex capture groups OK test-eggex-api *** Running test-eggex-convert-func ===== CASE: -c = / / ===== ===== CASE: -c = / / ===== ===== CASE: -c = / / ===== ===== CASE: -c = / / ===== = / / ^~~ [ -c flag ]:1: fatal: Expected 'BAD' to be a func, got Undef ===== CASE: -c = / / ===== = / / ^~~ [ -c flag ]:1: fatal: Expected 'BAD' to be a func, got Undef ===== CASE: -c var pat = / /; var m = "10" => search(pat) => group(1) ===== var pat = / /; var m = "10" => search(pat) => group(1) ^ [ -c flag ]:1: Fatal error calling Eggex conversion func 'evalExpr' from this Match accessor var pat = / /; var m = "10" => search(pat) => group(1) ^~~~~~~~ [ -c flag ]:1: fatal: Arg 1 should be a Expr, got Str OK test-eggex-convert-func *** Running test-equality ===== CASE: -c = ^[42] === ^[43] ===== = ^[42] === ^[43] ^~~ [ -c flag ]:2: fatal: Can't compare two values of type Expr ===== CASE: -c = ^(echo hi) === ^(echo yo) ===== = ^(echo hi) === ^(echo yo) ^ [ -c flag ]:2: Invalid word while parsing command list test/ysh-runtime-errors.sh: fatal: test/ysh-runtime-errors.sh: expected status 3, got 2 FAIL test-equality