[1/1] SYMLINK _bin/cxx-asan oils-for-unix ysh 'ysh' -> 'oils-for-unix' *** 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-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 = / [ \x00 \xff ] / ===== ===== CASE: -c = / [ \x00-\xff ] / ===== ===== CASE: -c = / [ $'\x00 \xff' ] / ===== = / [ $'\x00 \xff' ] / ^~ [ -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 =/ [ \u{80} ] /; echo $x ===== var x =/ [ \u{80} ] /; echo $x ^~~~~~ [ -c flag ]:1: fatal: ERE can't express char code 128 ===== CASE: -c var x = / [ \u{7f}-\u{80} ] /; echo $x ===== var x = / [ \u{7f}-\u{80} ] /; echo $x ^~~~~~ [ -c flag ]:1: fatal: ERE can't express char code 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: Expected 'evalExpr' to be a func, got Undef 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: fatal: Can't compare two values of type Command OK test-equality *** Running test-error-builtin ===== CASE: -c error ===== error ^~~~~ [ -c flag ]:1: 'error' expected a message to display error ^~~~~ [ -c flag ]:1: errexit PID 15699: command.Simple failed with status 2 ===== CASE: -c error -- ===== error -- ^~~~~ [ -c flag ]:1: 'error' expected a message to display error -- ^~~~~ [ -c flag ]:1: errexit PID 15701: command.Simple failed with status 2 ===== CASE: -c error -- oops ===== error -- oops ^~~~~ [ -c flag ]:1: fatal: oops ===== CASE: -c error oops ===== error oops ^~~~~ [ -c flag ]:1: fatal: oops ===== CASE: -c error oops (code=99) ===== error oops (code=99) ^~~~~ [ -c flag ]:1: fatal: oops OK test-error-builtin *** Running test-error-loc-bugs ===== CASE: -c func id(x) { return (x) } #pp test_ (id(len(42))) # This should point at ( in len, not id( pp test_ (len(id(42))) ===== pp test_ (len(id(42))) ^ [ -c flag ]:9: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c var methods = {} # Should point at methods, not {} var o = Object(methods, {}) ===== var o = Object(methods, {}) ^~~~~~~ [ -c flag ]:5: fatal: Object() expected Obj or Null, got Dict OK test-error-loc-bugs *** Running test-fallback-locations ===== 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 if (1 + len(42)) { echo hi } ===== if (1 + len(42)) { echo hi } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c const f = 42; func f() { echo hi } ===== const f = 42; func f() { echo hi } ^ [ -c flag ]:1: fatal: Can't assign to readonly value 'f' ===== CASE: -c for x in $[2 + len(42)] { echo hi } ===== for x in $[2 + len(42)] { echo hi } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c for x in (len(42)) { echo hi } ===== for x in (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 case (len(42)) { pat { echo argument } } ===== case (len(42)) { pat { echo argument } } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c case (42) { (len(42)) { echo arm } } ===== case (42) { (len(42)) { echo arm } } ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c case "$[len(42)]" in pat) echo hi ;; esac ===== case "$[len(42)]" in pat) echo hi ;; esac ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c var x = 3 + len(42) ===== var x = 3 + len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c const x = 3 + len(42) ===== const x = 3 + len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c setvar x = 3 + len(42) ===== setvar x = 3 + len(42) ^~ [ -c flag ]:1: fatal: len() expected Str, List, or Dict, got Int ===== CASE: -c setvar x = "s" + 5 ===== setvar x = "s" + 5 ^ [ -c flag ]:1: fatal: Binary operator expected numbers, got Str and Int (OILS-ERR-201) ===== CASE: -c while ("s" + 5) { echo yes } ===== while ("s" + 5) { echo yes } ^ [ -c flag ]:1: fatal: Binary operator expected numbers, got Str and Int (OILS-ERR-201) ===== CASE: -c func f(x) { return (x) }; var x = f([1,2])[1](3); echo $x ===== func f(x) { return (x) }; var x = f([1,2])[1](3); echo $x ^ [ -c flag ]:1: fatal: Expected a function or method, got Int OK test-fallback-locations *** Running test-fat-arrow ===== CASE: -c = "str" => upper() ===== (Str) 'STR' ===== CASE: -c = "str" -> bad() ===== = "str" -> bad() ^~~ [ -c flag ]:1: fatal: Mutating method 'M/bad' not found on builtin type Str ===== CASE: -c = "str" => bad() ===== = "str" => bad() ^~~ [ -c flag ]:1: fatal: Undefined variable 'bad' ===== CASE: -c = ["3", "4"] => join("/") ===== (Str) '3/4' ===== CASE: -c = "badstring" => join("/") ===== = "badstring" => join("/") ^ [ -c flag ]:1: fatal: Arg 1 should be a List, got Str ===== CASE: -c = [1.0, 2.0] => indexOf(3.14) ===== = [1.0, 2.0] => indexOf(3.14) ^ [ -c flag ]:1: fatal: Equality isn't defined on Float values (OILS-ERR-202) ===== CASE: -c var myint = 42 = "badstring" => myint("/") ===== = "badstring" => myint("/") ^~~~~ [ -c flag ]:3: fatal: Fat arrow => expects method or function, got Int OK test-fat-arrow *** Running test-float-convert ===== CASE: -c = float({}) ===== = float({}) ^ [ -c flag ]:1: fatal: float() expected Int, Float, or Str, got Dict ===== CASE: -c = float([]) ===== = float([]) ^ [ -c flag ]:1: fatal: float() expected Int, Float, or Str, got List ===== CASE: -c = float("foo") ===== = float("foo") ^ [ -c flag ]:1: fatal: Cannot convert foo to Float ===== CASE: -c = float(len) ===== = float(len) ^~~ [ -c flag ]:1: fatal: float() expected Int, Float, or Str, got BuiltinFunc ===== CASE: -c = float("foo"->startswith) ===== = float("foo"->startswith) ^~~~~~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/startswith' not found on builtin type Str OK test-float-convert *** Running test-float-equality ===== CASE: -c var x = 1 pp test_ (42.0 === x) ===== pp test_ (42.0 === x) ^~~ [ -c flag ]:3: fatal: Equality isn't defined on Float values (OILS-ERR-202) ===== CASE: -c pp test_ (2.0 === 1.0) ===== pp test_ (2.0 === 1.0) ^~~ [ -c flag ]:1: fatal: Equality isn't defined on Float values (OILS-ERR-202) OK test-float-equality *** Running test-func-defaults ===== CASE: -c func f(a=ZZ) { echo } ===== func f(a=ZZ) { echo } ^~ [ -c flag ]:1: fatal: Undefined variable 'ZZ' ===== CASE: -c func f(a; named=YY) { echo } ===== func f(a; named=YY) { echo } ^~ [ -c flag ]:1: fatal: Undefined variable 'YY' ===== CASE: -c func f(a=[]) { echo } ===== func f(a=[]) { echo } ^ [ -c flag ]:1: fatal: Default values can't be mutable, got List ===== CASE: -c func f(; d={a:3}) { echo } ===== func f(; d={a:3}) { echo } ^ [ -c flag ]:1: fatal: Default values can't be mutable, got Dict OK test-func-defaults *** Running test-func-error-locs ===== CASE: -c = join(["foo", "bar"], " ", 99) ===== = join(["foo", "bar"], " ", 99) ^~ [ -c flag ]:1: fatal: Expected 2 typed args, but got 3 ===== CASE: -c = int() ===== = int() ^ [ -c flag ]:1: fatal: Expected at least 1 typed args, but only got 0 ===== CASE: -c = str({}) ===== = str({}) ^ [ -c flag ]:1: fatal: str() expected one of (Null Bool Int Float Str Eggex), got Dict ===== CASE: -c = "foo"->startswith("f", "o") ===== = "foo"->startswith("f", "o") ^~~~~~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/startswith' not found on builtin type Str ===== CASE: -c = "foo"->startswith() ===== = "foo"->startswith() ^~~~~~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/startswith' not found on builtin type Str ===== CASE: -c = "foo"->startswith(1) ===== = "foo"->startswith(1) ^~~~~~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/startswith' not found on builtin type Str ===== CASE: -c func f(x) { return (x) } = f() ===== = f() ^ [ -c flag ]:5: fatal: 'f' wasn't passed typed param 'x' OK test-func-error-locs *** Running test-func-extra ===== CASE: -c func f() { echo "$x $y" } call f(42) # extra pos ===== call f(42) # extra pos ^ [ -c flag ]:5: fatal: Func 'f' takes no positional args, but got 1 ===== CASE: -c func f() { echo "$x $y" } call f(; x=32) # extra named ===== call f(; x=32) # extra named ^ [ -c flag ]:5: fatal: Func 'f' takes no named args, but got 1 OK test-func-extra *** Running test-func-missing ===== CASE: -c func f(x, y) { echo "$x $y" } call f(1) ===== call f(1) ^ [ -c flag ]:5: fatal: 'f' wasn't passed typed param 'y' ===== CASE: -c func f(x, y; z) { echo "$x $y" } call f(3, 4) ===== call f(3, 4) ^ [ -c flag ]:5: fatal: 'f' wasn't passed named param 'z' OK test-func-missing *** Running test-func-passing ===== CASE: -c func f(...rest=3) { return (42) } ===== func f(...rest=3) { ^ [ -c flag ]:2: Syntax error in expression (near Id.Arith_Equal) ===== CASE: -c func f(a, b) { echo "$a -- $b" } = f() ===== = f() ^ [ -c flag ]:5: fatal: 'f' wasn't passed typed param 'a' ===== CASE: -c func f(a, b) { echo "$a -- $b" } = f(...[1, 2]) = f(...3) ===== 1 -- 2 (Null) null = f(...3) ^~~ [ -c flag ]:6: fatal: Spread expected a List, got Int ===== CASE: -c func f(a, ...b) { echo $a - @b - } = f(1, 2, 3) var x = [4, 5, 6] = f(...x) ===== 1 - 2 3 - (Null) null 4 - 5 6 - (Null) null ===== CASE: -c func f(p ; a, b) { echo "$p ; $a $b" } var kwargs = {a: 42, b: 43, c: 44} = f(99; ...kwargs) ===== 99 ; 42 43 (Null) null OK test-func-passing *** Running test-hay ===== CASE: -c hay define package user TASK hay eval :result { package foo { # commands can be run while evaluating oops } bad 2 } ===== oops ^~~~ [ -c flag ]:7: Unknown command 'oops' while running hay [ -c flag ]:7: errexit PID 15844: command.Simple failed with status 127 OK test-hay *** Running test-hay-osh ===== CASE: -c hay define package TASK package foo { version = 1 } ===== version = 1 ^~~~~~~ [ -c flag ]:5: 'version' not found (OILS-ERR-100) } ^ [ -c flag ]:6: Unexpected right brace ===== CASE: -c shopt --set parse_brace hay define package TASK hay eval :result { package foo { version = 1 } } ===== version = 1 ^~~~~~~ [ -c flag ]:8: Unknown command 'version' while running hay OK test-hay-osh *** Running test-int-convert ===== CASE: -c = int({}) ===== = int({}) ^ [ -c flag ]:1: fatal: int() expected Bool, Int, Float, or Str, got Dict ===== CASE: -c = int([]) ===== = int([]) ^ [ -c flag ]:1: fatal: int() expected Bool, Int, Float, or Str, got List ===== CASE: -c = int("foo") ===== = int("foo") ^ [ -c flag ]:1: fatal: Can't convert foo to Int ===== CASE: -c = int(len) ===== = int(len) ^~~ [ -c flag ]:1: fatal: int() expected Bool, Int, Float, or Str, got BuiltinFunc ===== CASE: -c = int("foo" => startsWith) ===== = int("foo" => startsWith) ^~ [ -c flag ]:1: fatal: int() expected Bool, Int, Float, or Str, got BoundFunc ===== CASE: -c = int(NAN) ===== = int(NAN) ^~~ [ -c flag ]:1: fatal: Can't convert float NAN to Int ===== CASE: -c = int(-INFINITY) ===== = int(-INFINITY) ^ [ -c flag ]:1: fatal: Can't convert float -INFINITY to Int OK test-int-convert *** Running test-int-overflow ===== CASE: -c var s = '18446744073709551616'; = s % 2 ===== var s = '18446744073709551616'; = s % 2 ^ [ -c flag ]:1: fatal: Integer too big: 18446744073709551616 ===== CASE: -c var s = '-18446744073709551616'; = s % 2 ===== var s = '-18446744073709551616'; = s % 2 ^ [ -c flag ]:1: fatal: Integer too big: -18446744073709551616 ===== CASE: -c var s = '18446744073709551616'; = s + 1 ===== var s = '18446744073709551616'; = s + 1 ^ [ -c flag ]:1: fatal: Integer too big: 18446744073709551616 ===== CASE: -c var s = '-18446744073709551616'; = s + 1 ===== var s = '-18446744073709551616'; = s + 1 ^ [ -c flag ]:1: fatal: Integer too big: -18446744073709551616 ===== CASE: -c = '18446744073709551616' ~== 42 ===== = '18446744073709551616' ~== 42 ^~~ [ -c flag ]:1: fatal: Integer too big: 18446744073709551616 ===== CASE: -c = '-18446744073709551616' ~== 42 ===== = '-18446744073709551616' ~== 42 ^~~ [ -c flag ]:1: fatal: Integer too big: -18446744073709551616 ===== CASE: -c = int('18446744073709551616') ===== = int('18446744073709551616') ^ [ -c flag ]:1: fatal: Integer too big: 18446744073709551616 ===== CASE: -c = int('-18446744073709551616') ===== = int('-18446744073709551616') ^ [ -c flag ]:1: fatal: Integer too big: -18446744073709551616 OK test-int-overflow *** Running test-json ===== CASE: -c json write ===== json write ^~~~ [ -c flag ]:1: fatal: Expected at least 1 typed args, but only got 0 ===== CASE: -c json write (42, 43) ===== json write (42, 43) ^~ [ -c flag ]:1: fatal: Expected 1 typed args, but got 2 ===== CASE: -c json read zz ===== json read zz ^~ [ -c flag ]:1: 'json' read got too many args json read zz ^~~~ [ -c flag ]:1: errexit PID 15898: command.Simple failed with status 2 ===== CASE: -c json read yy zz ===== json read yy zz ^~ [ -c flag ]:1: 'json' read got too many args json read yy zz ^~~~ [ -c flag ]:1: errexit PID 15900: command.Simple failed with status 2 ===== CASE: -c json read (&x, 43) ===== json read (&x, 43) ^~ [ -c flag ]:1: fatal: Expected 1 typed args, but got 2 OK test-json *** Running test-list-convert ===== CASE: -c = list(1) ===== = list(1) ^ [ -c flag ]:1: fatal: list() expected Dict, List, or Range, got Int ===== CASE: -c = list(len) ===== = list(len) ^~~ [ -c flag ]:1: fatal: list() expected Dict, List, or Range, got BuiltinFunc ===== CASE: -c = list("foo"->startswith) ===== = list("foo"->startswith) ^~~~~~~~~~ [ -c flag ]:1: fatal: Mutating method 'M/startswith' not found on builtin type Str OK test-list-convert *** Running test-method-type-errors ===== CASE: -c = "hi" => search(42) ===== = "hi" => search(42) ^ [ -c flag ]:1: fatal: expected Eggex or Str, got Int ===== CASE: -c = "hi" => leftMatch(42) ===== = "hi" => leftMatch(42) ^ [ -c flag ]:1: fatal: expected Eggex or Str, got Int ===== CASE: -c var m = 'hi' => leftMatch(/'hi'/); = m => group(3.14) ===== var m = 'hi' => leftMatch(/'hi'/); = m => group(3.14) ^ [ -c flag ]:1: fatal: expected Int or Str, got Float OK test-method-type-errors *** Running test-module ===== CASE: -c use spec/testdata/module2/util.ysh; util ===== caller_no_leak = null use spec/testdata/module2/util.ysh; util ^~~~ [ -c flag ]:1: 'util' module must be invoked with a proc name argument [ -c flag ]:1: errexit PID 15925: command.Simple failed with status 2 ===== CASE: -c use spec/testdata/module2/util.ysh; util zz ===== caller_no_leak = null use spec/testdata/module2/util.ysh; util zz ^~ [ -c flag ]:1: 'util' module doesn't contain invokable 'zz' [ -c flag ]:1: errexit PID 15927: command.Simple failed with status 2 ===== CASE: -c use spec/testdata/module2/util2.ysh; util2 echo-args ===== use spec/testdata/module2/util2.ysh; util2 echo-args ^~~~~~~~~ [ -c flag ]:1: fatal: proc 'echo-args' wasn't passed word param 'w1' ===== CASE: -c use spec/testdata/module2/util2.ysh; util2 badObj otherproc ===== use spec/testdata/module2/util2.ysh; util2 badObj otherproc ^~~~~~ [ -c flag ]:1: fatal: __invoke__ on 'badObj' should be a user-defined Proc, got BuiltinProc OK test-module *** Running test-more-locations ===== CASE: -c var Counter_methods = {}; var c = Object(Counter_methods, {i: 5}) ===== var Counter_methods = {}; var c = Object(Counter_methods, {i: 5}) ^~~~~~~~~~~~~~~ [ -c flag ]:1: fatal: Object() expected Obj or Null, got Dict test/ysh-runtime-errors.sh: line 224: ^: command not found FAIL test-more-locations