[INFO] fetching crate flt 0.4.0... [INFO] testing flt-0.4.0 against 1.100.0-beta.13+cargoflags=--release for beta-release-1.101-3 [INFO] extracting crate flt 0.4.0 into /workspace/builds/worker-0-tc1/source [INFO] started tweaking crates.io crate flt 0.4.0 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate flt 0.4.0 [INFO] tweaked toml for crates.io crate flt 0.4.0 written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate flt 0.4.0 on toolchain 1.100.0-beta.13 [INFO] running `"cargo" "+1.100.0-beta.13" "metadata" "--manifest-path" "Cargo.toml" "--no-deps"` [INFO] crate crates.io crate flt 0.4.0 already has a lockfile, it will not be regenerated [INFO] running `"cargo" "+1.100.0-beta.13" "fetch" "--manifest-path" "Cargo.toml"` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded autocfg v1.4.0 [INFO] [stderr] Downloaded redox_syscall v0.5.8 [INFO] [stderr] Downloaded unicode-ident v1.0.14 [INFO] [stderr] Downloaded pin-project-lite v0.2.15 [INFO] [stderr] Downloaded bytes v1.9.0 [INFO] [stderr] Downloaded rustyline v18.0.1 [INFO] [stderr] Downloaded nibble_vec v0.1.0 [INFO] [stderr] Downloaded error-code v3.3.2 [INFO] [stderr] Downloaded is_terminal_polyfill v1.70.1 [INFO] [stderr] Downloaded dirs-next v2.0.0 [INFO] [stderr] Downloaded errno v0.3.10 [INFO] [stderr] Downloaded smawk v0.3.2 [INFO] [stderr] Downloaded indenter v0.3.4 [INFO] [stderr] Downloaded strum v0.28.0 [INFO] [stderr] Downloaded shell-words v1.1.1 [INFO] [stderr] Downloaded winapi-util v0.1.9 [INFO] [stderr] Downloaded colorchoice v1.0.3 [INFO] [stderr] Downloaded sealed v0.6.0 [INFO] [stderr] Downloaded synthez v0.4.0 [INFO] [stderr] Downloaded smart-default v0.7.1 [INFO] [stderr] Downloaded serial_test v4.0.1 [INFO] [stderr] Downloaded anstyle-query v1.1.2 [INFO] [stderr] Downloaded terminal_size v0.4.4 [INFO] [stderr] Downloaded bytecount v0.6.8 [INFO] [stderr] Downloaded strum_macros v0.28.0 [INFO] [stderr] Downloaded endian-type v0.2.0 [INFO] [stderr] Downloaded clipboard-win v5.4.3 [INFO] [stderr] Downloaded itoa v1.0.14 [INFO] [stderr] Downloaded peg v0.6.3 [INFO] [stderr] Downloaded serial_test_derive v4.0.1 [INFO] [stderr] Downloaded redox_users v0.4.6 [INFO] [stderr] Downloaded synthez-codegen v0.4.0 [INFO] [stderr] Downloaded jiff-static v0.2.37 [INFO] [stderr] Downloaded inventory v0.3.16 [INFO] [stderr] Downloaded globwalk v0.9.1 [INFO] [stderr] Downloaded peg-runtime v0.6.3 [INFO] [stderr] Downloaded defmt-parser v1.0.0 [INFO] [stderr] Downloaded nom_locate v5.0.0 [INFO] [stderr] Downloaded globset v0.4.15 [INFO] [stderr] Downloaded convert_case v0.10.0 [INFO] [stderr] Downloaded linktime-proc-macro v0.2.3 [INFO] [stderr] Downloaded crossbeam-deque v0.8.6 [INFO] [stderr] Downloaded peg-macros v0.6.3 [INFO] [stderr] Downloaded anstyle-wincon v3.0.6 [INFO] [stderr] Downloaded pin-project-internal v1.1.7 [INFO] [stderr] Downloaded synthez-core v0.4.0 [INFO] [stderr] Downloaded defmt-macros v1.1.1 [INFO] [stderr] Downloaded defmt v1.1.1 [INFO] [stderr] Downloaded cucumber-expressions v0.5.0 [INFO] [stderr] Downloaded console v0.16.2 [INFO] [stderr] Downloaded once_cell v1.20.2 [INFO] [stderr] Downloaded gherkin v0.16.0 [INFO] [stderr] Downloaded cucumber-codegen v0.23.0 [INFO] [stderr] Downloaded ctor v1.0.13 [INFO] [stderr] Downloaded eyre v0.6.14 [INFO] [stderr] Downloaded rustversion v1.0.18 [INFO] [stderr] Downloaded anyhow v1.0.95 [INFO] [stderr] Downloaded ignore v0.4.23 [INFO] [stderr] Downloaded textwrap v0.16.1 [INFO] [stderr] Downloaded pin-project v1.1.7 [INFO] [stderr] Downloaded encode_unicode v1.0.0 [INFO] [stderr] Downloaded link-section v0.19.3 [INFO] [stderr] Downloaded num-bigint v0.4.6 [INFO] [stderr] Downloaded bigdecimal v0.4.11 [INFO] [stderr] Downloaded cucumber v0.23.0 [INFO] [stderr] Downloaded serde_json v1.0.134 [INFO] [stderr] Downloaded nom v8.0.0 [INFO] [stderr] Downloaded radix_trie v0.3.0 [INFO] [stderr] Downloaded unicode-width v0.2.2 [INFO] [stderr] Downloaded bstr v1.11.1 [INFO] [stderr] Downloaded jiff v0.2.37 [INFO] running `"docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-m" "1610612736" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:13253766d39459fde29cea4e7c35a3fe37c2c19b4a224f71f2c27711c2837d36" "sleep" "infinity"` [INFO] [stdout] 2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99 [INFO] running `"docker" "start" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] running `"docker" "inspect" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-w" "/opt/rustwide/workdir" "--user" "0:0" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "metadata" "--no-deps" "--format-version=1"` [INFO] running `"docker" "inspect" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-w" "/opt/rustwide/workdir" "--user" "0:0" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "build" "--frozen" "--message-format=json" "--release"` [INFO] [stderr] Compiling autocfg v1.4.0 [INFO] [stderr] Compiling proc-macro2 v1.0.107 [INFO] [stderr] Compiling quote v1.0.47 [INFO] [stderr] Compiling unicode-ident v1.0.14 [INFO] [stderr] Compiling memchr v2.8.3 [INFO] [stderr] Compiling libc v0.2.189 [INFO] [stderr] Compiling utf8parse v0.2.2 [INFO] [stderr] Compiling anstyle-query v1.1.2 [INFO] [stderr] Compiling anstyle-parse v1.0.0 [INFO] [stderr] Compiling is_terminal_polyfill v1.70.1 [INFO] [stderr] Compiling heck v0.5.0 [INFO] [stderr] Compiling cfg_aliases v0.2.1 [INFO] [stderr] Compiling anstyle v1.0.14 [INFO] [stderr] Compiling regex-syntax v0.8.11 [INFO] [stderr] Compiling colorchoice v1.0.3 [INFO] [stderr] Compiling nix v0.31.3 [INFO] [stderr] Compiling smallvec v1.16.4 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Compiling log v0.4.34 [INFO] [stderr] Compiling anstream v1.0.0 [INFO] [stderr] Compiling syn v3.0.6 [INFO] [stderr] Compiling libm v0.2.16 [INFO] [stderr] Compiling cfg-if v1.0.5 [INFO] [stderr] Compiling syn v2.0.119 [INFO] [stderr] Compiling nibble_vec v0.1.0 [INFO] [stderr] Compiling eyre v0.6.14 [INFO] [stderr] Compiling bigdecimal v0.4.11 [INFO] [stderr] Compiling clap_lex v1.1.1 [INFO] [stderr] Compiling num-integer v0.1.46 [INFO] [stderr] Compiling thiserror v2.0.21 [INFO] [stderr] Compiling jiff-core v0.1.1 [INFO] [stderr] Compiling endian-type v0.2.0 [INFO] [stderr] Compiling bitflags v2.13.2 [INFO] [stderr] Compiling strsim v0.11.1 [INFO] [stderr] Compiling clap_builder v4.6.7 [INFO] [stderr] Compiling dirs-sys-next v0.1.2 [INFO] [stderr] Compiling jiff v0.2.37 [INFO] [stderr] Compiling regex-automata v0.4.18 [INFO] [stderr] Compiling strum_macros v0.28.0 [INFO] [stderr] Compiling thiserror-impl v2.0.21 [INFO] [stderr] Compiling clap_derive v4.6.7 [INFO] [stderr] Compiling regex v1.13.1 [INFO] [stderr] Compiling radix_trie v0.3.0 [INFO] [stderr] Compiling env_filter v2.0.0 [INFO] [stderr] Compiling num-bigint v0.4.6 [INFO] [stderr] Compiling equivalent v1.0.3 [INFO] [stderr] Compiling unicode-width v0.2.2 [INFO] [stderr] Compiling indenter v0.3.4 [INFO] [stderr] Compiling unicode-segmentation v1.12.0 [INFO] [stderr] Compiling hashbrown v0.17.1 [INFO] [stderr] Compiling home v0.5.12 [INFO] [stderr] Compiling once_cell v1.20.2 [INFO] [stderr] Compiling rustyline v18.0.1 [INFO] [stderr] Compiling indexmap v2.14.2 [INFO] [stderr] Compiling clap v4.6.7 [INFO] [stderr] Compiling env_logger v0.11.11 [INFO] [stderr] Compiling strum v0.28.0 [INFO] [stderr] Compiling dirs-next v2.0.0 [INFO] [stderr] Compiling nom v8.0.0 [INFO] [stderr] Compiling flt v0.4.0 (/opt/rustwide/workdir) [INFO] [stderr] warning: unused dependency `env_logger` [INFO] [stderr] --> Cargo.toml:16:15 [INFO] [stderr] | [INFO] [stderr] 16 | [dependencies.env_logger] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `cargo::unused_dependencies` is set to `warn` by default [INFO] [stderr] help: consider removing the dependency on `env_logger` [INFO] [stderr] warning: `flt` (manifest) generated 1 warning [INFO] [stderr] Finished `release` profile [optimized] target(s) in 1m 59s [INFO] running `"docker" "inspect" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-w" "/opt/rustwide/workdir" "--user" "0:0" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "test" "--frozen" "--no-run" "--message-format=json" "--release"` [INFO] [stderr] Compiling syn v2.0.119 [INFO] [stderr] Compiling memchr v2.8.3 [INFO] [stderr] Compiling bitflags v2.13.2 [INFO] [stderr] Compiling rustix v1.1.4 [INFO] [stderr] Compiling unicode-segmentation v1.12.0 [INFO] [stderr] Compiling serde_core v1.0.229 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Compiling unicode-xid v0.2.6 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling serde v1.0.229 [INFO] [stderr] Compiling convert_case v0.10.0 [INFO] [stderr] Compiling serde_derive v1.0.229 [INFO] [stderr] Compiling futures-core v0.3.34 [INFO] [stderr] Compiling futures-sink v0.3.34 [INFO] [stderr] Compiling pin-project-lite v0.2.15 [INFO] [stderr] Compiling serde_json v1.0.134 [INFO] [stderr] Compiling futures-channel v0.3.34 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Compiling nom v8.0.0 [INFO] [stderr] Compiling regex-automata v0.4.18 [INFO] [stderr] Compiling futures-macro v0.3.34 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Compiling ryu v1.0.18 [INFO] [stderr] Compiling parking_lot_core v0.9.10 [INFO] [stderr] Compiling terminal_size v0.4.4 [INFO] [stderr] Compiling futures-task v0.3.34 [INFO] [stderr] Compiling itoa v1.0.14 [INFO] [stderr] Compiling regex-syntax v0.8.11 [INFO] [stderr] Compiling futures-io v0.3.34 [INFO] [stderr] Compiling futures-util v0.3.34 [INFO] [stderr] Compiling clap_builder v4.6.7 [INFO] [stderr] Compiling crossbeam-epoch v0.9.18 [INFO] [stderr] Compiling regex v1.13.1 [INFO] [stderr] Compiling derive_more-impl v2.1.1 [INFO] [stderr] Compiling sealed v0.6.0 [INFO] [stderr] Compiling synthez-core v0.4.0 [INFO] [stderr] Compiling bstr v1.11.1 [INFO] [stderr] Compiling either v1.13.0 [INFO] [stderr] Compiling scopeguard v1.2.0 [INFO] [stderr] Compiling bytecount v0.6.8 [INFO] [stderr] Compiling same-file v1.0.6 [INFO] [stderr] Compiling peg-runtime v0.6.3 [INFO] [stderr] Compiling clap v4.6.7 [INFO] [stderr] Compiling walkdir v2.5.0 [INFO] [stderr] Compiling peg-macros v0.6.3 [INFO] [stderr] Compiling globset v0.4.15 [INFO] [stderr] Compiling synthez-codegen v0.4.0 [INFO] [stderr] Compiling nix v0.31.3 [INFO] [stderr] Compiling futures-executor v0.3.34 [INFO] [stderr] Compiling env_filter v2.0.0 [INFO] [stderr] Compiling typed-builder-macro v0.23.2 [INFO] [stderr] Compiling derive_more v2.1.1 [INFO] [stderr] Compiling gherkin v0.16.0 [INFO] [stderr] Compiling strum_macros v0.28.0 [INFO] [stderr] Compiling nom_locate v5.0.0 [INFO] [stderr] Compiling crossbeam-deque v0.8.6 [INFO] [stderr] Compiling unicode-linebreak v0.1.5 [INFO] [stderr] Compiling getrandom v0.4.3 [INFO] [stderr] Compiling unicode-width v0.1.14 [INFO] [stderr] Compiling anyhow v1.0.95 [INFO] [stderr] Compiling ref-cast v1.0.25 [INFO] [stderr] Compiling smawk v0.3.2 [INFO] [stderr] Compiling textwrap v0.16.1 [INFO] [stderr] Compiling peg v0.6.3 [INFO] [stderr] Compiling rustyline v18.0.1 [INFO] [stderr] Compiling typed-builder v0.23.2 [INFO] [stderr] Compiling parking_lot v0.12.3 [INFO] [stderr] Compiling ignore v0.4.23 [INFO] [stderr] Compiling strum v0.28.0 [INFO] [stderr] Compiling cucumber-expressions v0.5.0 [INFO] [stderr] Compiling env_logger v0.11.11 [INFO] [stderr] Compiling synthez v0.4.0 [INFO] [stderr] Compiling itertools v0.14.0 [INFO] [stderr] Compiling ref-cast-impl v1.0.25 [INFO] [stderr] Compiling pin-project-internal v1.1.7 [INFO] [stderr] Compiling inflections v1.1.1 [INFO] [stderr] Compiling globwalk v0.9.1 [INFO] [stderr] Compiling pin-project v1.1.7 [INFO] [stderr] Compiling cucumber-codegen v0.23.0 [INFO] [stderr] Compiling futures v0.3.34 [INFO] [stderr] Compiling smart-default v0.7.1 [INFO] [stderr] Compiling console v0.16.2 [INFO] [stderr] Compiling signal-hook-registry v1.4.2 [INFO] [stderr] Compiling mio v1.2.3 [INFO] [stderr] Compiling socket2 v0.6.5 [INFO] [stderr] Compiling serial_test_derive v4.0.1 [INFO] [stderr] Compiling tokio-macros v2.7.2 [INFO] [stderr] Compiling linktime-proc-macro v0.2.3 [INFO] [stderr] Compiling link-section v0.19.3 [INFO] [stderr] Compiling humantime v2.1.0 [INFO] [stderr] Compiling linked-hash-map v0.5.6 [INFO] [stderr] Compiling fastrand v2.5.0 [INFO] [stderr] Compiling inventory v0.3.16 [INFO] [stderr] Compiling bytes v1.9.0 [INFO] [stderr] Compiling chrono v0.4.45 [INFO] [stderr] Compiling ctor v1.0.13 [INFO] [stderr] Compiling tempfile v3.27.0 [INFO] [stderr] Compiling cucumber v0.23.0 [INFO] [stderr] Compiling serial_test v4.0.1 [INFO] [stderr] Compiling flt v0.4.0 (/opt/rustwide/workdir) [INFO] [stderr] Compiling tokio v1.53.1 [INFO] [stderr] Compiling shell-words v1.1.1 [INFO] [stderr] warning: unused dependency `env_logger` [INFO] [stderr] --> Cargo.toml:16:15 [INFO] [stderr] | [INFO] [stderr] 16 | [dependencies.env_logger] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `cargo::unused_dependencies` is set to `warn` by default [INFO] [stderr] help: consider removing the dependency on `env_logger` [INFO] [stderr] help: to still use for development builds, move to `dev-dependencies` [INFO] [stderr] warning: `flt` (manifest) generated 1 warning [INFO] [stderr] Finished `release` profile [optimized] target(s) in 3m 18s [INFO] running `"docker" "inspect" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] running `"docker" "exec" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-w" "/opt/rustwide/workdir" "--user" "0:0" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99" "/opt/rustwide/cargo-home/bin/cargo" "+1.100.0-beta.13" "test" "--frozen" "--release"` [INFO] [stderr] warning: unused dependency `env_logger` [INFO] [stderr] --> Cargo.toml:16:15 [INFO] [stderr] | [INFO] [stderr] 16 | [dependencies.env_logger] [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `cargo::unused_dependencies` is set to `warn` by default [INFO] [stderr] help: consider removing the dependency on `env_logger` [INFO] [stderr] help: to still use for development builds, move to `dev-dependencies` [INFO] [stderr] warning: `flt` (manifest) generated 1 warning [INFO] [stderr] Finished `release` profile [optimized] target(s) in 0.17s [INFO] [stderr] Running unittests src/lib.rs (/opt/rustwide/target/release/build/flt/ce3e42f65995c2bf/out/flt-ce3e42f65995c2bf) [INFO] [stdout] [INFO] [stdout] running 804 tests [INFO] [stdout] test ast::expr::tests::test_display_function_call ... ok [INFO] [stdout] test ast::expr::tests::test_display_elsif_chain_as_nested_if ... ok [INFO] [stdout] test ast::expr::tests::test_display_empty_block ... ok [INFO] [stdout] test ast::expr::tests::test_display_binary_expr ... ok [INFO] [stdout] test ast::expr::tests::test_display_ident ... ok [INFO] [stdout] test ast::expr::tests::test_display_field_access ... ok [INFO] [stdout] test ast::expr::tests::test_display_floor_division ... ok [INFO] [stdout] test ast::expr::tests::test_display_block ... ok [INFO] [stdout] test ast::expr::tests::test_display_if_expr ... ok [INFO] [stdout] test ast::expr::tests::test_display_literal_string ... ok [INFO] [stdout] test ast::expr::tests::test_display_literal_boolean ... ok [INFO] [stdout] test ast::expr::tests::test_display_if_expr_with_block_branches ... ok [INFO] [stdout] test ast::expr::tests::test_display_key_value_quotes_keys_that_are_not_bare_names ... ok [INFO] [stdout] test ast::expr::tests::test_display_literal_integer ... ok [INFO] [stdout] test ast::expr::tests::test_display_literal_symbol ... ok [INFO] [stdout] test ast::expr::tests::test_display_nested ... ok [INFO] [stdout] test ast::expr::tests::test_display_literal_number ... ok [INFO] [stdout] test ast::function::tests::test_a_pattern_is_positional_and_has_the_type_of_its_literal ... ok [INFO] [stdout] test ast::function::tests::test_display ... ok [INFO] [stdout] test ast::function::tests::test_display_a_pattern ... ok [INFO] [stdout] test ast::expr::tests::test_display_parenthesized ... ok [INFO] [stdout] test ast::function::tests::test_display_declaration_without_a_body_or_return_type ... ok [INFO] [stdout] test ast::function::tests::test_param_order ... ok [INFO] [stdout] test ast::expr::tests::test_display_unary_expr ... ok [INFO] [stdout] test ast::function::tests::test_display_declaration ... ok [INFO] [stdout] test ast::expr::tests::test_display_whole_literal_number_with_a_decimal_point ... ok [INFO] [stdout] test ast::identifier::tests::test_identifier_eq_str ... ok [INFO] [stdout] test ast::keywords::tests::test_keyword_spellings ... ok [INFO] [stdout] test ast::literal::tests::test_display_integer_literal ... ok [INFO] [stdout] test ast::identifier::tests::test_identifier_validation ... ok [INFO] [stdout] test ast::keywords::tests::test_from_name_rejects_other_words ... ok [INFO] [stdout] test ast::keywords::tests::test_from_name_round_trips_with_display ... ok [INFO] [stdout] test ast::literal::tests::test_literal_from_f64_is_a_number ... ok [INFO] [stdout] test ast::literal::tests::test_literal_from_f64 ... ok [INFO] [stdout] test ast::literal::tests::test_display_number_literal ... ok [INFO] [stdout] test ast::literal::tests::test_parse_none_rejects_other ... ok [INFO] [stdout] test ast::statement::tests::test_display_assignment ... ok [INFO] [stdout] test ast::literal::tests::test_parse_none ... ok [INFO] [stdout] test ast::literal::tests::test_parse_none_with_remainder ... ok [INFO] [stdout] test ast::statement::tests::test_contains_return ... ok [INFO] [stdout] test ast::literal::tests::test_literal_from_i64_is_an_integer ... ok [INFO] [stdout] test ast::statement::tests::test_a_constant_is_not_a_declaration ... ok [INFO] [stdout] test ast::statement::tests::test_contains_return_in_a_constant ... ok [INFO] [stdout] test ast::statement::tests::test_display_constant ... ok [INFO] [stdout] test ast::statement::tests::test_display_typed_declaration ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_adds_the_lists_of_a_body_and_its_blocks ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_in_a_let_and_in_operands ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_in_blocks_and_arms ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_ignores_a_return_in_another_list ... ok [INFO] [stdout] test ast::statement::tests::test_display_typed_constant ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_in_the_else_arm_and_the_condition ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_of_a_return_at_the_end ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_of_statements_after_a_return ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_searches_the_expression_of_a_return ... ok [INFO] [stdout] test ast::statement::tests::test_display_declaration ... ok [INFO] [stdout] test ast::statement::tests::test_display_return ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_counts_the_first_return_only ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_does_not_search_unreachable_statements ... ok [INFO] [stdout] test ast::statement::tests::test_unreachable_lists_of_a_list_without_a_return ... ok [INFO] [stdout] test errors::tests::test_native_error_displays_as_the_host_error ... ok [INFO] [stdout] test errors::tests::test_native_error_downcasts_to_the_host_error ... ok [INFO] [stdout] test eval::tests::test_eval_array_literal ... ok [INFO] [stdout] test eval::tests::test_eval_binary_add ... ok [INFO] [stdout] test eval::tests::test_eval_array_mixed_types ... ok [INFO] [stdout] test eval::tests::test_eval_array_propagates_element_error ... ok [INFO] [stdout] test eval::tests::test_eval_binary_and ... ok [INFO] [stdout] test ast::type_expr::tests::test_display_name ... ok [INFO] [stdout] test ast::type_expr::tests::test_display_brackets_a_nested_union ... ok [INFO] [stdout] test ast::type_expr::tests::test_display_union ... ok [INFO] [stdout] test errors::tests::test_cannot_register_error_message ... ok [INFO] [stdout] test errors::tests::test_runtime_errors_for_native_values ... ok [INFO] [stdout] test eval::tests::test_eval_binary_concat_coerces_to_string ... ok [INFO] [stdout] test eval::tests::test_eval_binary_div ... ok [INFO] [stdout] test eval::tests::test_eval_binary_concat ... ok [INFO] [stdout] test eval::tests::test_eval_binary_concat_chain ... ok [INFO] [stdout] test eval::tests::test_eval_binary_div_by_zero ... ok [INFO] [stdout] test eval::tests::test_eval_binary_pipe_chain ... ok [INFO] [stdout] test eval::tests::test_eval_binary_eq ... ok [INFO] [stdout] test eval::tests::test_eval_binary_or ... ok [INFO] [stdout] test eval::tests::test_eval_binary_gt_lt_gte_lte ... ok [INFO] [stdout] test eval::tests::test_eval_binary_mul ... ok [INFO] [stdout] test eval::tests::test_eval_binary_pipe_into_bare_name ... ok [INFO] [stdout] test eval::tests::test_eval_binary_pipe_into_call ... ok [INFO] [stdout] test eval::tests::test_eval_binary_pipe_into_non_call ... ok [INFO] [stdout] test eval::tests::test_eval_binary_xor ... ok [INFO] [stdout] test eval::tests::test_eval_binary_sub ... ok [INFO] [stdout] test eval::tests::test_eval_concat_converts_numbers_as_they_print ... ok [INFO] [stdout] test eval::tests::test_eval_dividing_by_zero ... ok [INFO] [stdout] test eval::tests::test_eval_division_with_a_number_gives_a_number ... ok [INFO] [stdout] test eval::tests::test_eval_chained_field_access ... ok [INFO] [stdout] test eval::tests::test_eval_field_access_on_map_literal ... ok [INFO] [stdout] test eval::tests::test_eval_field_access_on_non_map ... ok [INFO] [stdout] test eval::tests::test_eval_floor_division ... ok [INFO] [stdout] test eval::tests::test_eval_empty_array ... ok [INFO] [stdout] test eval::tests::test_eval_floor_division_takes_only_integers ... ok [INFO] [stdout] test eval::tests::test_eval_if_expr_without_else_returns_none ... ok [INFO] [stdout] test eval::tests::test_eval_ident_unbound ... ok [INFO] [stdout] test eval::tests::test_eval_if_expr_condition_must_be_boolean ... ok [INFO] [stdout] test eval::tests::test_eval_if_expr_with_else ... ok [INFO] [stdout] test eval::tests::test_eval_integer_arithmetic_stays_integer ... ok [INFO] [stdout] test eval::tests::test_eval_literal_boolean ... ok [INFO] [stdout] test eval::tests::test_eval_integer_division_floors ... ok [INFO] [stdout] test eval::tests::test_eval_integers_and_numbers_compare_by_value ... ok [INFO] [stdout] test eval::tests::test_eval_literal_number ... ok [INFO] [stdout] test eval::tests::test_eval_integers_dont_overflow ... ok [INFO] [stdout] test eval::tests::test_eval_literal_numbers_print_with_their_decimal_point ... ok [INFO] [stdout] test eval::tests::test_eval_mixed_arithmetic_gives_a_number ... ok [INFO] [stdout] test eval::tests::test_eval_number_division_keeps_100_significant_digits ... ok [INFO] [stdout] test eval::tests::test_eval_literal_string ... ok [INFO] [stdout] test eval::tests::test_eval_literal_symbol ... ok [INFO] [stdout] test eval::tests::test_eval_nested_array ... ok [INFO] [stdout] test eval::tests::test_eval_typeof_arity_mismatch ... ok [INFO] [stdout] test eval::tests::test_eval_parenthesized ... ok [INFO] [stdout] test eval::tests::test_eval_string_interpolation ... ok [INFO] [stdout] test eval::tests::test_eval_typeof_array ... ok [INFO] [stdout] test eval::tests::test_eval_one_plus_one_returns_two ... ok [INFO] [stdout] test eval::tests::test_eval_typeof_tells_integers_and_numbers_apart ... ok [INFO] [stdout] test eval::tests::test_eval_unary_minus ... ok [INFO] [stdout] test eval::tests::test_eval_unary_minus_invalid_type ... ok [INFO] [stdout] test eval::tests::test_eval_unary_not_false ... ok [INFO] [stdout] test eval::tests::test_eval_unary_not_invalid_type ... ok [INFO] [stdout] test eval::tests::test_eval_unary_not_true ... ok [INFO] [stdout] test eval::tests::test_eval_unary_on_numbers ... ok [INFO] [stdout] test eval::tests::test_eval_typeof_integer ... ok [INFO] [stdout] test eval::tests::test_eval_unary_plus ... ok [INFO] [stdout] test eval::tests::test_eval_typeof_number ... ok [INFO] [stdout] test eval::tests::test_eval_undefined_function ... ok [INFO] [stdout] test parser::array::tests::test_parse_empty_array ... ok [INFO] [stdout] test parser::array::tests::test_parse_nested_expr ... ok [INFO] [stdout] test parser::array::tests::test_parse_single_element ... ok [INFO] [stdout] test parser::array::tests::test_parse_trailing_comma ... ok [INFO] [stdout] test parser::boolean::tests::test_parse_boolean_with_remainder ... ok [INFO] [stdout] test parser::boolean::tests::test_parse_true ... ok [INFO] [stdout] test parser::error::tests::test_duplicate_keyword_message ... ok [INFO] [stdout] test parser::error::tests::test_into_error ... ok [INFO] [stdout] test parser::expr::tests::test_parse_arithmetic_binds_tighter_than_pipe ... ok [INFO] [stdout] test parser::expr::tests::test_parse_binary ... ok [INFO] [stdout] test eval::tests::test_eval_typeof_string ... ok [INFO] [stdout] test parser::array::tests::test_parse_multiple_elements ... ok [INFO] [stdout] test parser::boolean::tests::test_parse_false ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_as_an_argument ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_is_not_an_argument_without_parentheses ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_as_an_operand ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_needs_a_separator_between_statements_on_one_line ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_with_comments ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_with_statements_on_one_line ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block_with_statements_on_separate_lines ... ok [INFO] [stdout] test parser::expr::tests::test_parse_call_forms_next_to_pipe ... ok [INFO] [stdout] test parser::expr::tests::test_parse_call_without_parens_allows_pipe_in_interpolation ... ok [INFO] [stdout] test parser::expr::tests::test_parse_call_without_parens_rejects_piped_argument ... ok [INFO] [stdout] test parser::expr::tests::test_parse_binary_add_spacing_variants ... ok [INFO] [stdout] test parser::expr::tests::test_parse_block ... ok [INFO] [stdout] test parser::expr::tests::test_parse_comparisons_bind_looser_than_arithmetic ... ok [INFO] [stdout] test parser::expr::tests::test_parse_chained_field_access ... ok [INFO] [stdout] test parser::expr::tests::test_parse_compact_if_does_not_take_end ... ok [INFO] [stdout] test parser::expr::tests::test_parse_elsif_is_a_nested_if_in_the_else_arm ... ok [INFO] [stdout] test parser::expr::tests::test_parse_comparisons_bind_looser_than_bitwise ... ok [INFO] [stdout] test parser::expr::tests::test_parse_elsif_misuse_fails ... ok [INFO] [stdout] test parser::expr::tests::test_parse_elsif_condition_is_an_expression ... ok [INFO] [stdout] test parser::expr::tests::test_parse_elsif_chains ... ok [INFO] [stdout] test parser::expr::tests::test_parse_elsif_printed_form_parses_back ... ok [INFO] [stdout] test parser::expr::tests::test_parse_empty_braces_as_an_if_arm_is_an_empty_block ... ok [INFO] [stdout] test parser::expr::tests::test_parse_empty_braces_is_an_empty_map ... ok [INFO] [stdout] test parser::expr::tests::test_parse_equality_binds_looser_than_ordering ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_is_the_same_as_the_compact_if ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_inside_a_brace_block ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_with_empty_arms ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_leaves_what_follows_end ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_needs_end ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_with_statements ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_statements_need_a_separator ... ok [INFO] [stdout] test parser::expr::tests::test_parse_field_access_on_map_literal ... ok [INFO] [stdout] test parser::expr::tests::test_parse_field_access ... ok [INFO] [stdout] test parser::expr::tests::test_parse_floor_division ... ok [INFO] [stdout] test parser::expr::tests::test_parse_field_access_no_whitespace_allowed ... ok [INFO] [stdout] test parser::expr::tests::test_parse_floor_division_binds_like_multiplication ... ok [INFO] [stdout] test parser::expr::tests::test_parse_function_call_with_kv_pairs ... ok [INFO] [stdout] test parser::expr::tests::test_parse_identifier ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_arms_on_separate_lines ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_arms_with_statements ... ok [INFO] [stdout] test parser::expr::tests::test_parse_function_call ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_condition_ending_in_pipe_into_bare_name ... ok [INFO] [stdout] test parser::expr::tests::test_parse_function_call_kv_only ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_expr_block_and_optional_else ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_condition_with_field_access ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_with_a_block_arm_does_not_take_the_next_line_as_its_arm ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_condition_precedence ... ok [INFO] [stdout] test parser::expr::tests::test_parse_key_and_colon_starts_a_map ... ok [INFO] [stdout] test parser::expr::tests::test_parse_keyword ... ok [INFO] [stdout] test parser::expr::tests::test_parse_logical_binds_looser_than_comparisons ... ok [INFO] [stdout] test parser::expr::tests::test_parse_map_is_an_argument_without_parentheses ... ok [INFO] [stdout] test parser::expr::tests::test_parse_map_as_an_if_arm_is_a_map ... ok [INFO] [stdout] test parser::expr::tests::test_parse_nested_expanded_ifs ... ok [INFO] [stdout] test parser::expr::tests::test_parse_nested_blocks ... ok [INFO] [stdout] test parser::expr::tests::test_parse_if_expr_expression_branches ... ok [INFO] [stdout] test parser::expr::tests::test_parse_parenthesized_braces_as_an_if_arm_is_an_empty_map ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe ... ok [INFO] [stdout] test eval::tests::test_eval_binary_ne ... ok [INFO] [stdout] test eval::tests::test_eval_collections_compare_integers_and_numbers_by_value ... ok [INFO] [stdout] test eval::tests::test_eval_field_access_not_found ... ok [INFO] [stdout] test parser::expr::tests::test_parse_comments ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_binds_tighter_than_bitwise ... ok [INFO] [stdout] test parser::expr::tests::test_parse_expanded_if_without_else ... ok [INFO] [stdout] test parser::expr::tests::test_parse_number ... ok [INFO] [stdout] test parser::expr::tests::test_parse_parenthesized ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_with_function_calls_and_symbols ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_with_function_calls ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_binds_tighter_than_comparisons_and_logical ... ok [INFO] [stdout] test parser::expr::tests::test_parse_symbol ... ok [INFO] [stdout] test parser::expr::tests::test_parse_unary ... ok [INFO] [stdout] test parser::expr::tests::test_parse_unary_binds_looser_than_dot ... ok [INFO] [stdout] test parser::expr::tests::test_parse_unclosed_block_fails ... ok [INFO] [stdout] test parser::expr::tests::test_parse_precedence ... ok [INFO] [stdout] test parser::expr::tests::test_parse_string ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_into_call_without_parens_leaves_arguments_unparsed ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_with_kv_pairs ... ok [INFO] [stdout] test parser::expr::tests::test_parse_string_concat ... ok [INFO] [stdout] test parser::function::tests::test_a_minus_followed_by_a_space_is_not_the_start_of_an_argument ... ok [INFO] [stdout] test parser::expr::tests::test_parse_pipe_with_parenthesized_calls ... ok [INFO] [stdout] test parser::expr::tests::test_parse_string_interpolation ... ok [INFO] [stdout] test parser::function::tests::test_end_is_not_an_argument ... ok [INFO] [stdout] test parser::function::tests::test_parse_positional_after_kv_fails ... ok [INFO] [stdout] test parser::function::tests::test_parse_floor ... ok [INFO] [stdout] test parser::function::tests::test_parse_else_elsif_and_end_do_not_start_an_argument ... ok [INFO] [stdout] test parser::function::tests::test_parse_trim ... ok [INFO] [stdout] test parser::function::tests::test_parse_round ... ok [INFO] [stdout] test parser::function::tests::test_parse_without_parens_multiple_args ... ok [INFO] [stdout] test parser::function::tests::test_parse_without_parens_single_arg ... ok [INFO] [stdout] test parser::function::tests::test_parse_with_only_kv_pairs ... ok [INFO] [stdout] test parser::function::tests::test_parse_without_parens_trailing_kv_pairs ... ok [INFO] [stdout] test parser::function::tests::test_parse_duplicate_keyword_fails ... ok [INFO] [stdout] test parser::function::tests::test_parse_keywords_differ_from_a_map_argument ... ok [INFO] [stdout] test parser::function::tests::test_display_round_trips ... ok [INFO] [stdout] test parser::function::tests::test_parse_with_quoted_kv_key ... ok [INFO] [stdout] test parser::keyword::tests::test_parse_keywords ... ok [INFO] [stdout] test parser::literal::tests::test_parse_boolean_literal ... ok [INFO] [stdout] test parser::literal::tests::test_parse_none_literal ... ok [INFO] [stdout] test parser::literal::tests::test_parse_literal_with_remainder ... ok [INFO] [stdout] test parser::literal::tests::test_parse_integer_literal ... ok [INFO] [stdout] test parser::literal::tests::test_parse_number_literal ... ok [INFO] [stdout] test parser::literal::tests::test_parse_symbol_literal ... ok [INFO] [stdout] test parser::literal::tests::test_parse_string_literal ... ok [INFO] [stdout] test parser::map::tests::test_parse_multiple_entries ... ok [INFO] [stdout] test parser::map::tests::test_parse_quoted_key ... ok [INFO] [stdout] test parser::map::tests::test_parse_single_bare_key_number_value ... ok [INFO] [stdout] test parser::map::tests::test_parse_trailing_comma ... ok [INFO] [stdout] test parser::number::tests::test_parse_decimal ... ok [INFO] [stdout] test parser::map::tests::test_parse_empty_map ... ok [INFO] [stdout] test parser::function::tests::test_parse_with_trailing_kv_pairs ... ok [INFO] [stdout] test parser::identifier::tests::test_parse_identifier ... ok [INFO] [stdout] test parser::number::tests::test_parse_dot_without_fractional_digits_leaves_the_dot ... ok [INFO] [stdout] test parser::keyword::tests::test_parse_keyword_with_remainder ... ok [INFO] [stdout] test parser::keyword::tests::test_keyword_word_boundary ... ok [INFO] [stdout] test parser::function::tests::test_parse_ceil ... ok [INFO] [stdout] test parser::number::tests::test_parse_integer ... ok [INFO] [stdout] test parser::number::tests::test_parse_integer_with_arbitrary_precision ... ok [INFO] [stdout] test parser::number::tests::test_parse_number_with_remainder ... ok [INFO] [stdout] test parser::number::tests::test_parse_integer_then_floor_division ... ok [INFO] [stdout] test parser::number::tests::test_parse_number_with_underscores ... ok [INFO] [stdout] test parser::number::tests::test_parse_positive_decimal ... ok [INFO] [stdout] test parser::number::tests::test_parse_positive_integer ... ok [INFO] [stdout] test parser::operands::tests::test_parse_binary_op_double_char ... ok [INFO] [stdout] test parser::operands::tests::test_parse_binary_op_double_char_not_consumed_as_single ... ok [INFO] [stdout] test parser::number::tests::test_parse_negative_integer ... ok [INFO] [stdout] test parser::map::tests::test_parse_single_bare_key_string_value ... ok [INFO] [stdout] test parser::operands::tests::test_parse_binary_op_single_char ... ok [INFO] [stdout] test parser::operands::tests::test_parse_binary_op_with_remainder ... ok [INFO] [stdout] test parser::operands::tests::test_parse_floor_division_op ... ok [INFO] [stdout] test parser::operands::tests::test_parse_unary_op_with_remainder ... ok [INFO] [stdout] test parser::statement::tests::test_const_def_in_a_statement_list ... ok [INFO] [stdout] test parser::statement::tests::test_def_is_not_an_identifier_or_binding_name ... ok [INFO] [stdout] test parser::number::tests::test_parse_negative_decimal ... ok [INFO] [stdout] test parser::statement::tests::test_name_starting_with_keyword_is_a_binding_name ... ok [INFO] [stdout] test parser::statement::tests::test_const_followed_by_a_name_that_starts_with_def_is_a_constant ... ok [INFO] [stdout] test parser::statement::tests::test_const_def_checks_the_same_rules_as_def ... ok [INFO] [stdout] test parser::statement::tests::test_keyword_is_not_a_binding_name ... ok [INFO] [stdout] test parser::statement::tests::test_a_name_that_starts_with_const_is_a_name ... ok [INFO] [stdout] test parser::operands::tests::test_parse_unary_op ... ok [INFO] [stdout] test parser::statement::tests::test_parse_arm_gives_its_statements ... ok [INFO] [stdout] test parser::statement::tests::test_a_const_def_is_not_the_same_statement_as_a_def ... ok [INFO] [stdout] test parser::statement::tests::test_parse_arm_can_be_empty ... ok [INFO] [stdout] test parser::statement::tests::test_parse_bare_return ... ok [INFO] [stdout] test parser::statement::tests::test_parse_arm_does_not_stop_at_a_longer_name ... ok [INFO] [stdout] test parser::statement::tests::test_parse_arm_without_a_closer_fails ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_def_display_parses_back_to_the_same_statement ... ok [INFO] [stdout] test parser::statement::tests::test_parse_arm_needs_a_separator_between_statements ... ok [INFO] [stdout] test parser::statement::tests::test_parse_arm_stops_at_else_elsif_and_end ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_needs_a_name_a_value_and_a_binding_name ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_statement_with_expr ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_statement ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_with_comments_and_separators ... ok [INFO] [stdout] test parser::statement::tests::test_parse_assignment_without_let ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_accepts_each_kind_of_literal_pattern ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_display_parses_back_to_the_same_statement ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_accepts_a_name_starting_with_a_keyword ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_def_accepts_every_kind_of_parameter ... ok [INFO] [stdout] test parser::statement::tests::test_parse_const_def_accepts_patterns ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_accepts_patterns_with_other_parameters ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_rejects_a_keyword_as_the_function_name ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_accepts_every_kind_of_parameter ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_rejects_a_pattern_outside_a_positional_parameter ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_rejects_malformed_declarations ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_rejects_parameters_in_the_wrong_order ... ok [INFO] [stdout] test parser::statement::tests::test_parse_let_statement_fails_without_equals ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_rejects_a_repeated_parameter_name ... ok [INFO] [stdout] test parser::statement::tests::test_parse_let_statement_no_spaces ... ok [INFO] [stdout] test parser::statement::tests::test_parse_let_statement_with_expr ... ok [INFO] [stdout] test parser::statement::tests::test_parse_let_statement_optional_semicolon ... ok [INFO] [stdout] test parser::statement::tests::test_parse_let_statement_newline_no_semicolon_required ... ok [INFO] [stdout] test parser::statement::tests::test_parse_expr_statement_binary_with_semicolon ... ok [INFO] [stdout] test parser::statement::tests::test_parse_expr_statement_number ... ok [INFO] [stdout] test parser::statement::tests::test_parse_let_statement ... ok [INFO] [stdout] test parser::statement::tests::test_parse_return ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_fails_on_a_syntax_error ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_fails_on_a_def_without_end ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_needs_a_separator_after_end ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_needs_a_separator_on_one_line ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_reads_a_def_with_comments_and_semicolons ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_reads_two_defs ... ok [INFO] [stdout] test parser::statement::tests::test_parse_two_statements_same_line ... ok [INFO] [stdout] test parser::statement::tests::test_parse_type_only_after_let ... ok [INFO] [stdout] test parser::statement::tests::test_parse_typed_const_statement_with_union ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_reads_a_def_then_the_next_statement ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_separated_by_semicolons_or_newlines ... ok [INFO] [stdout] test parser::statement::tests::test_parse_typed_let_statement ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_with_an_expanded_if ... ok [INFO] [stdout] test parser::statement::tests::test_parse_typed_let_statement_with_union ... ok [INFO] [stdout] test parser::statement::tests::test_parse_statements_of_empty_source ... ok [INFO] [stdout] test parser::statement::tests::test_return_expression_is_on_the_same_line ... ok [INFO] [stdout] test parser::statement::tests::test_parse_def_rejects_what_is_not_a_literal_pattern ... ok [INFO] [stdout] test parser::string::tests::test_parse_empty_string ... ok [INFO] [stdout] test parser::string::tests::test_parse_interpolated_string_consecutive ... ok [INFO] [stdout] test parser::statement::tests::test_return_in_a_function_body ... ok [INFO] [stdout] test parser::statement::tests::test_return_in_a_block_in_a_function_body ... ok [INFO] [stdout] test parser::statement::tests::test_return_in_a_parameter_default_is_a_parse_error ... ok [INFO] [stdout] test parser::string::tests::test_parse_interpolated_string_simple ... ok [INFO] [stdout] test parser::statement::tests::test_return_outside_a_function_is_a_parse_error ... ok [INFO] [stdout] test parser::statement::tests::test_parse_typed_const_statement ... ok [INFO] [stdout] test parser::statement::tests::test_return_of_a_pipe ... ok [INFO] [stdout] test parser::string::tests::test_parse_interpolated_string_escaped_brace ... ok [INFO] [stdout] test parser::string::tests::test_parse_simple_string ... ok [INFO] [stdout] test parser::type_expr::tests::test_parse_type_rejects_non_names ... ok [INFO] [stdout] test parser::symbol::tests::test_parse_symbol_string ... ok [INFO] [stdout] test parser::type_expr::tests::test_parse_type_stops_before_or_and_pipe ... ok [INFO] [stdout] test parser::type_expr::tests::test_parse_union ... ok [INFO] [stdout] test repl::tests::run_file_reports_a_missing_file ... ok [INFO] [stdout] test parser::string::tests::test_parse_string_with_escaped_backslash ... ok [INFO] [stdout] test parser::string::tests::test_parse_string_with_escaped_quote ... ok [INFO] [stdout] test parser::type_expr::tests::test_parse_parenthesized_type ... ok [INFO] [stdout] test repl::tests::run_file_reports_a_syntax_error ... ok [INFO] [stdout] test repl::slash_commands::tests::test_slash_commands_lookup ... ok [INFO] [stdout] test parser::type_expr::tests::test_parse_type_name ... ok [INFO] [stdout] test repl::tests::test_history_path_from_falls_back_to_default ... ok [INFO] [stdout] test repl::tests::test_default_prompt ... ok [INFO] [stdout] test repl::tests::test_history_path_from_env_override ... ok [INFO] [stdout] test repl::tests::test_inspect_function_after_refused_binding ... ok [INFO] [stdout] test repl::tests::test_inspect_native_type ... ok [INFO] [stdout] test repl::tests::test_history_round_trip ... ok [INFO] [stdout] test parser::symbol::tests::test_parse_symbol_identifier ... ok [INFO] [stdout] test repl::tests::test_inspect_unbound_identifier ... ok [INFO] [stdout] test repl::tests::test_custom_prompt ... ok [INFO] [stdout] test repl::tests::test_new_takes_the_warnings_after_a_statement ... ok [INFO] [stdout] test repl::tests::run_file_runs_a_program ... ok [INFO] [stdout] test repl::tests::test_missing_history_file_is_ok ... ok [INFO] [stdout] test repl::tests::test_unset_function_keeps_it ... ok [INFO] [stdout] test repl::tests::test_unset_native_type ... ok [INFO] [stdout] test repl::tests::test_unset_unbound_identifier ... ok [INFO] [stdout] test repl::tests::test_unset_variable ... ok [INFO] [stdout] test repl::tests::test_no_history_path_writes_nothing ... ok [INFO] [stdout] test repl::tests::test_unset_builtin_type ... ok [INFO] [stdout] test repl::tests::test_unset_without_identifier ... ok [INFO] [stdout] test repl::tests::test_parse_error_names_a_repeated_keyword ... ok [INFO] [stdout] test repl::tests::test_unset_constant_removes_the_constant ... ok [INFO] [stdout] test repl::tests::test_with_runtime_leaves_the_warnings_to_the_host ... ok [INFO] [stdout] test repl::tests::test_save_creates_parent_dirs ... ok [INFO] [stdout] test runtime::functions::tests::test_a_handler_reads_numbers_as_big_ints_and_big_decimals ... ok [INFO] [stdout] test runtime::functions::tests::test_a_keyword_of_the_wrong_type_is_closer_than_one_not_accepted ... ok [INFO] [stdout] test repl::tests::test_with_runtime_uses_the_hosts_runtime ... ok [INFO] [stdout] test repl::tests::test_with_warnings_takes_the_warnings_of_the_hosts_runtime ... ok [INFO] [stdout] test repl::tests::test_inspect_builtin_function ... ok [INFO] [stdout] test repl::tests::test_inspect_variable ... ok [INFO] [stdout] test runtime::functions::tests::test_accepts ... ok [INFO] [stdout] test runtime::functions::tests::test_a_keyword_default_of_the_wrong_type_panics - should panic ... ok [INFO] [stdout] test runtime::functions::tests::test_a_narrower_overload_beats_any_declared_first ... ok [INFO] [stdout] test runtime::functions::tests::test_an_argument_is_read_by_name_whether_positional_or_keyword ... ok [INFO] [stdout] test runtime::functions::tests::test_a_tie_goes_to_the_overload_declared_first ... ok [INFO] [stdout] test runtime::functions::tests::test_a_number_parameter_converts_an_integer ... ok [INFO] [stdout] test runtime::functions::tests::test_an_argument_of_the_wrong_type_is_named ... ok [INFO] [stdout] test runtime::functions::tests::test_a_number_result_is_converted ... ok [INFO] [stdout] test runtime::functions::tests::test_argument_integer ... ok [INFO] [stdout] test runtime::functions::tests::test_an_integer_default_passes_an_integer_keywords_type_check ... ok [INFO] [stdout] test runtime::functions::tests::test_arity_still_comes_before_narrowness ... ok [INFO] [stdout] test runtime::functions::tests::test_an_integer_parameter_refuses_a_number ... ok [INFO] [stdout] test runtime::functions::tests::test_check_arity_accepts_any_overload ... ok [INFO] [stdout] test runtime::functions::tests::test_a_number_default_fails_an_integer_keywords_type_check - should panic ... ok [INFO] [stdout] test runtime::functions::tests::test_add_overload_panics_on_a_variadic_argument_that_isnt_last - should panic ... ok [INFO] [stdout] test runtime::functions::tests::test_declared_keywords_come_first_then_rest_keywords_in_call_order ... ok [INFO] [stdout] test runtime::functions::tests::test_count_errors_list_every_accepted_count ... ok [INFO] [stdout] test runtime::functions::tests::test_each_variadic_value_is_checked ... ok [INFO] [stdout] test runtime::functions::tests::test_declaring_a_keyword_twice_panics - should panic ... ok [INFO] [stdout] test runtime::functions::tests::test_a_union_converts_an_integer_only_if_no_member_accepts_it ... ok [INFO] [stdout] test runtime::functions::tests::test_function_without_keywords_rejects_them ... ok [INFO] [stdout] test runtime::functions::tests::test_get_raises_the_conversion_error ... ok [INFO] [stdout] test runtime::functions::tests::test_get_reads_positional_arguments_by_name ... ok [INFO] [stdout] test runtime::functions::tests::test_get_reads_declared_keywords_with_their_defaults ... ok [INFO] [stdout] test runtime::functions::tests::test_keyword_defaults_fill_in_and_call_values_override_them ... ok [INFO] [stdout] test runtime::functions::tests::test_keyword_values_and_defaults_are_converted ... ok [INFO] [stdout] test runtime::functions::tests::test_from_value_for_big_numbers ... ok [INFO] [stdout] test runtime::functions::tests::test_from_value_reads_none_as_none_for_an_option ... ok [INFO] [stdout] test runtime::functions::tests::test_keyword_values_are_checked ... ok [INFO] [stdout] test runtime::functions::tests::test_from_value_raises_an_error_for_a_value_that_does_not_convert ... ok [INFO] [stdout] test runtime::functions::tests::test_native_arguments_are_checked ... ok [INFO] [stdout] test runtime::functions::tests::test_native_borrows_a_native_value ... ok [INFO] [stdout] test runtime::functions::tests::test_names_are_those_of_the_overload_that_matched ... ok [INFO] [stdout] test runtime::functions::tests::test_native_function_closure_captures_state ... ok [INFO] [stdout] test runtime::functions::tests::test_native_function_call ... ok [INFO] [stdout] test runtime::functions::tests::test_native_function_equality_is_identity ... ok [INFO] [stdout] test runtime::functions::tests::test_native_function_call_checks_arity ... ok [INFO] [stdout] test runtime::functions::tests::test_native_function_name_and_type ... ok [INFO] [stdout] test runtime::functions::tests::test_no_overload_accepts_the_arguments ... ok [INFO] [stdout] test runtime::functions::tests::test_fixed_and_variadic_overloads ... ok [INFO] [stdout] test runtime::functions::tests::test_new_panics_on_a_variadic_argument_that_isnt_last - should panic ... ok [INFO] [stdout] test runtime::functions::tests::test_no_overload_accepts_the_keywords ... ok [INFO] [stdout] test runtime::functions::tests::test_fixed_arity_beats_a_variadic_overload_with_fewer_fixed_arguments ... ok [INFO] [stdout] test runtime::functions::tests::test_from_value_converts_to_rust_types ... ok [INFO] [stdout] test runtime::functions::tests::test_overload_is_picked_by_positional_count_before_keywords_are_checked ... ok [INFO] [stdout] test runtime::functions::tests::test_overloads_are_tried_by_arity_longest_first ... ok [INFO] [stdout] test runtime::functions::tests::test_overloads_that_are_each_narrower_for_one_argument_go_to_the_first_declared ... ok [INFO] [stdout] test runtime::functions::tests::test_overloads_that_fail_at_the_same_argument_name_none ... ok [INFO] [stdout] test runtime::functions::tests::test_reading_an_undeclared_name_is_a_handler_error ... ok [INFO] [stdout] test runtime::functions::tests::test_resolve_picks_the_narrowest_overload ... ok [INFO] [stdout] test runtime::functions::tests::test_rest_keywords_accept_a_keyword_of_the_wrong_type ... ok [INFO] [stdout] test runtime::functions::tests::test_positional_function_name_and_signature ... ok [INFO] [stdout] test runtime::functions::tests::test_rest_keywords_are_checked_against_their_type ... ok [INFO] [stdout] test runtime::functions::tests::test_reading_a_variadic_argument_by_name_is_a_handler_error ... ok [INFO] [stdout] test runtime::functions::tests::test_rest_keywords_are_in_keywords_but_have_no_names ... ok [INFO] [stdout] test runtime::functions::tests::test_the_return_value_is_checked ... ok [INFO] [stdout] test runtime::functions::tests::test_the_return_value_is_checked_against_the_overload_that_matched ... ok [INFO] [stdout] test runtime::functions::tests::test_type_of_overloads_is_union_of_function_types ... ok [INFO] [stdout] test runtime::functions::tests::test_type_of_single_overload_is_function_type ... ok [INFO] [stdout] test runtime::functions::tests::test_type_shows_keywords ... ok [INFO] [stdout] test runtime::functions::tests::test_type_shows_variadic ... ok [INFO] [stdout] test runtime::functions::tests::test_types_pick_among_overloads_of_the_same_arity ... ok [INFO] [stdout] test runtime::functions::tests::test_unexpected_keyword_is_an_error ... ok [INFO] [stdout] test runtime::functions::tests::test_rest_gives_the_variadic_values ... ok [INFO] [stdout] test runtime::functions::tests::test_value_tells_overloads_apart_by_their_names ... ok [INFO] [stdout] test runtime::functions::tests::test_keywords_pick_among_overloads_of_the_same_arity ... ok [INFO] [stdout] test runtime::functions::tests::test_rest_is_empty_without_a_variadic_argument ... ok [INFO] [stdout] test runtime::functions::tests::test_keywords_the_call_passes_count_towards_narrowness ... ok [INFO] [stdout] test runtime::functions::tests::test_variadic_rejects_undeclared_keywords ... ok [INFO] [stdout] test runtime::functions::tests::test_variadic_with_too_few_arguments ... ok [INFO] [stdout] test runtime::native::tests::test_downcast_native_of_another_native_type_names_it ... ok [INFO] [stdout] test runtime::native::tests::test_downcast_native_of_another_value_is_unexpected_type ... ok [INFO] [stdout] test runtime::native::tests::test_get_native_is_none_for_other_values ... ok [INFO] [stdout] test runtime::native::tests::test_native_type_info ... ok [INFO] [stdout] test runtime::native::tests::test_native_type_is_a_type ... ok [INFO] [stdout] test runtime::native::tests::test_native_value_debug_names_its_type ... ok [INFO] [stdout] test runtime::native::tests::test_native_value_displays_as_the_host_does ... ok [INFO] [stdout] test runtime::native::tests::test_native_value_round_trips ... ok [INFO] [stdout] test runtime::functions::tests::test_variadic_accepts_at_least_its_fixed_arguments ... ok [INFO] [stdout] test runtime::native::tests::test_native_values_compare_with_the_hosts_equality ... ok [INFO] [stdout] test runtime::functions::tests::test_variadic_handler_gets_every_value ... ok [INFO] [stdout] test runtime::native::tests::test_native_values_of_different_types_are_never_equal ... ok [INFO] [stdout] test runtime::native::tests::test_type_of_native_value_is_its_native_type ... ok [INFO] [stdout] test runtime::tests::test_a_constant_ends_with_its_scope ... ok [INFO] [stdout] test runtime::tests::test_a_copy_of_a_constant_is_a_variable ... ok [INFO] [stdout] test runtime::tests::test_a_def_cannot_add_an_overload_to_a_native_const_function ... ok [INFO] [stdout] test runtime::tests::test_a_def_function_can_call_const_and_other_functions ... ok [INFO] [stdout] test runtime::functions::tests::test_the_error_names_the_overload_that_passes_the_most_checks ... ok [INFO] [stdout] test runtime::tests::test_a_failed_hiding_declaration_gives_no_warning ... ok [INFO] [stdout] test runtime::functions::tests::test_the_narrowest_overload_is_called ... ok [INFO] [stdout] test runtime::tests::test_a_failed_pattern_names_its_position_and_the_value ... ok [INFO] [stdout] test runtime::tests::test_a_native_function_is_not_const_unless_the_host_marks_it ... ok [INFO] [stdout] test runtime::tests::test_a_native_function_marked_const_can_be_called_from_a_const_function ... ok [INFO] [stdout] test runtime::functions::tests::test_variadic_takes_declared_keywords ... ok [INFO] [stdout] test runtime::functions::tests::test_variadic_values_are_converted ... ok [INFO] [stdout] test runtime::tests::test_a_def_that_fails_gives_no_warning ... ok [INFO] [stdout] test runtime::tests::test_a_negative_pattern_matches_by_type_and_by_value ... ok [INFO] [stdout] test runtime::tests::test_a_parameter_hides_a_constant_without_a_warning ... ok [INFO] [stdout] test runtime::tests::test_a_pattern_matches_by_type_and_by_value ... ok [INFO] [stdout] test runtime::tests::test_a_pattern_runs_for_its_value_and_the_typed_name_for_the_others ... ok [INFO] [stdout] test runtime::tests::test_a_const_def_can_have_patterns ... ok [INFO] [stdout] test runtime::tests::test_a_rebind_does_not_evaluate_the_value ... ok [INFO] [stdout] test runtime::tests::test_a_constant_cannot_be_rebound_in_its_scope ... ok [INFO] [stdout] test runtime::tests::test_a_statement_after_a_return_gives_a_warning ... ok [INFO] [stdout] test runtime::tests::test_a_variable_becomes_a_constant ... ok [INFO] [stdout] test runtime::tests::test_a_warning_does_not_change_the_function ... ok [INFO] [stdout] test runtime::tests::test_all_overloads_of_a_function_are_const_or_none_is ... ok [INFO] [stdout] test runtime::tests::test_all_overloads_of_a_native_const_definition_have_a_const_type ... ok [INFO] [stdout] test runtime::tests::test_an_ordinary_shadowing_gives_no_warning ... ok [INFO] [stdout] test runtime::tests::test_a_function_declared_with_const_def_is_a_declared_function ... ok [INFO] [stdout] test runtime::tests::test_a_function_type_is_equal_only_if_both_are_const ... ok [INFO] [stdout] test runtime::tests::test_any_is_unbound ... ok [INFO] [stdout] test runtime::tests::test_a_pattern_counts_as_one_more_check_for_the_closest_overload ... ok [INFO] [stdout] test runtime::tests::test_assignment_in_a_body_does_not_count_in_a_global_variable ... ok [INFO] [stdout] test runtime::tests::test_a_pattern_is_part_of_the_parameter_signature ... ok [INFO] [stdout] test runtime::tests::test_bare_and_quoted_keys_are_the_same_key ... ok [INFO] [stdout] test runtime::tests::test_assignment_in_a_body_to_a_global_constant_is_a_rebind ... ok [INFO] [stdout] test runtime::tests::test_a_pattern_is_the_narrowest_overload ... ok [INFO] [stdout] test runtime::tests::test_a_recursive_function_ends_on_its_patterns ... ok [INFO] [stdout] test runtime::tests::test_assigning_a_constant_from_an_inner_scope_is_a_rebind ... ok [INFO] [stdout] test runtime::tests::test_assigning_after_hiding_changes_the_inner_variable ... ok [INFO] [stdout] test runtime::tests::test_block_assignment_keeps_to_the_declared_type ... ok [INFO] [stdout] test runtime::tests::test_a_return_as_the_last_statement_gives_no_warning ... ok [INFO] [stdout] test runtime::tests::test_block_cannot_bind_a_protected_name ... ok [INFO] [stdout] test runtime::tests::test_block_evaluates_to_its_last_statement ... ok [INFO] [stdout] test runtime::tests::test_block_in_a_function_body_sees_the_parameters ... ok [INFO] [stdout] test runtime::tests::test_block_in_a_function_body_does_not_see_the_blocks_of_the_caller ... ok [INFO] [stdout] test runtime::tests::test_block_assignment_to_an_unbound_name_declares_it_in_the_block ... ok [INFO] [stdout] test runtime::tests::test_block_in_a_body_cannot_read_a_global_variable ... ok [INFO] [stdout] test runtime::tests::test_assignment_in_a_body_declares_a_local_and_keeps_the_global_variable ... ok [INFO] [stdout] test runtime::tests::test_block_let_is_gone_after_the_block ... ok [INFO] [stdout] test runtime::tests::test_block_assignment_changes_the_nearest_binding ... ok [INFO] [stdout] test runtime::tests::test_block_reads_a_global_variable ... ok [INFO] [stdout] test runtime::tests::test_body_sees_a_constant_declared_after_the_function ... ok [INFO] [stdout] test runtime::tests::test_block_let_hides_an_outer_variable_until_the_block_ends ... ok [INFO] [stdout] test runtime::tests::test_boxed_runtime ... ok [INFO] [stdout] test runtime::tests::test_builtin_println_has_a_type ... ok [INFO] [stdout] test runtime::tests::test_block_let_in_a_function_body_is_gone_after_the_block ... ok [INFO] [stdout] test runtime::tests::test_builtin_type_name_evaluates_to_type ... ok [INFO] [stdout] test runtime::tests::test_builtin_typeof_none ... ok [INFO] [stdout] test runtime::tests::test_builtin_typeof_returns_type ... ok [INFO] [stdout] test runtime::tests::test_call_builtin_type_name_is_not_callable ... ok [INFO] [stdout] test runtime::tests::test_block_let_with_a_type_does_not_change_the_outer_type ... ok [INFO] [stdout] test runtime::tests::test_body_cannot_call_a_function_that_a_variable_holds ... ok [INFO] [stdout] test runtime::tests::test_body_cannot_read_a_global_variable ... ok [INFO] [stdout] test runtime::tests::test_call_and_pipe_forms_are_equivalent ... ok [INFO] [stdout] test runtime::tests::test_body_sees_constants_functions_and_type_names ... ok [INFO] [stdout] test runtime::tests::test_call_function_through_another_name ... ok [INFO] [stdout] test runtime::tests::test_call_registered_function ... ok [INFO] [stdout] test runtime::tests::test_call_non_function_is_not_callable ... ok [INFO] [stdout] test runtime::tests::test_call_unknown_function_is_undefined ... ok [INFO] [stdout] test runtime::tests::test_call_checks_arity ... ok [INFO] [stdout] test runtime::tests::test_cannot_bind_error_message ... ok [INFO] [stdout] test runtime::tests::test_const_binds_the_value ... ok [INFO] [stdout] test runtime::tests::test_cannot_register_error_message ... ok [INFO] [stdout] test runtime::tests::test_const_cannot_use_a_protected_name ... ok [INFO] [stdout] test runtime::tests::test_builtin_println_returns_none ... ok [INFO] [stdout] test runtime::tests::test_const_def_can_call_typeof ... ok [INFO] [stdout] test runtime::tests::test_const_def_cannot_call_a_function_that_is_not_const_in_a_block_or_a_pipe ... ok [INFO] [stdout] test runtime::tests::test_builtin_println_takes_only_a_string ... ok [INFO] [stdout] test runtime::tests::test_const_def_can_call_itself_and_other_const_functions ... ok [INFO] [stdout] test runtime::tests::test_const_def_cannot_call_a_function_declared_with_def ... ok [INFO] [stdout] test runtime::tests::test_const_def_cannot_call_a_native_function_that_is_not_const ... ok [INFO] [stdout] test runtime::tests::test_const_def_gives_none_and_can_be_called ... ok [INFO] [stdout] test runtime::tests::test_const_def_reads_global_constants_but_not_global_variables ... ok [INFO] [stdout] test runtime::tests::test_const_overloads_can_differ_in_parameters ... ok [INFO] [stdout] test runtime::tests::test_declare_constant ... ok [INFO] [stdout] test runtime::tests::test_def_argument_checks_are_the_same_as_for_a_native_function ... ok [INFO] [stdout] test runtime::tests::test_call_typeof_through_another_name ... ok [INFO] [stdout] test runtime::tests::test_def_cannot_add_an_overload_to_a_native_function ... ok [INFO] [stdout] test runtime::tests::test_def_cannot_use_a_name_that_is_in_use ... ok [INFO] [stdout] test runtime::tests::test_def_body_reads_constants_and_a_parameter_hides_a_variable ... ok [INFO] [stdout] test runtime::tests::test_def_at_the_top_level_is_allowed_after_a_block_and_after_an_error ... ok [INFO] [stdout] test runtime::tests::test_def_assignment_changes_the_nearest_binding ... ok [INFO] [stdout] test runtime::tests::test_def_default_can_use_a_global_constant ... ok [INFO] [stdout] test runtime::tests::test_def_function_is_a_function_value ... ok [INFO] [stdout] test runtime::tests::test_def_function_name_cannot_be_bound ... ok [INFO] [stdout] test runtime::tests::test_def_function_can_call_itself ... ok [INFO] [stdout] test runtime::tests::test_def_function_can_be_called ... ok [INFO] [stdout] test runtime::tests::test_declare_constant_refuses_a_protected_name ... ok [INFO] [stdout] test runtime::tests::test_def_gives_none ... ok [INFO] [stdout] test runtime::tests::test_declare_constant_replaces_a_variable ... ok [INFO] [stdout] test runtime::tests::test_def_in_a_block_is_not_allowed ... ok [INFO] [stdout] test runtime::tests::test_def_function_cannot_be_called_by_the_host_directly ... ok [INFO] [stdout] test runtime::tests::test_def_in_a_function_body_is_not_allowed ... ok [INFO] [stdout] test runtime::tests::test_def_function_type ... ok [INFO] [stdout] test runtime::tests::test_def_on_one_line ... ok [INFO] [stdout] test runtime::tests::test_def_overloads_with_different_keywords_are_not_duplicates ... ok [INFO] [stdout] test runtime::tests::test_def_parameter_keeps_its_declared_type ... ok [INFO] [stdout] test runtime::tests::test_def_number_parameter_and_result_convert_an_integer ... ok [INFO] [stdout] test runtime::tests::test_def_rest_keywords_parameter_is_a_map ... ok [INFO] [stdout] test runtime::tests::test_def_default_cannot_use_another_parameter ... ok [INFO] [stdout] test runtime::tests::test_def_result_is_checked_against_the_return_type ... ok [INFO] [stdout] test runtime::tests::test_def_keyword_defaults ... ok [INFO] [stdout] test runtime::tests::test_def_value_is_the_last_statement ... ok [INFO] [stdout] test runtime::tests::test_def_parameters_and_lets_are_local_to_the_call ... ok [INFO] [stdout] test runtime::tests::test_def_variadic_parameter_is_an_array ... ok [INFO] [stdout] test runtime::tests::test_def_with_the_same_name_adds_an_overload ... ok [INFO] [stdout] test runtime::tests::test_def_without_a_return_type_returns_none ... ok [INFO] [stdout] test runtime::tests::test_def_default_is_checked_against_the_keyword_type ... ok [INFO] [stdout] test runtime::tests::test_def_with_an_equal_parameter_signature_is_a_duplicate_overload ... ok [INFO] [stdout] test runtime::tests::test_default_is_not_evaluated_when_the_call_gives_the_keyword ... ok [INFO] [stdout] test runtime::tests::test_default_cannot_use_a_global_variable ... ok [INFO] [stdout] test runtime::tests::test_default_can_call_a_const_function ... ok [INFO] [stdout] test runtime::tests::test_default_can_use_a_type_name ... ok [INFO] [stdout] test runtime::tests::test_default_cannot_call_a_function_declared_with_def ... ok [INFO] [stdout] test runtime::tests::test_empty_block_evaluates_to_none ... ok [INFO] [stdout] test runtime::tests::test_error_in_a_function_called_in_a_block_closes_both_scopes ... ok [INFO] [stdout] test runtime::tests::test_each_overload_gives_its_own_warning ... ok [INFO] [stdout] test runtime::tests::test_each_kind_of_pattern_matches_its_literal ... ok [INFO] [stdout] test runtime::tests::test_eval_needs_a_separator_between_statements_on_one_line ... ok [INFO] [stdout] test runtime::tests::test_eval_of_a_syntax_error_runs_nothing ... ok [INFO] [stdout] test runtime::tests::test_eval_of_empty_source_is_none ... ok [INFO] [stdout] test runtime::tests::test_eval_returns_the_last_statements_value ... ok [INFO] [stdout] test runtime::tests::test_eval_statement_evaluates_a_parsed_statement ... ok [INFO] [stdout] test runtime::tests::test_default_can_call_a_native_function_that_is_const ... ok [INFO] [stdout] test runtime::tests::test_default_cannot_call_a_native_function_that_is_not_const ... ok [INFO] [stdout] test runtime::tests::test_error_in_a_block_closes_its_scope ... ok [INFO] [stdout] test runtime::tests::test_eval_statement_gives_warnings_too ... ok [INFO] [stdout] test runtime::tests::test_failed_assignment_keeps_the_value_and_type ... ok [INFO] [stdout] test runtime::tests::test_function_value_equals_itself ... ok [INFO] [stdout] test runtime::tests::test_get_function ... ok [INFO] [stdout] test runtime::tests::test_hiding_a_constant_in_a_block_warns ... ok [INFO] [stdout] test runtime::tests::test_hiding_a_constant_in_a_function_body_warns ... ok [INFO] [stdout] test runtime::tests::test_failed_typed_let_keeps_the_earlier_declaration ... ok [INFO] [stdout] test runtime::tests::test_field_access_on_native_value_is_invalid ... ok [INFO] [stdout] test runtime::tests::test_function_called_in_a_block_reads_global_constants ... ok [INFO] [stdout] test runtime::tests::test_function_does_not_see_the_blocks_of_its_caller ... ok [INFO] [stdout] test runtime::tests::test_get_native_type ... ok [INFO] [stdout] test runtime::tests::test_host_function_replaces_typeof ... ok [INFO] [stdout] test runtime::tests::test_if_without_else_evaluates_to_none_when_false ... ok [INFO] [stdout] test runtime::tests::test_if_condition_is_evaluated_in_the_enclosing_scope ... ok [INFO] [stdout] test runtime::tests::test_field_access_reads_symbol_key ... ok [INFO] [stdout] test runtime::tests::test_if_arms_have_scopes_of_their_own ... ok [INFO] [stdout] test runtime::tests::test_hiding_a_constant_with_a_const_warns ... ok [INFO] [stdout] test runtime::tests::test_hiding_a_constant_of_an_outer_block_warns ... ok [INFO] [stdout] test runtime::tests::test_host_variable_is_not_visible_in_a_function_but_a_constant_is ... ok [INFO] [stdout] test runtime::tests::test_host_sees_only_the_global_scope ... ok [INFO] [stdout] test runtime::tests::test_integer_display ... ok [INFO] [stdout] test runtime::tests::test_integer_is_a_built_in_type_name ... ok [INFO] [stdout] test runtime::tests::test_integer_literal_evaluates_to_an_integer ... ok [INFO] [stdout] test runtime::tests::test_if_without_else_evaluates_to_then_branch_when_true ... ok [INFO] [stdout] test runtime::tests::test_integers_and_numbers_are_equal_by_value ... ok [INFO] [stdout] test runtime::tests::test_keyword_arguments_are_not_a_positional_map ... ok [INFO] [stdout] test runtime::tests::test_let_in_a_body_hides_a_global_variable_with_no_warning ... ok [INFO] [stdout] test runtime::tests::test_let_without_a_type_clears_the_declared_type ... ok [INFO] [stdout] test runtime::tests::test_map_key_to_value ... ok [INFO] [stdout] test runtime::tests::test_map_literal_duplicate_key_keeps_first_position_and_last_value ... ok [INFO] [stdout] test runtime::tests::test_let_cannot_bind_builtin_type_name ... ok [INFO] [stdout] test runtime::tests::test_map_literal_keys_are_symbols ... ok [INFO] [stdout] test runtime::tests::test_let_cannot_bind_host_function ... ok [INFO] [stdout] test runtime::tests::test_keyword_values_are_evaluated_after_positional_arguments ... ok [INFO] [stdout] test runtime::tests::test_map_prints_keys_as_written ... ok [INFO] [stdout] test runtime::tests::test_native_type_name_cannot_be_bound ... ok [INFO] [stdout] test runtime::tests::test_let_cannot_bind_builtin_function ... ok [INFO] [stdout] test runtime::tests::test_native_function_sees_rest_keywords_in_call_order ... ok [INFO] [stdout] test runtime::tests::test_native_type_name_is_not_callable ... ok [INFO] [stdout] test runtime::tests::test_native_values_cannot_be_ordered ... ok [INFO] [stdout] test runtime::tests::test_none_value_display ... ok [INFO] [stdout] test runtime::tests::test_none_value_equals_none_type ... ok [INFO] [stdout] test runtime::tests::test_one_warning_for_each_list_of_statements ... ok [INFO] [stdout] test runtime::tests::test_parenthesized_braces_as_an_arm_is_an_empty_map ... ok [INFO] [stdout] test runtime::tests::test_native_values_through_flt ... ok [INFO] [stdout] test runtime::tests::test_nested_blocks_see_outer_names_but_not_the_reverse ... ok [INFO] [stdout] test runtime::tests::test_pipe_chain_passes_previous_result_first ... ok [INFO] [stdout] test runtime::tests::test_map_displays_in_insertion_order ... ok [INFO] [stdout] test runtime::tests::test_map_equality_ignores_order ... ok [INFO] [stdout] test runtime::tests::test_pipe_into_bare_name ... ok [INFO] [stdout] test runtime::tests::test_native_type_name_evaluates_to_type ... ok [INFO] [stdout] test runtime::tests::test_map_literal_keeps_source_order ... ok [INFO] [stdout] test runtime::tests::test_pipe_into_non_call_is_invalid ... ok [INFO] [stdout] test runtime::tests::test_pipe_into_type_name_is_not_callable ... ok [INFO] [stdout] test runtime::tests::test_pipe_into_unknown_function_is_undefined ... ok [INFO] [stdout] test runtime::tests::test_patterns_in_several_parameters_and_with_other_parameters ... ok [INFO] [stdout] test runtime::tests::test_pipe_right_side_is_not_evaluated_on_its_own ... ok [INFO] [stdout] test runtime::tests::test_refused_binding_does_not_evaluate_its_value ... ok [INFO] [stdout] test runtime::tests::test_register_function_on_runtime ... ok [INFO] [stdout] test runtime::tests::test_pipe_passes_piped_value_positionally ... ok [INFO] [stdout] test runtime::tests::test_register_function_refuses_builtin_type_name ... ok [INFO] [stdout] test runtime::tests::test_pipe_argument_count_includes_piped_value ... ok [INFO] [stdout] test runtime::tests::test_pipe_evaluates_left_side_first ... ok [INFO] [stdout] test runtime::tests::test_register_function_refuses_native_type_name ... ok [INFO] [stdout] test runtime::tests::test_pipe_groups_with_other_operators ... ok [INFO] [stdout] test runtime::tests::test_register_native_type_refuses_builtin_type_name ... ok [INFO] [stdout] test runtime::tests::test_register_function_replaces_a_function ... ok [INFO] [stdout] test runtime::tests::test_register_native_type_info_through_dyn_runtime ... ok [INFO] [stdout] test runtime::tests::test_register_native_type_refuses_function_name ... ok [INFO] [stdout] test runtime::tests::test_register_native_type_refuses_one_registered_twice ... ok [INFO] [stdout] test runtime::tests::test_register_native_type_refuses_variable_name ... ok [INFO] [stdout] test runtime::tests::test_register_native_type_refuses_another_types_name ... ok [INFO] [stdout] test runtime::tests::test_remove_binding_removes_a_constant ... ok [INFO] [stdout] test runtime::tests::test_register_function_refuses_variable_name ... ok [INFO] [stdout] test runtime::tests::test_return_after_an_error_leaves_the_runtime_usable ... ok [INFO] [stdout] test runtime::tests::test_return_at_the_top_level_runs_nothing ... ok [INFO] [stdout] test runtime::tests::test_pipe_passes_left_side_as_first_argument ... ok [INFO] [stdout] test runtime::tests::test_registered_function_evaluates_to_function_value ... ok [INFO] [stdout] test runtime::tests::test_remove_binding ... ok [INFO] [stdout] test runtime::tests::test_remove_binding_removes_the_declared_type ... ok [INFO] [stdout] test runtime::tests::test_return_closes_the_scopes_of_the_call ... ok [INFO] [stdout] test runtime::tests::test_return_in_a_caller_scope_is_not_confused_with_the_callee ... ok [INFO] [stdout] test runtime::tests::test_return_gives_the_value_of_the_call ... ok [INFO] [stdout] test runtime::tests::test_return_value_is_checked_against_the_return_type ... ok [INFO] [stdout] test runtime::tests::test_set_variable_on_a_constant_fails ... ok [INFO] [stdout] test runtime::tests::test_return_with_no_call_raises_return_outside_function ... ok [INFO] [stdout] test runtime::tests::test_scope_without_builtins_protects_only_type_names ... ok [INFO] [stdout] test runtime::tests::test_set_variable_then_get_variable ... ok [INFO] [stdout] test runtime::tests::test_symbol_and_string_keys_differ ... ok [INFO] [stdout] test runtime::tests::test_set_variable_refuses_protected_names ... ok [INFO] [stdout] test runtime::tests::test_set_variable_converts_an_integer_to_a_declared_number ... ok [INFO] [stdout] test runtime::tests::test_return_leaves_blocks_and_expressions ... ok [INFO] [stdout] test runtime::tests::test_take_warnings_clears_the_warnings ... ok [INFO] [stdout] test runtime::tests::test_the_const_check_is_made_through_the_functions_that_a_const_function_calls ... ok [INFO] [stdout] test runtime::tests::test_the_const_check_comes_before_the_duplicate_check ... ok [INFO] [stdout] test runtime::tests::test_the_const_check_is_made_when_the_call_runs ... ok [INFO] [stdout] test runtime::tests::test_the_check_follows_the_syntax_not_the_flow ... ok [INFO] [stdout] test runtime::tests::test_symbol_prints_quoted_when_not_a_bare_name ... ok [INFO] [stdout] test runtime::tests::test_set_variable_is_checked_against_the_declared_type ... ok [INFO] [stdout] test runtime::tests::test_the_rebind_error_message ... ok [INFO] [stdout] test runtime::tests::test_the_type_of_a_const_function_shows_const ... ok [INFO] [stdout] test runtime::tests::test_the_unreachable_statements_are_not_searched ... ok [INFO] [stdout] test runtime::tests::test_the_warning_comes_from_the_def_not_from_calls ... ok [INFO] [stdout] test runtime::tests::test_try_from_value_for_rust_numbers ... ok [INFO] [stdout] test runtime::tests::test_try_from_value_for_rust_numbers_from_integers ... ok [INFO] [stdout] test runtime::tests::test_try_from_value_rejects_integers_that_dont_fit ... ok [INFO] [stdout] test runtime::tests::test_try_from_value_rejects_non_numbers ... ok [INFO] [stdout] test runtime::tests::test_try_from_value_rejects_numbers_that_dont_fit ... ok [INFO] [stdout] test runtime::tests::test_type_of_array ... ok [INFO] [stdout] test runtime::tests::test_type_of_boolean ... ok [INFO] [stdout] test runtime::tests::test_type_of_integer ... ok [INFO] [stdout] test runtime::tests::test_type_of_map ... ok [INFO] [stdout] test runtime::tests::test_type_of_none ... ok [INFO] [stdout] test runtime::tests::test_type_of_number ... ok [INFO] [stdout] test runtime::tests::test_type_of_string ... ok [INFO] [stdout] test runtime::tests::test_the_const_expression_is_evaluated_once ... ok [INFO] [stdout] test runtime::tests::test_type_of_symbol ... ok [INFO] [stdout] test runtime::tests::test_type_of_type_is_type ... ok [INFO] [stdout] test runtime::tests::test_typed_const_converts_and_checks_the_value ... ok [INFO] [stdout] test runtime::tests::test_the_const_requirement_is_restored_after_a_call_and_after_an_error ... ok [INFO] [stdout] test runtime::tests::test_typed_let_binds_a_value_of_its_type ... ok [INFO] [stdout] test runtime::tests::test_typed_let_converts_an_integer_to_a_declared_number ... ok [INFO] [stdout] test runtime::tests::test_the_type_of_a_function_shows_its_patterns ... ok [INFO] [stdout] test runtime::tests::test_typed_let_integer_refuses_a_number ... ok [INFO] [stdout] test runtime::tests::test_the_warning_is_the_unreachable_code_variant ... ok [INFO] [stdout] test runtime::tests::test_typed_let_refuses_a_value_of_another_type ... ok [INFO] [stdout] test runtime::tests::test_typeof_builtin_type_name_is_type ... ok [INFO] [stdout] test runtime::tests::test_typed_let_with_a_native_type ... ok [INFO] [stdout] test runtime::tests::test_typed_let_keeps_an_integer_that_a_union_member_accepts ... ok [INFO] [stdout] test runtime::tests::test_typeof_if_without_else_is_none_when_false ... ok [INFO] [stdout] test runtime::tests::test_typeof_arity_checked_by_runtime ... ok [INFO] [stdout] test runtime::tests::test_typeof_of_typeof ... ok [INFO] [stdout] test runtime::tests::test_typeof_registered_in_global_scope ... ok [INFO] [stdout] test runtime::tests::test_typeof_signature ... ok [INFO] [stdout] test runtime::tests::test_unknown_type ... ok [INFO] [stdout] test runtime::tests::test_unregistered_native_type_name_is_unbound ... ok [INFO] [stdout] test runtime::tests::test_value_from_big_decimal_is_a_number ... ok [INFO] [stdout] test runtime::tests::test_value_type_display ... ok [INFO] [stdout] test runtime::tests::test_visibility_is_restored_after_a_call_with_a_default ... ok [INFO] [stdout] test runtime::tests::test_visibility_is_restored_after_an_error_in_a_call ... ok [INFO] [stdout] test runtime::tests::test_warnings_are_given_oldest_first ... ok [INFO] [stdout] test runtime::tests::test_warnings_in_blocks_and_arms ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_brackets_union_after_stars ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_brackets_union_return_type ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_with_keywords ... ok [INFO] [stdout] test runtime::tests::test_typeof_equals_builtin_type_name ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_with_native_types ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_with_rest_keywords ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_with_variadic ... ok [INFO] [stdout] test runtime::tests::test_value_from_rust_integers_is_an_integer ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_with_parameters ... ok [INFO] [stdout] test runtime::tests::test_typeof_evaluates_to_function_value ... ok [INFO] [stdout] test runtime::types::function::tests::test_from_function_signature ... ok [INFO] [stdout] test runtime::types::function::tests::test_from_function_signature_with_keywords ... ok [INFO] [stdout] test runtime::types::function::tests::test_from_function_signature_with_native_types ... ok [INFO] [stdout] test runtime::types::function::tests::test_from_function_signature_with_variadic ... ok [INFO] [stdout] test runtime::types::function::tests::test_type_function_display ... ok [INFO] [stdout] test runtime::types::tests::test_a_literal_type_displays_as_written ... ok [INFO] [stdout] test runtime::types::function::tests::test_equality_includes_keywords ... ok [INFO] [stdout] test runtime::types::function::tests::test_equality_includes_variadic ... ok [INFO] [stdout] test runtime::types::tests::test_a_literal_type_accepts_one_value_of_its_own_type ... ok [INFO] [stdout] test runtime::tests::test_whole_number_displays_with_a_decimal_point ... ok [INFO] [stdout] test runtime::types::tests::test_at_least_as_narrow ... ok [INFO] [stdout] test runtime::types::tests::test_a_literal_type_does_not_convert_between_integer_and_number ... ok [INFO] [stdout] test runtime::types::tests::test_builtin_named ... ok [INFO] [stdout] test runtime::types::tests::test_builtin_named_excludes_any_and_unknown_names ... ok [INFO] [stdout] test runtime::types::tests::test_builtin_types_accept_their_values ... ok [INFO] [stdout] test runtime::types::tests::test_coerce_doesnt_look_inside_collections ... ok [INFO] [stdout] test runtime::types::tests::test_coerce_leaves_values_that_are_accepted_as_they_are ... ok [INFO] [stdout] test runtime::types::tests::test_function_type_accepts_a_function_of_exactly_that_type ... ok [INFO] [stdout] test runtime::types::tests::test_function_type_accepts_a_function_with_an_overload_of_that_type ... ok [INFO] [stdout] test runtime::types::tests::test_function_types_have_no_subtyping_for_integers ... ok [INFO] [stdout] test runtime::types::function::tests::test_display_without_parameters ... ok [INFO] [stdout] test runtime::types::tests::test_integer_doesnt_accept_a_number_even_a_whole_one ... ok [INFO] [stdout] test runtime::types::tests::test_integer_type_display ... ok [INFO] [stdout] test runtime::types::tests::test_native_type_accepts_only_its_own_values ... ok [INFO] [stdout] test runtime::types::tests::test_native_types_with_the_same_name_are_different_types ... ok [INFO] [stdout] test runtime::types::tests::test_none_type_display ... ok [INFO] [stdout] test runtime::types::tests::test_not_at_least_as_narrow ... ok [INFO] [stdout] test runtime::types::tests::test_number_coerces_an_integer_to_a_number ... ok [INFO] [stdout] test runtime::types::tests::test_option_accepts_none_and_its_inner_types_values ... ok [INFO] [stdout] test runtime::types::tests::test_the_base_of_a_literal_type_is_its_type ... ok [INFO] [stdout] test runtime::types::tests::test_type_and_any_display ... ok [INFO] [stdout] test runtime::types::tests::test_union_accepts_any_members_values ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_appends_after_existing_members ... ok [INFO] [stdout] test runtime::types::tests::test_a_literal_type_is_at_least_as_narrow_as_its_type_and_wider_types ... ok [INFO] [stdout] test runtime::types::tests::test_a_union_or_option_coerces_an_integer_only_if_no_member_accepts_it ... ok [INFO] [stdout] test runtime::types::tests::test_any_accepts_every_value ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_of_an_empty_union_adds_nothing ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_skips_a_type_already_present ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_skips_union_members_already_present ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_flattens_nested_union_on_the_right ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_of_overlapping_unions ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_of_the_same_type_collapses ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_of_two_distinct_types ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_flattens_a_hand_built_nested_union ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_with_none ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_flattens_a_union_into_its_members ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_add_member_to_empty_members ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_flattens_nested_union_on_the_left ... ok [INFO] [stdout] test warning::tests::test_constant_hidden_message ... ok [INFO] [stdout] test warning::tests::test_unreachable_code_message ... ok [INFO] [stdout] test utils::tests::test_is_bare_name ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_of_identical_unions_collapses_to_that_union ... ok [INFO] [stdout] test runtime::types::union_types::tests::test_union_removes_duplicates_keeping_first_occurrence ... ok [INFO] [stdout] [INFO] [stdout] test result: ok. 804 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Running unittests src/bin/flt.rs (/opt/rustwide/target/release/build/flt/7ef4c94fd0236e53/out/flt-7ef4c94fd0236e53) [INFO] [stdout] running 0 tests [INFO] [stderr] Running tests/cli.rs (/opt/rustwide/target/release/build/flt/8235a8fe3211d957/out/cli-8235a8fe3211d957) [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stdout] [2026-11-26T05:54:36Z INFO ] Running CLI tests [INFO] [stdout] Feature: flt version [INFO] [stdout] Scenario: flt version [INFO] [stdout] Running /opt/rustwide/target/release/flt version [INFO] [stdout] Output: flt version 0.4.0 [INFO] [stdout] [INFO] [stdout] Running /opt/rustwide/target/release/flt -e 1 + 2 [INFO] [stdout] Output: 3 [INFO] [stdout] [INFO] [stdout] Running /opt/rustwide/target/release/flt -e let x = 2; x * 3 [INFO] [stdout] Output: 6 [INFO] [stdout] [INFO] [stdout] Running /opt/rustwide/target/release/flt -e 1 + [INFO] [stdout] Output: [INFO] [stdout] Running /opt/rustwide/target/release/flt fixtures/examples/hello.flt [INFO] [stdout] Output: Hello, world! [INFO] [stdout] [INFO] [stdout] Running /opt/rustwide/target/release/flt fixtures/examples/multi.flt [INFO] [stdout] Output: c + a is 11 [INFO] [stdout] [INFO] [stdout] Running /opt/rustwide/target/release/flt fixtures/examples/shebang.flt [INFO] [stdout] Output: answer: 42 [INFO] [stdout] [INFO] [stdout] Running /opt/rustwide/target/release/flt fixtures/examples/value.flt [INFO] [stdout] Output: [INFO] [stdout] Running /opt/rustwide/target/release/flt fixtures/examples/missing.flt [INFO] [stdout] Output: [INFO] [stdout] Running /opt/rustwide/target/release/flt fixtures/examples/syntax_error.flt [INFO] [stdout] Output: [INFO] [stdout] Running /opt/rustwide/target/release/flt -e 1 fixtures/examples/hello.flt [INFO] [stderr] Running tests/features.rs (/opt/rustwide/target/release/build/flt/622f87556aad5b48/out/features-622f87556aad5b48) [INFO] [stdout] Output: [INFO] [stdout] status: 0 [INFO] [stdout] status: 0 [INFO] [stdout] status: 0 [INFO] [stdout] status: 1 [INFO] [stdout] status: 0 [INFO] [stdout] status: 0 [INFO] [stdout] ✔ When the command `flt version` is run [INFO] [stdout] status: 0 [INFO] [stdout] status: 0 [INFO] [stdout] status: 1 [INFO] [stdout] status: 1 [INFO] [stdout] status: 2 [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should contain "flt version 0.4.0" [INFO] [stdout] Scenario: flt -e evaluates an expression [INFO] [stdout] ✔ When the command `flt -e '1 + 2'` is run [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should contain "3" [INFO] [stdout] Scenario: flt -e evaluates a program with many statements [INFO] [stdout] ✔ When the command `flt -e 'let x = 2; x * 3'` is run [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should contain "6" [INFO] [stdout] Scenario: flt -e fails on a syntax error [INFO] [stdout] ✔ When the command `flt -e '1 +'` is run [INFO] [stdout] ✔ Then it should exit with status code 1 [INFO] [stdout] ✔ And the error output should contain "Error" [INFO] [stdout] Scenario: flt runs a program file [INFO] [stdout] ✔ When the command `flt fixtures/examples/hello.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should contain "Hello, world!" [INFO] [stdout] ✔ And the output should not contain "None" [INFO] [stdout] Scenario: flt runs a program file with many statements [INFO] [stdout] ✔ When the command `flt fixtures/examples/multi.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should contain "c + a is 11" [INFO] [stdout] ✔ And the output should not contain "None" [INFO] [stdout] Scenario: flt runs a program file that starts with a shebang [INFO] [stdout] ✔ When the command `flt fixtures/examples/shebang.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should contain "answer: 42" [INFO] [stdout] Scenario: flt does not print the value of the last statement of a program file [INFO] [stdout] ✔ When the command `flt fixtures/examples/value.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 0 [INFO] [stdout] ✔ And the output should not contain "7" [INFO] [stdout] Scenario: flt fails on a program file that does not exist [INFO] [stdout] ✔ When the command `flt fixtures/examples/missing.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 1 [INFO] [stdout] ✔ And the error output should contain "cannot read" [INFO] [stdout] Scenario: flt fails on a syntax error in a program file [INFO] [stdout] ✔ When the command `flt fixtures/examples/syntax_error.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 1 [INFO] [stdout] ✔ And the error output should contain "Error" [INFO] [stdout] Scenario: flt does not accept -e with a program file [INFO] [stdout] ✔ When the command `flt -e '1' fixtures/examples/hello.flt` is run [INFO] [stdout] ✔ Then it should exit with status code 2 [INFO] [stdout] [Summary] [INFO] [stdout] 1 feature [INFO] [stdout] 11 scenarios (11 passed) [INFO] [stdout] 34 steps (34 passed) [INFO] [stdout] Feature: Arrays [INFO] [stdout] Scenario: Parsing an empty array [INFO] [stdout] ✔ Given the input "[]" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an empty array [INFO] [stdout] Scenario: Parsing an array with spaces [INFO] [stdout] ✔ Given the input "[ ]" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an empty array [INFO] [stdout] Scenario: Parsing an array with a single number [INFO] [stdout] ✔ Given the input "[ 42 ]" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 1 element [INFO] [stdout] ✔ And the first element should be the integer 42 [INFO] [stdout] Scenario: Parsing an array with a single string [INFO] [stdout] ✔ Given the input '[ "hello" ]' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 1 element [INFO] [stdout] ✔ And the first element should be the string "hello" [INFO] [stdout] Scenario: Parsing an array with multiple numbers [INFO] [stdout] ✔ Given the input "[ 1, 2, 3 ]" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 3 elements [INFO] [stdout] ✔ And the first element should be the integer 1 [INFO] [stdout] ✔ And the second element should be the integer 2 [INFO] [stdout] ✔ And the third element should be the integer 3 [INFO] [stdout] Scenario: Parsing an array with mixed types [INFO] [stdout] ✔ Given the input '[ 1, "two", true ]' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 3 elements [INFO] [stdout] ✔ And the first element should be the integer 1 [INFO] [stdout] ✔ And the second element should be the string "two" [INFO] [stdout] ✔ And the third element should be the boolean true [INFO] [stdout] Scenario: Parsing an array with trailing comma [INFO] [stdout] ✔ Given the input "[ 1, ]" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 1 element [INFO] [stdout] ✔ And the first element should be the integer 1 [INFO] [stdout] Scenario: Parsing an array with nested expressions [INFO] [stdout] ✔ Given the input "[ 1 + 2, 3 * 4 ]" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 2 elements [INFO] [stdout] Feature: AST [INFO] [stdout] Scenario: Parsing an integer [INFO] [stdout] ✔ Given the input "42" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Integer(42)` [INFO] [stdout] Scenario Outline: A numeric literal without a `.` is an integer [INFO] [stdout] ✔ Given the input "0" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Integer(0)` [INFO] [stdout] Scenario Outline: A numeric literal without a `.` is an integer [INFO] [stdout] ✔ Given the input "1_000" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Integer(1000)` [INFO] [stdout] Scenario Outline: A numeric literal with a `.` is a number [INFO] [stdout] ✔ Given the input "3.14" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Number(3.14)` [INFO] [stdout] Scenario Outline: A numeric literal with a `.` is a number [INFO] [stdout] ✔ Given the input "0.5" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Number(0.5)` [INFO] [stdout] Scenario Outline: A numeric literal with a `.` is a number [INFO] [stdout] ✔ Given the input "42.0" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Number(42.0)` [INFO] [stdout] Scenario Outline: A numeric literal with a `.` is a number [INFO] [stdout] ✔ Given the input "1_000.5" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Number(1000.5)` [INFO] [stdout] Scenario Outline: A `.` needs a digit after it [INFO] [stdout] ✔ Given the input "42." [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A `.` needs a digit after it [INFO] [stdout] ✔ Given the input "1_000." [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Parsing a string literal [INFO] [stdout] ✔ Given the input '"hello"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Literal(String("hello"))' [INFO] [stdout] Scenario: Parsing a boolean literal [INFO] [stdout] ✔ Given the input "true" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Boolean(true)` [INFO] [stdout] Scenario: Parsing an identifier [INFO] [stdout] ✔ Given the input "user_name" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "user_name" [INFO] [stdout] Scenario: Parsing a symbol [INFO] [stdout] ✔ Given the input ":user_name" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Symbol("user_name")` [INFO] [stdout] Scenario: Parsing a quoted symbol [INFO] [stdout] ✔ Given the input ':"hello world"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Symbol("hello world")` [INFO] [stdout] Scenario: Parsing an identifier that starts with digits fails [INFO] [stdout] ✔ Given the input "123abc" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Parsing a symbol that starts with non-character fails [INFO] [stdout] ✔ Given the input ":_foo" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Parsing string concatenation [INFO] [stdout] ✔ Given the input '"foo" <> "bar"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should parse to string concat "foo" and "bar" [INFO] [stdout] Scenario: Parsing string interpolation [INFO] [stdout] ✔ Given the input '"Hello, {who}!"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should parse to interpolated string "Hello, " who "!" [INFO] [stdout] Feature: Binary expressions [INFO] [stdout] Scenario: Addition [INFO] [stdout] ✔ Given the input "1 + 2" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(1)), Add, Literal(Integer(2)))' [INFO] [stdout] Scenario: Subtraction [INFO] [stdout] ✔ Given the input "10 - 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(10)), Sub, Literal(Integer(3)))' [INFO] [stdout] Scenario: Multiplication [INFO] [stdout] ✔ Given the input "4 * 5" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(4)), Mul, Literal(Integer(5)))' [INFO] [stdout] Scenario: Division [INFO] [stdout] ✔ Given the input "20 / 4" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(20)), Div, Literal(Integer(4)))' [INFO] [stdout] Scenario: Floor division [INFO] [stdout] ✔ Given the input "7 // 2" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(7)), FloorDiv, Literal(Integer(2)))' [INFO] [stdout] Scenario: Floor division has the same precedence as multiplication, left to right [INFO] [stdout] ✔ Given the input "7 // 2 * 2" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(BinaryExpr(Literal(Integer(7)), FloorDiv, Literal(Integer(2))), Mul, Literal(Integer(2)))' [INFO] [stdout] Scenario: Floor division has higher precedence than addition [INFO] [stdout] ✔ Given the input "1 + 7 // 2" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(1)), Add, BinaryExpr(Literal(Integer(7)), FloorDiv, Literal(Integer(2))))' [INFO] [stdout] Scenario: Floor division and division are different operators [INFO] [stdout] ✔ Given the input "8 / 2 // 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(BinaryExpr(Literal(Integer(8)), Div, Literal(Integer(2))), FloorDiv, Literal(Integer(3)))' [INFO] [stdout] Scenario: Multiplication has higher precedence than addition [INFO] [stdout] ✔ Given the input "1 + 2 * 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(1)), Add, BinaryExpr(Literal(Integer(2)), Mul, Literal(Integer(3))))' [INFO] [stdout] Scenario: Parentheses override precedence [INFO] [stdout] ✔ Given the input "(1 + 2) * 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Parenthesized(BinaryExpr(Literal(Integer(1)), Add, Literal(Integer(2)))), Mul, Literal(Integer(3)))' [INFO] [stdout] Scenario: Logical and [INFO] [stdout] ✔ Given the input "true && false" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Boolean(true)), And, Literal(Boolean(false)))' [INFO] [stdout] Scenario: Logical or [INFO] [stdout] ✔ Given the input "true || false" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Boolean(true)), Or, Literal(Boolean(false)))' [INFO] [stdout] Scenario: Logical xor [INFO] [stdout] ✔ Given the input "true ^^ false" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Boolean(true)), Xor, Literal(Boolean(false)))' [INFO] [stdout] Scenario: String concatenation [INFO] [stdout] ✔ Given the input '"foo" <> "bar"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(String("foo")), Concat, Literal(String("bar")))' [INFO] [stdout] Scenario: Pipe operator [INFO] [stdout] ✔ Given the input "x |> f" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("x"), Pipe, Ident("f"))' [INFO] [stdout] Scenario: Equality [INFO] [stdout] ✔ Given the input "x == 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("x"), Eq, Literal(Integer(1)))' [INFO] [stdout] Scenario: Inequality [INFO] [stdout] ✔ Given the input "x != 0" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("x"), Ne, Literal(Integer(0)))' [INFO] [stdout] Scenario: Less than [INFO] [stdout] ✔ Given the input "a < b" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("a"), Lt, Ident("b"))' [INFO] [stdout] Scenario: Greater than [INFO] [stdout] ✔ Given the input "a > b" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("a"), Gt, Ident("b"))' [INFO] [stdout] Scenario: Less than or equal [INFO] [stdout] ✔ Given the input "a <= b" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("a"), Lte, Ident("b"))' [INFO] [stdout] Scenario: Greater than or equal [INFO] [stdout] ✔ Given the input "a >= b" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("a"), Gte, Ident("b"))' [INFO] [stdout] Scenario: Arithmetic binds tighter than equality [INFO] [stdout] ✔ Given the input "1 + 2 == 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(BinaryExpr(Literal(Integer(1)), Add, Literal(Integer(2))), Eq, Literal(Integer(3)))' [INFO] [stdout] Scenario: Ordering binds tighter than equality [INFO] [stdout] ✔ Given the input "a < b == c" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(BinaryExpr(Ident("a"), Lt, Ident("b")), Eq, Ident("c"))' [INFO] [stdout] Scenario: A pipe binds tighter than equality [INFO] [stdout] ✔ Given the input "x |> f == 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(BinaryExpr(Ident("x"), Pipe, Ident("f")), Eq, Literal(Integer(3)))' [INFO] [stdout] Scenario: A pipe binds tighter than logical or [INFO] [stdout] ✔ Given the input "a || b |> f" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("a"), Or, BinaryExpr(Ident("b"), Pipe, Ident("f")))' [INFO] [stdout] Scenario: Arithmetic binds tighter than a pipe [INFO] [stdout] ✔ Given the input "1 + 1 |> f" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(BinaryExpr(Literal(Integer(1)), Add, Literal(Integer(1))), Pipe, Ident("f"))' [INFO] [stdout] Feature: Brace blocks [INFO] [stdout] Scenario: A block with one expression [INFO] [stdout] ✔ Given the input "{ 1 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "{ 1 }" [INFO] [stdout] ✔ And the output should be 'Block([Expr(Literal(Integer(1)))])' [INFO] [stdout] Scenario: A block with an identifier is a block, not a map [INFO] [stdout] ✔ Given the input "{ a }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Block([Expr(Ident("a"))])' [INFO] [stdout] Scenario: A block with two statements on one line [INFO] [stdout] ✔ Given the input "{ let a = 1; a * 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "{ let a = 1; a * 2 }" [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario: A block with statements on separate lines [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "{ let a = 1; a + 1 }" [INFO] [stdout] Scenario: A block can hold an assignment [INFO] [stdout] ✔ Given the input "{ a = 1; a }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "{ a = 1; a }" [INFO] [stdout] Scenario: A block can hold another block [INFO] [stdout] ✔ Given the input "{ { 1 } }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "{ { 1 } }" [INFO] [stdout] Scenario: A block is an operand [INFO] [stdout] ✔ Given the input "{ 1 } + { 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "{ 1 } + { 2 }" [INFO] [stdout] Scenario: A key followed by a colon starts a map [INFO] [stdout] ✔ Given the input "{ a: 1 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with key "a" and integer value 1 [INFO] [stdout] Scenario: A quoted key followed by a colon starts a map [INFO] [stdout] ✔ Given the input '{ "a b": 1 }' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with key "a b" and integer value 1 [INFO] [stdout] Scenario: An empty pair of braces is an empty map [INFO] [stdout] ✔ Given the input "{}" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an empty map [INFO] [stdout] Scenario Outline: A block that is not closed doesn't parse [INFO] [stdout] ✔ Given the input "{ 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A block that is not closed doesn't parse [INFO] [stdout] ✔ Given the input "{ let a = 1;" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A block that is not closed doesn't parse [INFO] [stdout] ✔ Given the input "{ { 1 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Feature: Comments [INFO] [stdout] Scenario: Trailing comment after expression [INFO] [stdout] ✔ Given the input "42 # this is the answer" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Integer(42)` [INFO] [stdout] Scenario: Leading comment before expression [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Integer(42)` [INFO] [stdout] Scenario: Comment between binary operands [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(Integer(1)), Add, Literal(Integer(2)))' [INFO] [stdout] Scenario: Comment in function call arguments [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'FunctionCall(FunctionCall { name: Identifier("add"), positional_args: [Literal(Integer(1)), Literal(Integer(2))], keyword_args: {} })' [INFO] [stdout] Scenario: Comment between string concatenation operands [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Literal(String("foo")), Concat, Literal(String("bar")))' [INFO] [stdout] Scenario: Empty comment [INFO] [stdout] ✔ Given the input "true #" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Boolean(true)` [INFO] [stdout] Scenario: Multiple consecutive comment lines [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Literal(String("hello"))' [INFO] [stdout] Scenario: Trailing comment after a call without parentheses [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'FunctionCall(FunctionCall { name: Identifier("add"), positional_args: [Literal(Integer(1)), Literal(Integer(2))], keyword_args: {} })' [INFO] [stdout] Feature: Dot Access [INFO] [stdout] Scenario: Accessing a field on an identifier [INFO] [stdout] ✔ Given the input "u.foo" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a field access with field "foo" [INFO] [stdout] Scenario: Chained field access [INFO] [stdout] ✔ Given the input "a.b.c" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a field access with field "c" [INFO] [stdout] Scenario: Field access on a map literal [INFO] [stdout] ✔ Given the input '{ foo: "bar" }.foo' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a field access with field "foo" [INFO] [stdout] Feature: Function calls [INFO] [stdout] Scenario: Function call with trailing key-value pairs [INFO] [stdout] ✔ Given the input "foo(1, optional: true)" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a function call "foo" with 1 args and 1 keyword args [INFO] [stdout] Scenario: Function call with only key-value pairs [INFO] [stdout] ✔ Given the input 'config(format: "csv", header: true)' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a function call "config" with 0 args and 2 keyword args [INFO] [stdout] Scenario: Function call without parens and trailing key-value pairs [INFO] [stdout] ✔ Given the input "foo 1, optional: true" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a function call "foo" with 1 args and 1 keyword args [INFO] [stdout] Scenario: Function call with positional args only still works [INFO] [stdout] ✔ Given the input "add(1, 2)" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a function call "add" with 2 args [INFO] [stdout] Scenario: A map literal is a positional argument [INFO] [stdout] ✔ Given the input "foo({optional: true})" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a function call "foo" with 1 args [INFO] [stdout] Scenario: A positional argument can't follow a keyword argument [INFO] [stdout] ✔ Given the input "foo(optional: true, 1)" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Feature: Maps [INFO] [stdout] Scenario: Parsing an empty map [INFO] [stdout] ✔ Given the input "{}" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an empty map [INFO] [stdout] Scenario: Parsing a map with a bare key and string value [INFO] [stdout] ✔ Given the input '{ foo: "bar" }' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with key "foo" and string value "bar" [INFO] [stdout] Scenario: Parsing a map with a bare key and integer value [INFO] [stdout] ✔ Given the input "{ abc123: 456 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with key "abc123" and integer value 456 [INFO] [stdout] Scenario: Parsing a map with a quoted key [INFO] [stdout] ✔ Given the input '{ "spaced out": (1 + 1) }' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with 1 entry [INFO] [stdout] Scenario: Parsing a map with multiple entries [INFO] [stdout] ✔ Given the input '{ name: "Alice", age: 30 }' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with 2 entries [INFO] [stdout] Feature: Printing expressions [INFO] [stdout] Scenario Outline: Symbols keep their colon [INFO] [stdout] ✔ Given the input ':id' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as ':id' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Symbols keep their colon [INFO] [stdout] ✔ Given the input ':"hello world"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as ':"hello world"' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Symbols keep their colon [INFO] [stdout] ✔ Given the input ':"_tmp"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as ':"_tmp"' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Symbols keep their colon [INFO] [stdout] ✔ Given the input 'select(:one)' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as 'select(:one)' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Symbols keep their colon [INFO] [stdout] ✔ Given the input 'select(:id, :"full name")' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as 'select(:id, :"full name")' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Symbols keep their colon [INFO] [stdout] ✔ Given the input 'group_by(:gender) |> select(:gender, n: count(:id))' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as 'group_by(:gender) |> select(:gender, n: count(:id))' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Integers and numbers print as they'd be written [INFO] [stdout] ✔ Given the input '42' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as '42' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Integers and numbers print as they'd be written [INFO] [stdout] ✔ Given the input '1_000' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as '1000' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Integers and numbers print as they'd be written [INFO] [stdout] ✔ Given the input '3.14' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as '3.14' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Integers and numbers print as they'd be written [INFO] [stdout] ✔ Given the input '42.0' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as '42.0' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Integers and numbers print as they'd be written [INFO] [stdout] ✔ Given the input '7 // 2' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as '7 // 2' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario Outline: Integers and numbers print as they'd be written [INFO] [stdout] ✔ Given the input '7.0 / 2' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as '7.0 / 2' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Feature: Types [INFO] [stdout] Scenario: Boolean type name parses as an identifier [INFO] [stdout] ✔ Given the input "Boolean" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "Boolean" [INFO] [stdout] Scenario: Number type name parses as an identifier [INFO] [stdout] ✔ Given the input "Number" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "Number" [INFO] [stdout] Scenario: String type name parses as an identifier [INFO] [stdout] ✔ Given the input "String" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "String" [INFO] [stdout] Scenario: Symbol type name parses as an identifier [INFO] [stdout] ✔ Given the input "Symbol" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "Symbol" [INFO] [stdout] Scenario: Map type name parses as an identifier [INFO] [stdout] ✔ Given the input "Map" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "Map" [INFO] [stdout] Scenario: KeywordArgs type name parses as an identifier [INFO] [stdout] ✔ Given the input "KeywordArgs" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an identifier "KeywordArgs" [INFO] [stdout] Scenario: None sentinel parses as a literal [INFO] [stdout] ✔ Given the input "None" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::None` [INFO] [stdout] Scenario: Comparing a value to None for Option check [INFO] [stdout] ✔ Given the input "compressed == None" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("compressed"), Eq, Literal(None))' [INFO] [stdout] Scenario: Checking an option is not None [INFO] [stdout] ✔ Given the input "compressed != None" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'BinaryExpr(Ident("compressed"), Ne, Literal(None))' [INFO] [stdout] Scenario: Map literal as a collection-typed value [INFO] [stdout] ✔ Given the input '{ value: 42 }' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a map with key "value" and integer value 42 [INFO] [stdout] Scenario: Array literal with mixed built-in types [INFO] [stdout] ✔ Given the input '[ 1, "two", true ]' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be an array with 3 elements [INFO] [stdout] ✔ And the first element should be the integer 1 [INFO] [stdout] ✔ And the second element should be the string "two" [INFO] [stdout] ✔ And the third element should be the boolean true [INFO] [stdout] Feature: Unary expressions [INFO] [stdout] Scenario: Logical not on boolean [INFO] [stdout] ✔ Given the input "!true" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'UnaryExpr(Not, Literal(Boolean(true)))' [INFO] [stdout] Scenario: Logical not on identifier [INFO] [stdout] ✔ Given the input "!x" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'UnaryExpr(Not, Ident("x"))' [INFO] [stdout] Scenario: A minus touching an integer is part of the literal [INFO] [stdout] ✔ Given the input "-42" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Literal(Integer(-42))' [INFO] [stdout] Scenario: A minus touching a number is part of the literal [INFO] [stdout] ✔ Given the input "-1.5" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Literal(Number(Numeric(BigDecimal(sign=Minus, scale=1, digits=[15]))))' [INFO] [stdout] Scenario: A plus touching an integer is part of the literal [INFO] [stdout] ✔ Given the input "+17" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Literal(Integer(17))' [INFO] [stdout] Scenario: A plus touching a number is part of the literal [INFO] [stdout] ✔ Given the input "+1.0" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'Literal(Number(Numeric(BigDecimal(sign=Plus, scale=1, digits=[10]))))' [INFO] [stdout] Scenario: Unary plus on identifier [INFO] [stdout] ✔ Given the input "+x" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'UnaryExpr(Plus, Ident("x"))' [INFO] [stdout] Scenario: Unary minus on identifier [INFO] [stdout] ✔ Given the input "-x" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'UnaryExpr(Minus, Ident("x"))' [INFO] [stdout] Scenario: Double negation [INFO] [stdout] ✔ Given the input "--42" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'UnaryExpr(Minus, Literal(Integer(-42)))' [INFO] [stdout] Feature: flt version [INFO] [stdout] Scenario: flt version [INFO] [stdout] ? When the command `flt version` is run [INFO] [stdout] Step skipped: features/cli.feature:5:5 [INFO] [stdout] Scenario: flt -e evaluates an expression [INFO] [stdout] ? When the command `flt -e '1 + 2'` is run [INFO] [stdout] Step skipped: features/cli.feature:10:5 [INFO] [stdout] Scenario: flt -e evaluates a program with many statements [INFO] [stdout] ? When the command `flt -e 'let x = 2; x * 3'` is run [INFO] [stdout] Step skipped: features/cli.feature:15:5 [INFO] [stdout] Scenario: flt -e fails on a syntax error [INFO] [stdout] ? When the command `flt -e '1 +'` is run [INFO] [stdout] Step skipped: features/cli.feature:20:5 [INFO] [stdout] Scenario: flt runs a program file [INFO] [stdout] ? When the command `flt fixtures/examples/hello.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:25:5 [INFO] [stdout] Scenario: flt runs a program file with many statements [INFO] [stdout] ? When the command `flt fixtures/examples/multi.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:31:5 [INFO] [stdout] Scenario: flt runs a program file that starts with a shebang [INFO] [stdout] ? When the command `flt fixtures/examples/shebang.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:37:5 [INFO] [stdout] Scenario: flt does not print the value of the last statement of a program file [INFO] [stdout] ? When the command `flt fixtures/examples/value.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:42:5 [INFO] [stdout] Scenario: flt fails on a program file that does not exist [INFO] [stdout] ? When the command `flt fixtures/examples/missing.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:47:5 [INFO] [stdout] Scenario: flt fails on a syntax error in a program file [INFO] [stdout] ? When the command `flt fixtures/examples/syntax_error.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:52:5 [INFO] [stdout] Scenario: flt does not accept -e with a program file [INFO] [stdout] ? When the command `flt -e '1' fixtures/examples/hello.flt` is run [INFO] [stdout] Step skipped: features/cli.feature:57:5 [INFO] [stdout] Feature: const functions [INFO] [stdout] Scenario: A const def gives None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: Calling a const function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "12" [INFO] [stdout] Scenario: A const function can have keywords, a variadic parameter and a return [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[-1, 0, 7, 1]" [INFO] [stdout] Scenario: A const function can have a block and a local binding [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "4" [INFO] [stdout] Scenario: A const function can call itself [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "120" [INFO] [stdout] Scenario: A const function can be called in the whitespace form and in a pipe [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[4, 6, 8]" [INFO] [stdout] Scenario: A const function can only be declared at the top level [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define f here" [INFO] [stdout] Scenario: A const function calls a const function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "24" [INFO] [stdout] Scenario: A const function calls typeof [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A const function calls a native function that is const [INFO] [stdout] ✔ Given the native function "square(n: Integer) -> Integer" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "9" [INFO] [stdout] Scenario: A const function can't call a function declared with def [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function stamp is not const and cannot be called here" [INFO] [stdout] Scenario: A const function can't call a native function that is not const [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function identity is not const and cannot be called here" [INFO] [stdout] Scenario: A call in a pipe is a call [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function identity is not const and cannot be called here" [INFO] [stdout] Scenario: A call in a block of a const function is checked [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function stamp is not const and cannot be called here" [INFO] [stdout] Scenario: A function that a const function calls is const too [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function stamp is not const and cannot be called here" [INFO] [stdout] Scenario: A const function reads a global constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: A const function can't read a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Unbound identifier: base" [INFO] [stdout] Scenario: The check comes when the call runs [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "0" [INFO] [stdout] Scenario: A const function can call a function that is declared later [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A def function calls a const function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "6" [INFO] [stdout] Scenario: A def function that calls a const function can still call other functions [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "6" [INFO] [stdout] Scenario: A default can call a const function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "120" [INFO] [stdout] Scenario: A default of a const function can call a const function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "120" [INFO] [stdout] Scenario: A default can call typeof [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A default can't call a function that is not const [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function one is not const and cannot be called here" [INFO] [stdout] Scenario: A default can't call a native function that is not const [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function identity is not const and cannot be called here" [INFO] [stdout] Scenario: A default that the call gives raises no error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "15" [INFO] [stdout] Scenario: A const function can have several overloads [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["integer", "string"]' [INFO] [stdout] Scenario: A def can't add an overload to a const function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function f is const, so all of its overloads must be const" [INFO] [stdout] Scenario: A const def can't add an overload to a function declared with def [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function f is not const, so none of its overloads can be const" [INFO] [stdout] Scenario: The const check comes before the duplicate check [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function f is not const, so none of its overloads can be const" [INFO] [stdout] Scenario: Two const overloads can't have the same parameters [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "already has the overload" [INFO] [stdout] Scenario: The type of a const function shows const [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "const fn(Integer, Integer) -> Integer" [INFO] [stdout] Scenario: The type of a function with several const overloads shows const on each [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "const fn(Integer) -> String | const fn(String) -> String" [INFO] [stdout] Scenario: The type of a def function does not show const [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Integer, Integer) -> Integer" [INFO] [stdout] Scenario: The type of a native const function shows const [INFO] [stdout] ✔ Given the native function "square(n: Integer) -> Integer" [INFO] [stdout] ✔ And the input 'typeof(square)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "const fn(Integer) -> Integer" [INFO] [stdout] Feature: Declaring functions with def [INFO] [stdout] Scenario: A def gives None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: Calling a declared function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A declared function can be called in the whitespace form [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A declared function can be piped into [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "42.0" [INFO] [stdout] Scenario: The type of a declared function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Integer, Integer) -> Integer" [INFO] [stdout] Scenario: A function with no parameters [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: A declared function is a function value [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: The parameters can be positional, variadic and keyword [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(String, *Any, level: Symbol) -> None" [INFO] [stdout] Scenario: A rest keywords parameter shows as **T [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(**Any) -> Map" [INFO] [stdout] Scenario: A variadic parameter is an Array in the body [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '[1, :a, "b"]' [INFO] [stdout] Scenario: A variadic parameter with no values is an empty Array [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[]" [INFO] [stdout] Scenario: A rest keywords parameter is a Map in the body [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "{color: :red, size: 3}" [INFO] [stdout] Scenario: A parameter in the wrong order is a parse error [INFO] [stdout] ✔ Given the input 'def f(k: Integer = 1, n: Integer) -> Integer n end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A variadic parameter after a keyword parameter is a parse error [INFO] [stdout] ✔ Given the input 'def f(k: Integer = 1, *rest: Any) -> Integer k end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Two variadic parameters are a parse error [INFO] [stdout] ✔ Given the input 'def f(*a: Any, *b: Any) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A parameter name can't occur twice [INFO] [stdout] ✔ Given the input 'def f(n: Integer, n: Integer) -> Integer n end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A parameter without a type is a parse error [INFO] [stdout] ✔ Given the input 'def f(n) -> Integer n end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A parameter after the rest keywords parameter is a parse error [INFO] [stdout] ✔ Given the input 'def f(n: Integer, **k: Any, j: Integer) -> Integer n end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A def without a body is a parse error [INFO] [stdout] ✔ Given the input 'def f(n: Integer) -> Integer' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A reserved keyword can't be a function name [INFO] [stdout] ✔ Given the input 'def end() 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: An argument of the wrong type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument d of mod expects Integer, found String" [INFO] [stdout] Scenario: A missing argument [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function mod expected 2 argument(s), found 1" [INFO] [stdout] Scenario: A Number parameter converts an Integer [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1.0" [INFO] [stdout] Scenario: An unexpected keyword [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function one got an unexpected keyword argument: k" [INFO] [stdout] Scenario: An omitted keyword takes its default [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hello, Ann"' [INFO] [stdout] Scenario: A keyword argument replaces the default [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hi, Ann"' [INFO] [stdout] Scenario: A keyword of the wrong type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Keyword argument greeting of greet expects String, found Integer" [INFO] [stdout] Scenario: A default can't use another parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: a" [INFO] [stdout] Scenario: The value of a default must be of the type of the keyword [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Keyword argument k of f expects Integer, found String" [INFO] [stdout] Scenario: The function gives the value of its last statement [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: An empty body gives None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: Without a return type, the return type is None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn() -> None" [INFO] [stdout] Scenario: Without a return type, the body must give None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function one returned Integer, expected None" [INFO] [stdout] Scenario: The result must be of the return type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function f returned Integer, expected String" [INFO] [stdout] Scenario: A Number result converts an Integer [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1.0" [INFO] [stdout] Scenario: Parameters are not visible after the call [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: n" [INFO] [stdout] Scenario: A let in the body is local to the call [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: inner" [INFO] [stdout] Scenario: A parameter hides a global variable of the same name [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A parameter keeps its declared type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects Integer, found String" [INFO] [stdout] Scenario: An assignment to an unbound name in the body declares it in the call [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: x" [INFO] [stdout] Scenario: A function can call itself [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "120" [INFO] [stdout] Scenario: Each call has its own scope [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "6" [INFO] [stdout] Scenario: A second def with the same name adds an overload [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["integer", "string"]' [INFO] [stdout] Scenario: The type of an overloaded function shows every overload [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Integer) -> String | fn(String) -> String" [INFO] [stdout] Scenario: Overloads can differ in arity [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["none", "one"]' [INFO] [stdout] Scenario: An overload with equal parameter types raises an error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function foo already has the overload" [INFO] [stdout] Scenario: Overloads that differ only in a positional name are duplicates [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function foo already has the overload" [INFO] [stdout] Scenario: Overloads that differ only in a default are duplicates [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function foo already has the overload" [INFO] [stdout] Scenario: A def can't use the name of a built-in type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define Number: it's a built-in type" [INFO] [stdout] Scenario: A def can't use the name of a variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define x: it's a variable" [INFO] [stdout] Scenario: A def can't add an overload to a native function [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define identity: it's a function" [INFO] [stdout] Scenario: A function's name can't be bound as a variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind one: it's a function" [INFO] [stdout] Feature: Functions as values [INFO] [stdout] Scenario: A native function's name evaluates to a function value [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'identity' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "" [INFO] [stdout] Scenario: Calling a native function [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'identity(42)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "42" [INFO] [stdout] Scenario: The type of a native function [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'typeof(identity)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Any) -> Any" [INFO] [stdout] Scenario Outline: A function type brackets a union where | would be misread [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'typeof(join)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(*(String | Symbol)) -> String" [INFO] [stdout] Scenario Outline: A function type brackets a union where | would be misread [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'typeof(tags)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(String | Symbol, k: Number | None, **(String | Symbol)) -> (Map | None)" [INFO] [stdout] Scenario: Calling a function through another name [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'let f = identity; f(42)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "42" [INFO] [stdout] Scenario: A function value equals itself [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'let f = identity; f == identity' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: A native function's name can't be bound [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'let identity = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind identity: it's a function" [INFO] [stdout] Scenario: Assigning to a native function's name [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'identity = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind identity: it's a function" [INFO] [stdout] Scenario: Calling with the wrong number of arguments [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'identity(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function identity expected 1 argument(s), found 2" [INFO] [stdout] Scenario: Calling a non-function [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'let x = 1; x(2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "x is not a function" [INFO] [stdout] Scenario: Calling an unknown function [INFO] [stdout] ✔> Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "join(*parts: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "tags(name: String | Symbol, k: Number | None = None, **kwargs: String | Symbol) -> Map | None" [INFO] [stdout] ✔ Given the input 'nope(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Undefined function: nope" [INFO] [stdout] Feature: Integer arguments [INFO] [stdout] Scenario Outline: An Integer parameter accepts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'pad("ab", 4)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] Hello, world! [INFO] [stdout] Hello [INFO] [stdout] x is 1 [INFO] [stdout] ✔ Then the result should be '" ab"' [INFO] [stdout] Scenario Outline: An Integer parameter accepts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'pad("ab", 8 / 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '" ab"' [INFO] [stdout] Scenario Outline: An Integer parameter accepts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'pad("ab", 9 // 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '" ab"' [INFO] [stdout] Scenario Outline: An Integer parameter doesn't accept a Number, even a whole one [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'pad("ab", 4.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument width of pad expects Integer, found Number' [INFO] [stdout] Scenario Outline: An Integer parameter doesn't accept a Number, even a whole one [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'pad("ab", 4.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument width of pad expects Integer, found Number' [INFO] [stdout] Scenario Outline: An Integer parameter doesn't accept a Number, even a whole one [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'pad("ab", 8.0 / 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument width of pad expects Integer, found Number' [INFO] [stdout] Scenario Outline: A Number parameter converts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'scale(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A Number parameter converts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'scale(1.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.5' [INFO] [stdout] Scenario Outline: A Number parameter converts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'typeof(scale(1))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: A Number parameter converts an Integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input '2 |> scale' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.0' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'either(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'either(1.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'num_or_str(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'num_or_str("a")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"a"' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'maybe(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'maybe(None)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'None' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'identity(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1' [INFO] [stdout] Scenario Outline: A union converts an Integer only if no member accepts it as it is [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'typeof(identity(1))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: Variadic values and keyword values are converted too [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'total(1, 2, 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '6.0' [INFO] [stdout] Scenario Outline: Variadic values and keyword values are converted too [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'total(1, 2.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.5' [INFO] [stdout] Scenario Outline: Variadic values and keyword values are converted too [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'total()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '0.0' [INFO] [stdout] Scenario Outline: Variadic values and keyword values are converted too [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'scores(a: 1, b: 2.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{a: 1.0, b: 2.5}' [INFO] [stdout] Scenario Outline: Variadic values and keyword values are converted too [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'step(by: 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.0' [INFO] [stdout] Scenario: A keyword's Integer default is converted when it's used [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'step()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1.0" [INFO] [stdout] Scenario: A Number result is converted [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'rows()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "5.0" [INFO] [stdout] Scenario: A function's type shows the declared types [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the input 'typeof(scale)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Number) -> Number" [INFO] [stdout] Scenario Outline: A handler reads a Number argument as a Rust integer, if it's whole [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "take(n: Number) -> Integer" [INFO] [stdout] ✔ And the input 'take(3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: A handler reads a Number argument as a Rust integer, if it's whole [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "take(n: Number) -> Integer" [INFO] [stdout] ✔ And the input 'take(3.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario: A handler can't read a fraction as a Rust integer [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "take(n: Number) -> Integer" [INFO] [stdout] ✔ And the input 'take(2.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot convert 2.5 to usize" [INFO] [stdout] Scenario Outline: A handler reads an Integer as a BigInt, and a Number as a BigDecimal [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "double(n: Integer) -> Integer" [INFO] [stdout] ✔ And the native function "halve(x: Number) -> Number" [INFO] [stdout] ✔ And the input 'double(9223372036854775807)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '18446744073709551614' [INFO] [stdout] Scenario Outline: A handler reads an Integer as a BigInt, and a Number as a BigDecimal [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "double(n: Integer) -> Integer" [INFO] [stdout] ✔ And the native function "halve(x: Number) -> Number" [INFO] [stdout] ✔ And the input 'double(-3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-6' [INFO] [stdout] Scenario Outline: A handler reads an Integer as a BigInt, and a Number as a BigDecimal [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "double(n: Integer) -> Integer" [INFO] [stdout] ✔ And the native function "halve(x: Number) -> Number" [INFO] [stdout] ✔ And the input 'halve(3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.5' [INFO] [stdout] Scenario Outline: A handler reads an Integer as a BigInt, and a Number as a BigDecimal [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "double(n: Integer) -> Integer" [INFO] [stdout] ✔ And the native function "halve(x: Number) -> Number" [INFO] [stdout] ✔ And the input 'halve(4)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.0' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'f(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Integer) 1"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'f(1.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Number) 1.0"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input '1 |> f' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Integer) 1"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'show(1.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Number) 1.0"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'show(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Number) 1.0"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'show(:a)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Any) :a"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'g(1, 2.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Integer, Number) 1, 2.0"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'g(1.0, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Number, Integer) 1.0, 2"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'g(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(Integer, Number) 1, 2.0"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'kw(n: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(n: Integer) 1"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'kw(n: 1.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(n: Number) 1.0"' [INFO] [stdout] Scenario Outline: SimpleRuntime runs the narrowest overload that matches [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the native function "show(x: Any) -> String" [INFO] [stdout] ✔ And the native function "show(x: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Integer, b: Number) -> String" [INFO] [stdout] ✔ And the native function "g(a: Number, b: Integer) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Number = 0) -> String" [INFO] [stdout] ✔ And the native function "kw(n: Integer = 0) -> String" [INFO] [stdout] ✔ And the input 'kw()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"(n: Number) 0.0"' [INFO] [stdout] Scenario: A function's type lists both overloads [INFO] [stdout] ✔> Given the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "scale(x: Number) -> Number" [INFO] [stdout] ✔> And the native function "either(x: Integer | Number) -> Any" [INFO] [stdout] ✔> And the native function "num_or_str(x: Number | String) -> Any" [INFO] [stdout] ✔> And the native function "maybe(x: Option) -> Any" [INFO] [stdout] ✔> And the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function "step(by: Number = 1) -> Number" [INFO] [stdout] ✔> And the native function "rows() -> Number" [INFO] [stdout] ✔ Given the native function "f(n: Number) -> String" [INFO] [stdout] ✔ And the native function "f(i: Integer) -> String" [INFO] [stdout] ✔ And the input 'typeof(f)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Number) -> String | fn(Integer) -> String" [INFO] [stdout] Feature: Keyword arguments [INFO] [stdout] Scenario: An omitted keyword takes its default [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hello, Ann"' [INFO] [stdout] Scenario: A keyword overrides its default [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: "Hi")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hi, Ann"' [INFO] [stdout] Scenario: A quoted keyword names the same keyword [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", "greeting": "Hi")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hi, Ann"' [INFO] [stdout] Scenario: Piping passes the piped value positionally [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input '"Ann" |> greet(greeting: "Hi")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hi, Ann"' [INFO] [stdout] Scenario: A keyword is never filled by position [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", "Hi")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function greet expected 1 argument(s), found 2" [INFO] [stdout] Scenario: An undeclared keyword is an error [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", tone: "warm")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function greet got an unexpected keyword argument: tone" [INFO] [stdout] Scenario: A function without keywords rejects them [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'keys({}, b: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function keys got an unexpected keyword argument: b" [INFO] [stdout] Scenario: A built-in rejects keywords [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'typeof(1, k: 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function typeof got an unexpected keyword argument: k" [INFO] [stdout] Scenario: A map literal is a positional argument [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'keys({b: 1, a: 2})' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[:b, :a]" [INFO] [stdout] Scenario: Rest keywords arrive in call order [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'options(b: 1, a: 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "{b: 1, a: 2}" [INFO] [stdout] Scenario: No keywords give an empty map [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'options()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "{}" [INFO] [stdout] Scenario Outline: A repeated keyword doesn't parse [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: "Hi", greeting: "Yo")' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A repeated keyword doesn't parse [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: "Hi", "greeting": "Yo")' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A repeated keyword doesn't parse [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet "Ann", greeting: "Hi", greeting: "Yo"' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A repeated keyword doesn't parse [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input '"Ann" |> greet(greeting: "Hi", greeting: "Yo")' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A repeated keyword's error names the keyword and the call [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: "Hi", greeting: "Yo")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Parser Error: Duplicate keyword argument greeting in the call to greet' [INFO] [stdout] Scenario Outline: A repeated keyword's error names the keyword and the call [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: "Hi", "greeting": "Yo")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Parser Error: Duplicate keyword argument greeting in the call to greet' [INFO] [stdout] Scenario Outline: A repeated keyword's error names the keyword and the call [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'greet "Ann", greeting: "Hi", greeting: "Yo"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Parser Error: Duplicate keyword argument greeting in the call to greet' [INFO] [stdout] Scenario Outline: A repeated keyword's error names the keyword and the call [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'options("c d": 1, "c d": 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Parser Error: Duplicate keyword argument "c d" in the call to options' [INFO] [stdout] Scenario: A map literal keeps the last duplicate key [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'keys({n: 1, n: 2})' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[:n]" [INFO] [stdout] Scenario Outline: Function types show keywords [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'typeof(greet)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(String, greeting: String) -> String" [INFO] [stdout] Scenario Outline: Function types show keywords [INFO] [stdout] ✔> Given the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "options(**kwargs: Any) -> Map" [INFO] [stdout] ✔> And the native function "keys(map: Map) -> Array" [INFO] [stdout] ✔ Given the input 'typeof(options)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(**Any) -> Map" [INFO] [stdout] Feature: Native function arguments [INFO] [stdout] Scenario Outline: An argument is read by name, positional or keyword [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input 'repeat("ab", 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"ababab"' [INFO] [stdout] Scenario Outline: An argument is read by name, positional or keyword [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input 'repeat("ab")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"abab"' [INFO] [stdout] Scenario Outline: An argument is read by name, positional or keyword [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input 'repeat("ab", n: 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"ababab"' [INFO] [stdout] Scenario Outline: An argument is read by name, positional or keyword [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input '"ab" |> repeat(3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"ababab"' [INFO] [stdout] Scenario Outline: An argument is read by name, positional or keyword [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input '"ab" |> repeat(n: 0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '""' [INFO] [stdout] Scenario: An argument can't be both positional and a keyword [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input 'repeat("ab", 3, n: 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function repeat got an unexpected keyword argument: n" [INFO] [stdout] Scenario: A number that doesn't fit the Rust type isn't converted [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the input 'repeat("ab", -1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot convert -1 to usize" [INFO] [stdout] Scenario: An Option argument reads a value [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "twice(n: Option) -> Option" [INFO] [stdout] ✔ And the input 'twice(21)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "42" [INFO] [stdout] Scenario: An Option argument reads None as None [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "twice(n: Option) -> Option" [INFO] [stdout] ✔ And the input 'twice(None)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A handler reads an array's elements [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "size(items: Array) -> Integer" [INFO] [stdout] ✔ And the input 'size([1, :a, "b"])' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: An Any argument read as a String [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "shout(v: Any) -> String" [INFO] [stdout] ✔ And the input 'shout("hi")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"HI!"' [INFO] [stdout] Scenario: An Any argument that isn't a String can't be read as one [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "shout(v: Any) -> String" [INFO] [stdout] ✔ And the input 'shout(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Expected String, found Integer" [INFO] [stdout] Scenario: Reading an undeclared name is a handler error [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "typo(name: String) -> String" [INFO] [stdout] ✔ And the input 'typo("Ann")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Handler Error: Function typo has no argument nmae" [INFO] [stdout] Scenario: Reading a variadic argument as one value is a handler error [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "first(*values: Any) -> Any" [INFO] [stdout] ✔ And the input 'first(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Handler Error: Argument values of first is variadic; read it with Arguments::rest" [INFO] [stdout] Scenario: A handler error is raised whether or not the call has values for it [INFO] [stdout] ✔> Given the native function "repeat(s: String, n: Integer) -> String" [INFO] [stdout] ✔> And the native function "repeat(s: String, n: Integer = 2) -> String" [INFO] [stdout] ✔ Given the native function "first(*values: Any) -> Any" [INFO] [stdout] ✔ And the input 'first()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Handler Error: Argument values of first is variadic; read it with Arguments::rest" [INFO] [stdout] Feature: Pattern matching in function parameters [INFO] [stdout] Scenario: A pattern runs for its value and the typed name for the others [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[1, 6]" [INFO] [stdout] Scenario: The order of the defs does not matter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[1, 6]" [INFO] [stdout] Scenario: A pattern alone accepts only its value [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"zero"' [INFO] [stdout] Scenario: A pattern is narrower than Integer, Number and Any [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["zero", "integer", "number", "zero", "any"]' [INFO] [stdout] Scenario: A pattern is narrower than a union [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["zero", "union", "union"]' [INFO] [stdout] Scenario: An integer pattern does not accept a number [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument 1 of foo expects 2, found 2.0" [INFO] [stdout] Scenario: A number pattern does not accept an integer [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument 1 of foo expects 2.0, found 2" [INFO] [stdout] Scenario: An integer pattern and a number pattern are different overloads [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["integer", "number"]' [INFO] [stdout] Scenario: A string pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["Hello", "Bonjour", "Hi"]' [INFO] [stdout] Scenario: A string pattern can hold an escaped brace [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"brace"' [INFO] [stdout] Scenario: A boolean pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["yes", "no"]' [INFO] [stdout] Scenario: A None pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["nothing", "something"]' [INFO] [stdout] Scenario: A symbol pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[1, 2]" [INFO] [stdout] Scenario: A negative integer pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["minus one", "other", "other", "other"]' [INFO] [stdout] Scenario: A negative number pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["minus two and a half", "other", "other"]' [INFO] [stdout] Scenario: A plus sign is part of the number [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["one", "two and a half", fn(1) -> String | fn(2.5) -> String]' [INFO] [stdout] Scenario: A pattern with a plus sign is the same as one without [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function foo already has the overload" [INFO] [stdout] Scenario: A negative integer pattern does not accept a number [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument 1 of foo expects -1, found -1.0" [INFO] [stdout] Scenario: A negative integer pattern does not accept its opposite [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument 1 of foo expects -1, found 1" [INFO] [stdout] Scenario: A negative integer pattern and a positive one are different overloads [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[1, 2]" [INFO] [stdout] Scenario: A negative pattern can follow another pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["zero, minus one", "other"]' [INFO] [stdout] Scenario: The type of a function shows a negative pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '[fn(-1) -> Integer, fn(-2.5) -> Integer]' [INFO] [stdout] Scenario: A recursive function ends on its patterns [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "55" [INFO] [stdout] Scenario: Patterns in more than one parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["both zero", "first zero", "none"]' [INFO] [stdout] Scenario: A pattern with a keyword parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[7, 14, 2]" [INFO] [stdout] Scenario: A pattern with a variadic parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[[1, 2], []]" [INFO] [stdout] Scenario: A pattern is part of the signature [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function foo already has the overload" [INFO] [stdout] Scenario: A pattern and a typed name are different overloads [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A const def can have patterns [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "120" [INFO] [stdout] Scenario: A const def with a pattern can't be mixed with a def [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function f is const, so all of its overloads must be const" [INFO] [stdout] Scenario: A def with a pattern can't be mixed with a const def [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function f is not const, so none of its overloads can be const" [INFO] [stdout] Scenario: The type of a function shows its pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Integer) -> Integer | fn(0) -> Integer" [INFO] [stdout] Scenario: The type of a pattern shows each kind of literal [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '[fn(2.5) -> None, fn("x") -> None, fn(true) -> None, fn(None) -> None, fn(:k) -> None]' [INFO] [stdout] Scenario: A pattern shows next to a typed name [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(0, String, k: Integer) -> None" [INFO] [stdout] Scenario: No overload accepts the value [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument 1 of foo expects 0, found 1" [INFO] [stdout] Scenario: No overload accepts the type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument 1 of foo expects 0, found "a"' [INFO] [stdout] Scenario: The error names the position of the pattern [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument 2 of foo expects 0, found 1" [INFO] [stdout] Scenario: The closest overload gives the error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Argument s of foo expects Integer, found String" [INFO] [stdout] Scenario: Overloads that are equally close give no overload accepts [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: No overload of foo accepts (Integer, String)" [INFO] [stdout] Scenario: A call with the wrong number of arguments is unchanged [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function foo expected 1 argument(s), found 0" [INFO] [stdout] Scenario: A name without a type is not a pattern [INFO] [stdout] ✔ Given the input 'def foo(x) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A const name is not a pattern [INFO] [stdout] ✔ Given the input 'def foo(MAX) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A call is not a pattern [INFO] [stdout] ✔ Given the input 'def foo(twice(DEFAULT)) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: An expression is not a pattern [INFO] [stdout] ✔ Given the input 'def foo(1 + 1) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A string pattern has no interpolation [INFO] [stdout] ✔ Given the input 'def foo("a{x}") -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A pattern can't be a variadic parameter [INFO] [stdout] ✔ Given the input 'def foo(*0) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A pattern can't be a keyword parameter [INFO] [stdout] ✔ Given the input 'def foo(k: 0 = 0) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A pattern can't be a rest keywords parameter [INFO] [stdout] ✔ Given the input 'def foo(**0) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A pattern can't follow a keyword parameter [INFO] [stdout] ✔ Given the input 'def foo(k: Integer = 1, 0) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A minus sign is only for a number [INFO] [stdout] ✔ Given the input 'def foo(-"a") -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A minus sign is not for a name [INFO] [stdout] ✔ Given the input 'def foo(-x) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Only one minus sign [INFO] [stdout] ✔ Given the input 'def foo(--1) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A parenthesized number is not a pattern [INFO] [stdout] ✔ Given the input 'def foo(-(1)) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: The minus sign touches the number [INFO] [stdout] ✔ Given the input 'def foo(- 1) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A pattern can't have a type [INFO] [stdout] ✔ Given the input 'def foo(0: Integer) -> Integer 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Feature: Pipe operator [INFO] [stdout] Scenario: Piping into a bare function name [INFO] [stdout] ✔ Given the input '1 |> typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: Piping into a call with no other arguments [INFO] [stdout] ✔ Given the input '1 |> typeof()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: Chaining pipes [INFO] [stdout] ✔ Given the input '1 |> typeof |> typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario: Piping into a function bound to another name [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input 'let g = identity; 42 |> g' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "42" [INFO] [stdout] Scenario: Piping into typeof bound to another name [INFO] [stdout] ✔ Given the input 'let t = typeof; 1 |> t' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: The piped value counts as an argument [INFO] [stdout] ✔ Given the input '1 |> typeof(2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function typeof expected 1 argument(s), found 2" [INFO] [stdout] Scenario: Piping into something that isn't a function [INFO] [stdout] ✔ Given the input '1 |> 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot pipe into 2" [INFO] [stdout] Scenario: Piping into a value that isn't a function [INFO] [stdout] ✔ Given the input '1 |> Number' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Number is not a function" [INFO] [stdout] Scenario: Piping into an unknown function [INFO] [stdout] ✔ Given the input '1 |> nope()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Undefined function: nope" [INFO] [stdout] Scenario: A pipe binds tighter than a comparison [INFO] [stdout] ✔ Given the input '1 |> typeof == Integer' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: Arithmetic binds tighter than a pipe [INFO] [stdout] ✔ Given the input '1 + 1 |> typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: Arithmetic binds tighter than a comparison [INFO] [stdout] ✔ Given the input '1 + 2 == 3' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input 'identity 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input 'identity(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input '1 |> identity' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input '1 |> identity()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input 'typeof 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input 'typeof(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input '1 |> typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: A call and a pipe into a function are equivalent [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input '1 |> typeof()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input '1 |> f 2' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input '1 |> f 2, 3' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input '1 |> f k: 2' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input 'f 1 |> g()' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input 'f 1, 2 |> g()' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input 'f 1 == 2 |> g()' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A call next to a pipe needs parentheses [INFO] [stdout] ✔ Given the input 'f k: 1 |> g()' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Piping a parenthesized call [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the input 'identity(1) |> typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A parenthesized pipe as a call's argument [INFO] [stdout] ✔ Given the input 'typeof (1 |> typeof)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Feature: println [INFO] [stdout] Scenario: println evaluates to None [INFO] [stdout] ✔ Given the input 'println("Hello, world!")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: The type of println [INFO] [stdout] ✔ Given the input 'typeof(println)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(String) -> None" [INFO] [stdout] Scenario: println can be piped into [INFO] [stdout] ✔ Given the input '"Hello" |> println' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: println prints an interpolated string [INFO] [stdout] ✔ Given the input 'let x = 1; println("x is {x}")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: println can't be bound [INFO] [stdout] ✔ Given the input 'let println = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind println: it's a function" [INFO] [stdout] Scenario: println accepts only a String [INFO] [stdout] ✔ Given the input 'println(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument s of println expects String, found Integer" [INFO] [stdout] Scenario: Calling println with the wrong number of arguments [INFO] [stdout] ✔ Given the input 'println()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function println expected 1 argument(s), found 0" [INFO] [stdout] Feature: The return statement [INFO] [stdout] Scenario: A return as the last statement [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: A return as the last statement gives the same value as the expression alone [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[3, 3]" [INFO] [stdout] Scenario: An early return from an expanded if [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["even", "odd"]' [INFO] [stdout] Scenario: An early return from a brace arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["negative", "not negative"]' [INFO] [stdout] Scenario: An early return in a recursive function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"even"' [INFO] [stdout] Scenario: A return from nested blocks leaves the function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[100, 10, 0]" [INFO] [stdout] Scenario: A return from elsif arms [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[:small, :medium, :large]" [INFO] [stdout] Scenario: A bare return gives None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A bare return before end, a semicolon and a brace [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[None, None]" [INFO] [stdout] Scenario: A bare return in a function that returns an Integer raises an error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function f returned None, expected Integer" [INFO] [stdout] Scenario: A return of the wrong type raises ReturnTypeMismatch [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function f returned String, expected Integer" [INFO] [stdout] Scenario: A function without a return type can only return None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function f returned Integer, expected None" [INFO] [stdout] Scenario: A return converts an Integer for a Number return type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1.0" [INFO] [stdout] Scenario: A return with a pipe [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "6" [INFO] [stdout] Scenario: The statements after a return never run [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A return stops the rest of the expression that holds it [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "5" [INFO] [stdout] Scenario: A return in a call that is part of an expression [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: A return only leaves the call that runs it [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A return closes the scopes that the call opened [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[2, 2]" [INFO] [stdout] Scenario: A return does not change the type of the function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Integer) -> Integer" [INFO] [stdout] Scenario: A return in an overload [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '["integer", "string"]' [INFO] [stdout] Scenario: A later call works after an early return [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[0, 2, 0]" [INFO] [stdout] Scenario: A return at the top level is a parse error [INFO] [stdout] ✔ Given the input "return 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A bare return at the top level is a parse error [INFO] [stdout] ✔ Given the input "return" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return in a top-level block is a parse error [INFO] [stdout] ✔ Given the input "{ return 1 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return in a top-level expanded if is a parse error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return inside an operand at the top level is a parse error [INFO] [stdout] ✔ Given the input "1 + { return 2 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return in an argument of a call at the top level is a parse error [INFO] [stdout] ✔ Given the input "typeof({ return 1 })" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return in the default of a keyword parameter is a parse error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return in a let at the top level is a parse error [INFO] [stdout] ✔ Given the input "let x = { return 1 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A parse error means that no statement runs [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A return is not an identifier or a function name [INFO] [stdout] ✔ Given the input 'def return() 1 end' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: Parsing return with an expression [INFO] [stdout] ✔ Given the input "return 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should print as "return 1" [INFO] [stdout] Scenario: Parsing a bare return [INFO] [stdout] ✔ Given the input "return" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should print as "return" [INFO] [stdout] Feature: Type-checked function calls [INFO] [stdout] Scenario Outline: Arguments of the declared types pass [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'pad("ab", 4)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '" ab"' [INFO] [stdout] Scenario Outline: Arguments of the declared types pass [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'total()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '0.0' [INFO] [stdout] Scenario Outline: Arguments of the declared types pass [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'total(1, 2, 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '6.0' [INFO] [stdout] Scenario Outline: Arguments of the declared types pass [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'scores(a: 1, b: 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{a: 1.0, b: 2.0}' [INFO] [stdout] Scenario Outline: Arguments of the declared types pass [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: "Hi")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"Hi, Ann"' [INFO] [stdout] Scenario Outline: An argument of the wrong type is an error [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'pad(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument s of pad expects String, found Integer' [INFO] [stdout] Scenario Outline: An argument of the wrong type is an error [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'pad("x", "2")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument width of pad expects Integer, found String' [INFO] [stdout] Scenario Outline: An argument of the wrong type is an error [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'total(1, "a")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument values of total expects Number, found String' [INFO] [stdout] Scenario Outline: An argument of the wrong type is an error [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'days_between(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument from of days_between expects Date, found Integer' [INFO] [stdout] Scenario Outline: An argument of the wrong type is an error [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'greet("Ann", greeting: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Keyword argument greeting of greet expects String, found Integer' [INFO] [stdout] Scenario Outline: An argument of the wrong type is an error [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'scores(a: "x")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Keyword argument a of scores expects Number, found String' [INFO] [stdout] Scenario: The return value is checked [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'liar()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function liar returned String, expected Number" [INFO] [stdout] Scenario Outline: The argument types pick the overload [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'describe(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"number"' [INFO] [stdout] Scenario Outline: The argument types pick the overload [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'describe("a")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"text"' [INFO] [stdout] Scenario Outline: The argument types pick the overload [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'describe(:a)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"text"' [INFO] [stdout] Scenario Outline: The argument types pick the overload [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input '1 |> describe' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"number"' [INFO] [stdout] Scenario: Overloads that fail at the same argument name none [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'describe(true)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: No overload of describe accepts (Boolean)" [INFO] [stdout] Scenario: An overloaded function's type shows every overload [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'typeof(describe)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Number) -> String | fn(String | Symbol) -> String" [INFO] [stdout] Scenario Outline: Overloads are tried by arity, longest first, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'pick(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the native function 'pick(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the input 'pick(1, :b)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"arity 1"' [INFO] [stdout] Scenario Outline: Overloads are tried by arity, longest first, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'pick(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the native function 'pick(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the input 'pick(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"arity 1"' [INFO] [stdout] Scenario Outline: Overloads are tried by arity, longest first, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'pick(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the native function 'pick(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the input 'pick(:b)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"arity 0"' [INFO] [stdout] Scenario Outline: Overloads are tried by arity, longest first, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'pick(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the native function 'pick(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the input 'pick()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"arity 0"' [INFO] [stdout] Scenario Outline: Overloads are tried by arity, longest first, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'pick(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the native function 'pick(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the input 'kcip(1, :b)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"arity 1"' [INFO] [stdout] Scenario Outline: Overloads are tried by arity, longest first, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'pick(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the native function 'pick(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(a: Number, *args: Any, which: String = "arity 1") -> String' [INFO] [stdout] ✔ And the native function 'kcip(*args: Any, which: String = "arity 0") -> String' [INFO] [stdout] ✔ And the input 'kcip(:b)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"arity 0"' [INFO] [stdout] Scenario Outline: Keywords pick among overloads of the same arity, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", n: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"n"' [INFO] [stdout] Scenario Outline: Keywords pick among overloads of the same arity, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", b: true, n: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"n"' [INFO] [stdout] Scenario Outline: Keywords pick among overloads of the same arity, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", t: "x")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"t"' [INFO] [stdout] Scenario Outline: Keywords pick among overloads of the same arity, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'oof("abc", b: true, n: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"n"' [INFO] [stdout] Scenario Outline: Keywords pick among overloads of the same arity, whatever their order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'oof("abc", t: "x")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"t"' [INFO] [stdout] Scenario Outline: A tie goes to the overload declared first [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", b: true)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"n"' [INFO] [stdout] Scenario Outline: A tie goes to the overload declared first [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'oof("abc", b: true)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"t"' [INFO] [stdout] Scenario Outline: Overloads of the same arity can differ in their first argument alone [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the input '[1, 2, 3] |> head(2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '[1, 2]' [INFO] [stdout] Scenario Outline: Overloads of the same arity can differ in their first argument alone [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the input '"abc" |> head(2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"ab"' [INFO] [stdout] Scenario Outline: The error names the overload that passes the most checks [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the input '[1, 2, 3] |> head("x")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument n of head expects Integer, found String' [INFO] [stdout] Scenario Outline: The error names the overload that passes the most checks [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the input '"abc" |> head(:x)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Argument n of head expects Integer, found Symbol' [INFO] [stdout] Scenario Outline: A keyword of the wrong type is closer than one that isn't accepted, whatever the order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", n: "x")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Keyword argument n of foo expects Number, found String' [INFO] [stdout] Scenario Outline: A keyword of the wrong type is closer than one that isn't accepted, whatever the order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'oof("abc", n: "x")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Keyword argument n of oof expects Number, found String' [INFO] [stdout] Scenario Outline: A keyword of the wrong type is closer than one that isn't accepted, whatever the order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", t: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Keyword argument t of foo expects String, found Integer' [INFO] [stdout] Scenario Outline: A keyword of the wrong type is closer than one that isn't accepted, whatever the order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", b: true, t: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Keyword argument t of foo expects String, found Integer' [INFO] [stdout] Scenario Outline: A keyword of the wrong type is closer than one that isn't accepted, whatever the order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", n: 1, z: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Function foo got an unexpected keyword argument: z' [INFO] [stdout] Scenario Outline: A keyword of the wrong type is closer than one that isn't accepted, whatever the order [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'oof(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'oof("abc", n: 1, z: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Function oof got an unexpected keyword argument: z' [INFO] [stdout] Scenario Outline: Overloads that are equally close name none [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'head(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: No overload of head accepts (Integer, Integer)' [INFO] [stdout] Scenario Outline: Overloads that are equally close name none [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", z: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: No overload of foo accepts (String, z: Integer)' [INFO] [stdout] Scenario Outline: Overloads that are equally close name none [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "head(items: Array, n: Integer) -> Array" [INFO] [stdout] ✔ And the native function "head(s: String, n: Integer) -> String" [INFO] [stdout] ✔ And the native function 'foo(s: String, n: Number = 0, b: Boolean = false) -> String' [INFO] [stdout] ✔ And the native function 'foo(s: String, t: String = "", b: Boolean = false) -> String' [INFO] [stdout] ✔ And the input 'foo("abc", b: 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: No overload of foo accepts (String, b: Integer)' [INFO] [stdout] Scenario Outline: The wrong number of arguments lists every accepted count [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "two(x: Any) -> Any" [INFO] [stdout] ✔ And the native function "two(x: Any, y: Any) -> Any" [INFO] [stdout] ✔ And the native function "mixed(a: Any, b: Any, c: Any, *rest: Any) -> Any" [INFO] [stdout] ✔ And the native function "mixed(a: Any) -> Any" [INFO] [stdout] ✔ And the input 'two(1, 2, 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Function two expected 1 or 2 argument(s), found 3' [INFO] [stdout] Scenario Outline: The wrong number of arguments lists every accepted count [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "two(x: Any) -> Any" [INFO] [stdout] ✔ And the native function "two(x: Any, y: Any) -> Any" [INFO] [stdout] ✔ And the native function "mixed(a: Any, b: Any, c: Any, *rest: Any) -> Any" [INFO] [stdout] ✔ And the native function "mixed(a: Any) -> Any" [INFO] [stdout] ✔ And the input 'mixed()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Function mixed expected 1 or at least 3 argument(s), found 0' [INFO] [stdout] Scenario Outline: The wrong number of arguments lists every accepted count [INFO] [stdout] ✔> Given the native function "describe(n: Number) -> String" [INFO] [stdout] ✔> And the native function "describe(s: String | Symbol) -> String" [INFO] [stdout] ✔> And the native function "pad(s: String, width: Integer) -> String" [INFO] [stdout] ✔> And the native function "total(*values: Number) -> Number" [INFO] [stdout] ✔> And the native function "liar() -> Number" [INFO] [stdout] ✔> And the native function "scores(**kwargs: Number) -> Map" [INFO] [stdout] ✔> And the native function 'greet(name: String, greeting: String = "Hello") -> String' [INFO] [stdout] ✔> And the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "two(x: Any) -> Any" [INFO] [stdout] ✔ And the native function "two(x: Any, y: Any) -> Any" [INFO] [stdout] ✔ And the native function "mixed(a: Any, b: Any, c: Any, *rest: Any) -> Any" [INFO] [stdout] ✔ And the native function "mixed(a: Any) -> Any" [INFO] [stdout] ✔ And the input 'mixed(1, 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly 'Runtime Error: Function mixed expected 1 or at least 3 argument(s), found 2' [INFO] [stdout] Feature: typeof [INFO] [stdout] Scenario: typeof's name evaluates to a function value [INFO] [stdout] ✔ Given the input 'typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "" [INFO] [stdout] Scenario: The type of typeof [INFO] [stdout] ✔ Given the input 'typeof(typeof)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "const fn(Any) -> Type" [INFO] [stdout] Scenario: Calling typeof through another name [INFO] [stdout] ✔ Given the input 'let t = typeof; t(42)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: typeof equals itself [INFO] [stdout] ✔ Given the input 'let t = typeof; t == typeof' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: typeof can't be bound [INFO] [stdout] ✔ Given the input 'let typeof = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind typeof: it's a function" [INFO] [stdout] Scenario: Calling typeof with the wrong number of arguments [INFO] [stdout] ✔ Given the input 'typeof()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function typeof expected 1 argument(s), found 0" [INFO] [stdout] Feature: A warning for statements after a return [INFO] [stdout] Scenario: A statement after a return in a body [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should warn with "Unreachable code in f: statements after return never run" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A bare return followed by a statement [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should warn with "Unreachable code in f: statements after return never run" [INFO] [stdout] Scenario: A return as the last statement gives no warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give no warnings [INFO] [stdout] Scenario: A function without a return gives no warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give no warnings [INFO] [stdout] Scenario: Several statements after a return give one warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] Scenario: A statement after a return in an arm of an expanded if [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should warn with "Unreachable code in f: statements after return never run" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A statement after a return in an else arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] Scenario: A statement after a return in a brace block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] Scenario: A statement after a return in a brace arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] Scenario: Each list of statements gives its own warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 2 warnings [INFO] [stdout] Scenario: A statement after an if with a return in an arm is reachable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give no warnings [INFO] [stdout] Scenario: The check does not follow the flow of the program [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give no warnings [INFO] [stdout] Scenario: The unreachable statements are not searched [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] Scenario: The warning names the function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should warn with "Unreachable code in second: statements after return never run" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A function that is never called still gives the warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] ✔ And the result should be "2" [INFO] [stdout] Scenario: Calling the function does not repeat the warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 1 warning [INFO] [stdout] Scenario: Each overload gives its own warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should give 2 warnings [INFO] [stdout] Scenario: A warning does not stop the function from working [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A warning does not stop the statements after the def [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A def that fails gives no warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function f already has the overload" [INFO] [stdout] Feature: Variadic arguments [INFO] [stdout] Scenario Outline: A variadic argument takes any number of arguments [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'count_args()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "0" [INFO] [stdout] Scenario Outline: A variadic argument takes any number of arguments [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'count_args(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: A variadic argument takes any number of arguments [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'count_args(1, 2, 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario Outline: A variadic argument takes any number of arguments [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input '1 |> count_args(2, 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario Outline: A variadic argument takes any number of arguments [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input '1 |> count_args' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: The type of a function with only a variadic argument [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'typeof(count_args)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(*Any) -> Integer" [INFO] [stdout] Scenario Outline: Fixed arguments are filled before the variadic one [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'sprintf("none")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"[]"' [INFO] [stdout] Scenario Outline: Fixed arguments are filled before the variadic one [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'sprintf("%d", 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"[1]"' [INFO] [stdout] Scenario Outline: Fixed arguments are filled before the variadic one [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'sprintf("%d %s", 1, "a")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"[1, a]"' [INFO] [stdout] Scenario Outline: Fixed arguments are filled before the variadic one [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input '"%d" |> sprintf(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"[1]"' [INFO] [stdout] Scenario Outline: Fixed arguments are filled before the variadic one [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input '"none" |> sprintf' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"[]"' [INFO] [stdout] Scenario: A fixed argument before the variadic one is required [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'sprintf()' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function sprintf expected at least 1 argument(s), found 0" [INFO] [stdout] Scenario: The type of a function with a fixed argument before the variadic one [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'typeof(sprintf)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(String, *Any) -> String" [INFO] [stdout] Scenario: A variadic argument doesn't receive keywords [INFO] [stdout] ✔> Given the native function "count_args(*args: Any) -> Integer" [INFO] [stdout] ✔> And the native function "sprintf(format: String, *args: Any) -> String" [INFO] [stdout] ✔ Given the input 'count_args(1, 2, k: 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Function count_args got an unexpected keyword argument: k" [INFO] [stdout] Feature: flt repl [INFO] [stdout] Scenario: evaluate a simple expression [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:4:5 [INFO] [stdout] Scenario: parse an expression without evaluating it [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:12:5 [INFO] [stdout] Scenario: unknown slash command [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:20:5 [INFO] [stdout] Scenario: unset a bound variable [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:28:5 [INFO] [stdout] Scenario: unset a typed variable removes its declared type [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:39:5 [INFO] [stdout] Scenario: unset a constant lets the name be bound again [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:50:5 [INFO] [stdout] Scenario: inspect an unbound variable [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:62:5 [INFO] [stdout] Scenario: inspect a bound variable [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:70:5 [INFO] [stdout] Scenario: inspect a bound variable using the short alias [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:79:5 [INFO] [stdout] Scenario: inspect a scalar literal [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:88:5 [INFO] [stdout] Scenario: inspect a decimal literal [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:96:5 [INFO] [stdout] Scenario: inspect an array literal [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:104:5 [INFO] [stdout] Scenario: inspect a map literal [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:112:5 [INFO] [stdout] Scenario: quit the REPL [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:120:5 [INFO] [stdout] Scenario: quit the REPL using the short alias [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:129:5 [INFO] [stdout] Scenario: show help [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:138:5 [INFO] [stdout] Scenario: show help using the short alias [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:146:5 [INFO] [stdout] Scenario: history is disabled with FLT_NO_HISTORY [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:154:5 [INFO] [stdout] Scenario: declare and inspect a const function [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/basic.feature:162:5 [INFO] [stdout] Feature: flt repl warnings [INFO] [stdout] Scenario: a statement after a return [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/warnings.feature:7:5 [INFO] [stdout] Scenario: the function still works [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/warnings.feature:15:5 [INFO] [stdout] Scenario: no warning without dead code [INFO] [stdout] ? When the REPL is run and the user types: [INFO] [stdout] Step skipped: features/repl/warnings.feature:25:5 [INFO] [stdout] Feature: Block scope [INFO] [stdout] Scenario: A block evaluates to its only expression [INFO] [stdout] ✔ Given the input "{ 1 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A block evaluates to its last statement [INFO] [stdout] ✔ Given the input "{ let a = 1; a * 2 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A block with statements on separate lines [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A block that ends with a declaration evaluates to the value [INFO] [stdout] ✔ Given the input "{ let a = 3 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: A block is an operand [INFO] [stdout] ✔ Given the input "{ 1 } + { 2 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: A block is an argument [INFO] [stdout] ✔ Given the input "typeof({ 1 })" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A name declared in a block is gone after the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: a" [INFO] [stdout] Scenario: A block can read a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "11" [INFO] [stdout] Scenario: A let in a block hides a global variable until the block ends [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[11, 1]" [INFO] [stdout] Scenario: A typed let in a block checks the type [INFO] [stdout] ✔ Given the input "{ let n: Integer = 1.5 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects Integer, found Number" [INFO] [stdout] Scenario: A typed let in a block hides the type of an outer variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: An assignment in a block changes a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: An assignment in a block keeps to the declared type of the variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects Integer, found String" [INFO] [stdout] Scenario: An assignment to an unbound name declares it in the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: z" [INFO] [stdout] Scenario: An assignment to a name that a let declared in the block stays in the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: An inner block reads the names of the outer block [INFO] [stdout] ✔ Given the input "{ let a = 1; { let b = a + 1; b + 1 } }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: An outer block doesn't see the names of an inner block [INFO] [stdout] ✔ Given the input "{ { let b = 1 }; b }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: b" [INFO] [stdout] Scenario: An inner block changes a variable of the outer block [INFO] [stdout] ✔ Given the input "{ let a = 1; { a = 2 }; a }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A block in a function body reads a parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A name declared in a block in a function body is gone after the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: a" [INFO] [stdout] Scenario: An assignment in a block changes a parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A function doesn't see the blocks of its caller [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: a" [INFO] [stdout] Scenario: A function called in a block reads global constants [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "6" [INFO] [stdout] Scenario: A block can't bind the name of a built-in type [INFO] [stdout] ✔ Given the input "{ let Number = 1 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Number" [INFO] [stdout] Scenario: A def in a block is not allowed [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define one here: a function can only be declared at the top level" [INFO] [stdout] Scenario: A def in the arm of an if is not allowed [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define one here" [INFO] [stdout] Scenario: A def in the body of a function is not allowed [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot define inner here: a function can only be declared at the top level" [INFO] [stdout] Scenario: A def at the top level is allowed after a block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Feature: Constants [INFO] [stdout] Scenario: A constant without a type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"default"' [INFO] [stdout] Scenario: A const evaluates to the bound value [INFO] [stdout] ✔ Given the input "const LIMIT = 10" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "10" [INFO] [stdout] Scenario: A constant has the type of its value [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A constant with a type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "10" [INFO] [stdout] Scenario: A constant with a type converts the value [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2.0" [INFO] [stdout] Scenario: A constant with a union type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A constant with the wrong type [INFO] [stdout] ✔ Given the input "const I: Integer = 1.0" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable I expects Integer, found Number" [INFO] [stdout] Scenario: A constant with an unknown type [INFO] [stdout] ✔ Given the input "const T: Foo = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unknown type: Foo" [INFO] [stdout] Scenario: The name is not a constant name by rule [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "10" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: The expression is evaluated once [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "6" [INFO] [stdout] Scenario: A constant is used in an expression [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "21" [INFO] [stdout] Scenario: A variable that copies a constant is a variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A keyword is not a name [INFO] [stdout] ✔ Given the input "const if = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: const is a keyword [INFO] [stdout] ✔ Given the input "let const = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: const needs a value [INFO] [stdout] ✔ Given the input "const A" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario: A constant cannot use a built-in type name [INFO] [stdout] ✔ Given the input "const Number = 5" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Number: it's a built-in type" [INFO] [stdout] Scenario: A constant cannot use the name of a function [INFO] [stdout] ✔ Given the input "const typeof = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind typeof: it's a function" [INFO] [stdout] Scenario: A let rebinds a constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: An assignment rebinds a constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: A second const rebinds a constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: A typed let rebinds a constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: The value of a rebind is not evaluated [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant A" [INFO] [stdout] Scenario: A constant may be declared again after a variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A variable is not a constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A let in a block hides a constant, with a warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should warn with "Constant LIMIT is hidden by a new binding" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: The constant is back after the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "10" [INFO] [stdout] Scenario: A const in a block hides a constant, with a warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] ✔ And the evaluation should warn with "Constant LIMIT is hidden by a new binding" [INFO] [stdout] Scenario: A let in a function body hides a global constant, with a warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] ✔ And the evaluation should warn with "Constant LIMIT is hidden by a new binding" [INFO] [stdout] Scenario: A let in a block inside a block hides a constant of the outer block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] ✔ And the evaluation should warn with "Constant A is hidden by a new binding" [INFO] [stdout] Scenario: An assignment in a block reaches the constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: An assignment after a hiding let changes the block variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A hidden constant is unchanged [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "10" [INFO] [stdout] ✔ And the evaluation should give 1 warning [INFO] [stdout] Scenario: A failed hiding declaration gives no warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable LIMIT expects Integer, found String" [INFO] [stdout] Scenario: A parameter hides a global constant with no warning [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A function reads a global constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "11" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A function cannot assign a global constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: A constant in a function body ends with the call [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A constant in a block is gone after the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: A" [INFO] [stdout] Scenario: A constant in a block can be declared again after the block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A constant in an if arm is gone after the if [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Feature: Function visibility [INFO] [stdout] Scenario: A body reads a global constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A body reads a constant that is declared after the function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: A body calls a global function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "12" [INFO] [stdout] Scenario: A body calls a native function [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A body reads a type name [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A parameter hides a global variable of the same name [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A function called in a block sees the same names [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: A body can't read a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Unbound identifier: base" [INFO] [stdout] Scenario: A block in a body can't read a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Unbound identifier: base" [INFO] [stdout] Scenario: A body can't call a function that a global variable holds [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Undefined function: g" [INFO] [stdout] Scenario: A variable that a body does not read is no problem [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: An assignment in a body declares a local and keeps the global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[1, 0]" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: A function can't count in a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Unbound identifier: counter" [INFO] [stdout] Scenario: A let in a body declares a local and keeps the global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[2, 1]" [INFO] [stdout] ✔ And the evaluation should give no warnings [INFO] [stdout] Scenario: An assignment in a body can't change a global constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Cannot rebind constant LIMIT" [INFO] [stdout] Scenario: A global variable keeps its value after a call [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: A default can use a global constant [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "5" [INFO] [stdout] Scenario: A default can use a type name [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A default can't use a global variable [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Unbound identifier: base" [INFO] [stdout] Scenario: A default can call a native function that is const [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario: A default can't call a native function that is not const [INFO] [stdout] ✔ Given the native function "identity(v: Any) -> Any" [INFO] [stdout] ✔ And the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function identity is not const and cannot be called here" [INFO] [stdout] Scenario: A default can't call a function declared with def, which is not const [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Function one is not const and cannot be called here" [INFO] [stdout] Scenario: A default that the call does not use raises no error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "15" [INFO] [stdout] Scenario: A default can't use another parameter [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "Runtime Error: Unbound identifier: a" [INFO] [stdout] Feature: Assignment [INFO] [stdout] Scenario: Declaring a variable with let [INFO] [stdout] ✔ Given the input "let x = 1;" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "x" without a type [INFO] [stdout] ✔ And the statement should print as "let x = 1" [INFO] [stdout] Scenario: Assigning a value without a let keyword [INFO] [stdout] ✔ Given the input "x = 1;" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be an assignment to "x" [INFO] [stdout] ✔ And the statement should print as "x = 1" [INFO] [stdout] Scenario Outline: A reserved keyword can't be a binding name [INFO] [stdout] ✔ Given the input "let if = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A reserved keyword can't be a binding name [INFO] [stdout] ✔ Given the input "let fn = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A reserved keyword can't be a binding name [INFO] [stdout] ✔ Given the input "let let = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A reserved keyword can't be a binding name [INFO] [stdout] ✔ Given the input "for = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: A reserved keyword can't be a binding name [INFO] [stdout] ✔ Given the input "not = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A name that starts with a keyword can be bound [INFO] [stdout] ✔ Given the input "iffy = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be an assignment to "iffy" [INFO] [stdout] Feature: Conditionals [INFO] [stdout] Scenario: If with block branches and else [INFO] [stdout] ✔ Given the input "if true { 1 } else { 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Block([Expr(Literal(Integer(1)))]), else_branch: Some(Block([Expr(Literal(Integer(2)))])) }' [INFO] [stdout] Scenario: If with block branches and else (condition false) [INFO] [stdout] ✔ Given the input "if false { 1 } else { 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(false)), then_branch: Block([Expr(Literal(Integer(1)))]), else_branch: Some(Block([Expr(Literal(Integer(2)))])) }' [INFO] [stdout] Scenario: If with block then-branch only (no else) [INFO] [stdout] ✔ Given the input "if true { 1 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Block([Expr(Literal(Integer(1)))]), else_branch: None }' [INFO] [stdout] Scenario: If with block then-branch only and function call (no else) [INFO] [stdout] ✔ Given the input "if false { do() }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(false)), then_branch: Block([Expr(FunctionCall(FunctionCall { name: Identifier("do"), positional_args: [], keyword_args: {} }))]), else_branch: None }' [INFO] [stdout] Scenario: If with expression branches (no blocks) [INFO] [stdout] ✔ Given the input 'if success "Ok" else ":("' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Ident("success"), then_branch: Literal(String("Ok")), else_branch: Some(Literal(String(":("))) }' [INFO] [stdout] Scenario: If with parenthesized condition [INFO] [stdout] ✔ Given the input "if (true) { 1 } else { 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Parenthesized(Literal(Boolean(true))), then_branch: Block([Expr(Literal(Integer(1)))]), else_branch: Some(Block([Expr(Literal(Integer(2)))])) }' [INFO] [stdout] Scenario: An if with else evaluates to the then-branch when the condition is true [INFO] [stdout] ✔ Given the input 'if true 1 else "one"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: An if with else evaluates to the else-branch when the condition is false [INFO] [stdout] ✔ Given the input 'if false 1 else "one"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"one"' [INFO] [stdout] Scenario Outline: typeof reports the type of the branch that ran [INFO] [stdout] ✔ Given the input 'typeof(if true 1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: typeof reports the type of the branch that ran [INFO] [stdout] ✔ Given the input 'typeof(if true 1 else "one")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: typeof reports the type of the branch that ran [INFO] [stdout] ✔ Given the input 'typeof(if false 1 else "one")' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "String" [INFO] [stdout] Scenario Outline: typeof reports the type of the branch that ran [INFO] [stdout] ✔ Given the input 'typeof(if true 1 else 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: typeof reports the type of the branch that ran [INFO] [stdout] ✔ Given the input 'typeof(if false 1 else 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: typeof reports the type of the branch that ran [INFO] [stdout] ✔ Given the input 'typeof(if false 1 else 2.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Number" [INFO] [stdout] Scenario: A branch without braces is a plain expression [INFO] [stdout] ✔ Given the input 'if true 1 else 2' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Literal(Integer(1)), else_branch: Some(Literal(Integer(2))) }' [INFO] [stdout] Scenario: Braces around a name make a block arm [INFO] [stdout] ✔ Given the input "if true { a } else { b }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Block([Expr(Ident("a"))]), else_branch: Some(Block([Expr(Ident("b"))])) }' [INFO] [stdout] Scenario: A pair of braces as an arm is an empty block [INFO] [stdout] ✔ Given the input "if true {}" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Block([]), else_branch: None }' [INFO] [stdout] Scenario: A pair of braces as the else arm is an empty block [INFO] [stdout] ✔ Given the input "if true 1 else {}" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Literal(Integer(1)), else_branch: Some(Block([])) }' [INFO] [stdout] Scenario: A map with a key as an arm is a map [INFO] [stdout] ✔ Given the input "if true { a: 1 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if true { a: 1 }" [INFO] [stdout] Scenario: Braces and a block print and parse back [INFO] [stdout] ✔ Given the input "if true { let a = 1; a } else { 0 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if true { let a = 1; a } else { 0 }" [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario: A block arm with statements on separate lines [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if true { let a = 1; a * 2 } else { 0 }" [INFO] [stdout] Scenario: A brace arm evaluates to its last statement [INFO] [stdout] ✔ Given the input "if true { let a = 1; a * 2 } else { 0 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: The else arm evaluates to its last statement [INFO] [stdout] ✔ Given the input "if false { 0 } else { let b = 3; b }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: An if without else and a false condition evaluates to None [INFO] [stdout] ✔ Given the input "if false { 1 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A name declared in the then arm is gone after the if [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: a" [INFO] [stdout] Scenario: A name declared in the else arm is gone after the if [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: b" [INFO] [stdout] Scenario: An arm hides a variable of the enclosing scope only inside the arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "[false, true]" [INFO] [stdout] Scenario: An assignment in an arm changes a variable of the enclosing scope [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: A pair of braces as an arm evaluates to None [INFO] [stdout] ✔ Given the input "if true {}" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A pair of braces as the else arm evaluates to None [INFO] [stdout] ✔ Given the input "if false 1 else {}" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: Parentheses around a pair of braces make an empty map [INFO] [stdout] ✔ Given the input "if true ({})" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "{}" [INFO] [stdout] Scenario: An empty map as an arm has the type Map [INFO] [stdout] ✔ Given the input "typeof(if true ({}))" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Map" [INFO] [stdout] Scenario: A map with a key as an arm evaluates to the map [INFO] [stdout] ✔ Given the input "if true { a: 1 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "{a: 1}" [INFO] [stdout] Feature: Const declarations [INFO] [stdout] Scenario Outline: A const declaration without a type [INFO] [stdout] ✔ Given the input "const A = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "A" without a type [INFO] [stdout] ✔ And the statement should print as "const A = 1" [INFO] [stdout] Scenario Outline: A const declaration without a type [INFO] [stdout] ✔ Given the input "const DEFAULT = :default" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "DEFAULT" without a type [INFO] [stdout] ✔ And the statement should print as "const DEFAULT = :default" [INFO] [stdout] Scenario Outline: A const declaration without a type [INFO] [stdout] ✔ Given the input "const MAX_RETRIES = 2 + 3" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "MAX_RETRIES" without a type [INFO] [stdout] ✔ And the statement should print as "const MAX_RETRIES = 2 + 3" [INFO] [stdout] Scenario Outline: A const declaration without a type [INFO] [stdout] ✔ Given the input "const limit = 10" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "limit" without a type [INFO] [stdout] ✔ And the statement should print as "const limit = 10" [INFO] [stdout] Scenario Outline: A const declaration with a type [INFO] [stdout] ✔ Given the input "const N: Number = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "N" with type "Number" [INFO] [stdout] ✔ And the statement should print as "const N: Number = 1" [INFO] [stdout] Scenario Outline: A const declaration with a type [INFO] [stdout] ✔ Given the input "const S: String | None = None" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "S" with type "String | None" [INFO] [stdout] ✔ And the statement should print as "const S: String | None = None" [INFO] [stdout] Scenario Outline: A const declaration with a type [INFO] [stdout] ✔ Given the input "const T: Type = Number" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "T" with type "Type" [INFO] [stdout] ✔ And the statement should print as "const T: Type = Number" [INFO] [stdout] Scenario Outline: Whitespace around the type is optional [INFO] [stdout] ✔ Given the input "const N:Number=1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "N" with type "Number" [INFO] [stdout] Scenario Outline: Whitespace around the type is optional [INFO] [stdout] ✔ Given the input "const N :Number = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a constant declaration of "N" with type "Number" [INFO] [stdout] Scenario Outline: Input that is not a const declaration [INFO] [stdout] ✔ Given the input "const = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: Input that is not a const declaration [INFO] [stdout] ✔ Given the input "const 1 = 2" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: Input that is not a const declaration [INFO] [stdout] ✔ Given the input "const if = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: Input that is not a const declaration [INFO] [stdout] ✔ Given the input "let const = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: Input that is not a const declaration [INFO] [stdout] ✔ Given the input "const: Integer = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: A word that starts with const is a name [INFO] [stdout] ✔ Given the input "constant = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be an assignment to "constant" [INFO] [stdout] Feature: Expanded if and elsif [INFO] [stdout] Scenario: The expanded form gives the same AST as the compact form [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Literal(Boolean(true)), then_branch: Block([Expr(Literal(Integer(1)))]), else_branch: Some(Block([Expr(Literal(Integer(2)))])) }' [INFO] [stdout] Scenario: The expanded form prints in the compact form [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if ready { let n = 2; n * 3 } else { 0 }" [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario: The expanded form without else [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if ready { 1 }" [INFO] [stdout] Scenario: A semicolon after the condition starts the expanded form [INFO] [stdout] ✔ Given the input "if x; a; else b; end" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if x { a } else { b }" [INFO] [stdout] Scenario: Statements separated by semicolons in an arm [INFO] [stdout] ✔ Given the input "if x; let y = 1; y; else 0; end" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if x { let y = 1; y } else { 0 }" [INFO] [stdout] Scenario: The first statement after else can be on the same line [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if x { a } else { b }" [INFO] [stdout] Scenario: A comment after the condition starts the expanded form [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if x { a } else { b }" [INFO] [stdout] Scenario: An arm with no statements is an empty block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if x {} else { b }" [INFO] [stdout] Scenario: An empty expanded if evaluates to None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: The expanded form evaluates to the last statement of the arm that ran [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: The expanded form evaluates the else arm when the condition is false [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "3" [INFO] [stdout] Scenario: An expanded if without else and a false condition evaluates to None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A name declared in an expanded arm is gone after end [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: a" [INFO] [stdout] Scenario: An expanded if inside an expanded if [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: An expanded if in a brace block [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"one"' [INFO] [stdout] Scenario: An expanded if in a function body [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"negative"' [INFO] [stdout] Scenario: An expanded if after a let statement [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: An expanded if needs end [INFO] [stdout] ✔ Given the input "if x; a; else b" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: An expanded if needs end [INFO] [stdout] ✔ Given the input "if x; a" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: An expanded if needs end [INFO] [stdout] ✔ Given the input "if x; a; elsif y; b" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: An expanded if needs end [INFO] [stdout] ✔ Given the input "if x; a; else b; elsif y; c; end" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: An expanded if on several lines without end is an error [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario: elsif in the compact form is a nested if in the else arm [INFO] [stdout] ✔ Given the input "if a { 1 } elsif b { 2 } else { 3 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if a { 1 } else { if b { 2 } else { 3 } }" [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario: elsif gives the same AST as the written-out form [INFO] [stdout] ✔ Given the input "if a { 1 } elsif b { 2 } else { 3 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be 'IfExpr { condition: Ident("a"), then_branch: Block([Expr(Literal(Integer(1)))]), else_branch: Some(Block([Expr(IfExpr { condition: Ident("b"), then_branch: Block([Expr(Literal(Integer(2)))]), else_branch: Some(Block([Expr(Literal(Integer(3)))])) })])) }' [INFO] [stdout] Scenario: elsif without else [INFO] [stdout] ✔ Given the input "if a { 1 } elsif b { 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if a { 1 } else { if b { 2 } }" [INFO] [stdout] Scenario: elsif with expression arms [INFO] [stdout] ✔ Given the input 'if a 1 elsif b 2 else 3' [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if a 1 else { if b 2 else 3 }" [INFO] [stdout] Scenario: Several elsif arms [INFO] [stdout] ✔ Given the input "if a { 1 } elsif b { 2 } elsif c { 3 } else { 4 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if a { 1 } else { if b { 2 } else { if c { 3 } else { 4 } } }" [INFO] [stdout] Scenario: elsif in the expanded form, closed by one end [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as 'if a { "first" } else { if b { "second" } else { "third" } }' [INFO] [stdout] ✔ And the printed output should parse back to the same expression [INFO] [stdout] Scenario: elsif in the expanded form on one line [INFO] [stdout] ✔ Given the input "if a; 1; elsif b; 2; else 3; end" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should print as "if a { 1 } else { if b { 2 } else { 3 } }" [INFO] [stdout] Scenario Outline: The first true condition runs its arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"negative"' [INFO] [stdout] Scenario Outline: The first true condition runs its arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"zero"' [INFO] [stdout] Scenario Outline: The first true condition runs its arm [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"positive"' [INFO] [stdout] Scenario Outline: elsif in the compact form [INFO] [stdout] ✔ Given the input 'if true { "a" } elsif true { "b" } else { "c" }' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"a"' [INFO] [stdout] Scenario Outline: elsif in the compact form [INFO] [stdout] ✔ Given the input 'if false { "a" } elsif true { "b" } else { "c" }' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"b"' [INFO] [stdout] Scenario Outline: elsif in the compact form [INFO] [stdout] ✔ Given the input 'if false { "a" } elsif false { "b" } else { "c" }' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"c"' [INFO] [stdout] Scenario Outline: elsif in the compact form [INFO] [stdout] ✔ Given the input 'if false { "a" } elsif false { "b" }' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'None' [INFO] [stdout] Scenario Outline: elsif in the compact form [INFO] [stdout] ✔ Given the input 'if false 1 elsif false 2 elsif true 3 else 4' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario: Later conditions are not evaluated after a true one [INFO] [stdout] ✔ Given the input "if true { 1 } elsif missing { 2 } else { 3 }" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: An elsif condition is evaluated in the enclosing scope [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"b"' [INFO] [stdout] Scenario: A name declared in an elsif arm is gone after end [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: c" [INFO] [stdout] Scenario Outline: elsif is used wrongly [INFO] [stdout] ✔ Given the input "if a { 1 } else { 2 } elsif b { 3 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: elsif is used wrongly [INFO] [stdout] ✔ Given the input "if a; 1; else 2; elsif b; 3; end" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: elsif is used wrongly [INFO] [stdout] ✔ Given the input "if a { 1 } elsif { 2 }" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: elsif is used wrongly [INFO] [stdout] ✔ Given the input "if a; 1; elsif; 2; end" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Scenario Outline: elsif is used wrongly [INFO] [stdout] ✔ Given the input "let elsif = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then parsing should fail [INFO] [stdout] Feature: Expression statements [INFO] [stdout] Scenario: Number expression as a statement [INFO] [stdout] ✔ Given the input "42" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the output should be a `Literal::Integer(42)` [INFO] [stdout] Feature: Typed let declarations [INFO] [stdout] Scenario Outline: A let binding with a type [INFO] [stdout] ✔ Given the input "let n: Number = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "n" with type "Number" [INFO] [stdout] ✔ And the statement should print as "let n: Number = 1" [INFO] [stdout] Scenario Outline: A let binding with a type [INFO] [stdout] ✔ Given the input "let s: String | None = None" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "s" with type "String | None" [INFO] [stdout] ✔ And the statement should print as "let s: String | None = None" [INFO] [stdout] Scenario Outline: A let binding with a type [INFO] [stdout] ✔ Given the input "let x: Number | String | None = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "x" with type "Number | String | None" [INFO] [stdout] ✔ And the statement should print as "let x: Number | String | None = 1" [INFO] [stdout] Scenario Outline: A let binding with a type [INFO] [stdout] ✔ Given the input "let a: Any = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "a" with type "Any" [INFO] [stdout] ✔ And the statement should print as "let a: Any = 1" [INFO] [stdout] Scenario Outline: A let binding with a type [INFO] [stdout] ✔ Given the input "let t: Type = Number" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "t" with type "Type" [INFO] [stdout] ✔ And the statement should print as "let t: Type = Number" [INFO] [stdout] Scenario Outline: A let binding with a type [INFO] [stdout] ✔ Given the input "let d: Date = today()" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "d" with type "Date" [INFO] [stdout] ✔ And the statement should print as "let d: Date = today()" [INFO] [stdout] Scenario Outline: Whitespace around the type is optional [INFO] [stdout] ✔ Given the input "let n:Number=1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "n" with type "Number" [INFO] [stdout] Scenario Outline: Whitespace around the type is optional [INFO] [stdout] ✔ Given the input "let n :Number = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "n" with type "Number" [INFO] [stdout] Scenario Outline: Whitespace around the type is optional [INFO] [stdout] ✔ Given the input "let n: Number|None = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "n" with type "Number | None" [INFO] [stdout] Scenario: Parentheses group a type [INFO] [stdout] ✔ Given the input "let x: (Number | String) | None = None" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "x" with type "(Number | String) | None" [INFO] [stdout] ✔ And the statement should print as "let x: (Number | String) | None = None" [INFO] [stdout] Scenario: A let binding without a type [INFO] [stdout] ✔ Given the input "let x = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be a declaration of "x" without a type [INFO] [stdout] ✔ And the statement should print as "let x = 1" [INFO] [stdout] Scenario: A binding without let is an assignment [INFO] [stdout] ✔ Given the input "x = 1" [INFO] [stdout] ✔ When I parse the input [INFO] [stdout] ✔ Then the statement should be an assignment to "x" [INFO] [stdout] ✔ And the statement should print as "x = 1" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "x: Number = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: Number" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: Number | = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: Number || None = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: (Number = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: fn(Any) -> Any = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Scenario Outline: A type that doesn't parse [INFO] [stdout] ✔ Given the input "let x: 1 = 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Parser Error" [INFO] [stdout] Feature: Integers [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(-7)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(+7)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(1_000)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(1.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(-0.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: A literal's type depends on whether it has a `.` [INFO] [stdout] ✔ Given the input 'typeof(42.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '42' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '42' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '-7' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-7' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '1_000' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1000' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '3.14' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.14' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '42.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '42.0' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '-0.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '0.0' [INFO] [stdout] Scenario Outline: Integers and numbers print as they're written, with `.0` on a whole number [INFO] [stdout] ✔ Given the input '2.50' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.50' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '1 + 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '1 + 2.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.0' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '1.0 + 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.0' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '1.5 + 1.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.0' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '5 - 7' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-2' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '5 - 7.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-2.0' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '2 * 3' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '6' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '2 * 1.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.0' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '2.50 * 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '5.00' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '0.1 + 0.2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '0.3' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '-(1 + 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-3' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '-(1.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-1.5' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input '+(2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input 'typeof(1 + 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input 'typeof(1 + 2.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input 'typeof(2 * 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input 'typeof(2.0 * 3)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: The type of an arithmetic result depends on its operands [INFO] [stdout] ✔ Given the input 'typeof(-(1 + 2))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '7 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '6 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '-7 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-4' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '7 / -2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-4' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '-7 / -2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '-(7 / 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-3' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '1 / 3' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '0' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '-1 / 3' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-1' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '7.0 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.5' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '7 / 2.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3.5' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '-7 / 2.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-3.5' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input '4.0 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.0' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input 'typeof(7 / 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input 'typeof(7 / 2.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: `/` on two integers floors, and otherwise gives a Number [INFO] [stdout] ✔ Given the input 'typeof(4.0 / 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '7 // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '6 // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '-7 // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-4' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '7 // -2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-4' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '-7 // -2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '-(7 // 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-3' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input 'typeof(7 // 2)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '7 // 2 * 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '6' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '1 + 7 // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '4' [INFO] [stdout] Scenario Outline: `//` floor-divides two integers [INFO] [stdout] ✔ Given the input '20 // 2 // 3' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: `//` takes only integers [INFO] [stdout] ✔ Given the input '7.5 // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: `//` takes only integers [INFO] [stdout] ✔ Given the input '7 // 2.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: `//` takes only integers [INFO] [stdout] ✔ Given the input '7.0 // 2.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: `//` takes only integers [INFO] [stdout] ✔ Given the input '1.0 // 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: `//` takes only integers [INFO] [stdout] ✔ Given the input '"7" // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: `//` takes only integers [INFO] [stdout] ✔ Given the input '7 // true' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '1 / 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '0 / 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '1.0 / 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '1 / 0.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '1.0 / 0.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '1 // 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Dividing by zero is an error [INFO] [stdout] ✔ Given the input '0 // 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Division By Zero" [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1 == 1.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1.0 == 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1 != 1.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'false' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1 == 1.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'false' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1 < 1.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '2 > 1.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1 <= 1.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1.0 >= 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '-7 < -6.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '[1, 2] == [1.0, 2]' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '[1, 2] == [1.0, 2.5]' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'false' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '{a: 1} == {a: 1.0}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '{a: [1]} == {a: [1.0]}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'true' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input 'typeof(1) == typeof(1.0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'false' [INFO] [stdout] Scenario Outline: Integers and numbers compare by value [INFO] [stdout] ✔ Given the input '1 == "1"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'false' [INFO] [stdout] Scenario Outline: Integers don't overflow [INFO] [stdout] ✔ Given the input '9223372036854775807 + 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '9223372036854775808' [INFO] [stdout] Scenario Outline: Integers don't overflow [INFO] [stdout] ✔ Given the input '-9223372036854775808 - 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '-9223372036854775809' [INFO] [stdout] Scenario Outline: Integers don't overflow [INFO] [stdout] ✔ Given the input '18446744073709551615 * 18446744073709551615' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '340282366920938463426481119284349108225' [INFO] [stdout] Scenario Outline: Integers don't overflow [INFO] [stdout] ✔ Given the input '340282366920938463426481119284349108225 / 18446744073709551615' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '18446744073709551615' [INFO] [stdout] Scenario Outline: Integers don't overflow [INFO] [stdout] ✔ Given the input '340282366920938463426481119284349108225 // 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '170141183460469231713240559642174554112' [INFO] [stdout] Scenario Outline: Integers don't overflow [INFO] [stdout] ✔ Given the input 'typeof(18446744073709551615 * 18446744073709551615)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: Numbers convert to strings as they print [INFO] [stdout] ✔ Given the input '"x" <> 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"x2"' [INFO] [stdout] Scenario Outline: Numbers convert to strings as they print [INFO] [stdout] ✔ Given the input '"x" <> 2.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"x2.0"' [INFO] [stdout] Scenario Outline: Numbers convert to strings as they print [INFO] [stdout] ✔ Given the input '"x" <> 4.0 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"x2.0"' [INFO] [stdout] Scenario Outline: Numbers convert to strings as they print [INFO] [stdout] ✔ Given the input '"x" <> 7 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"x3"' [INFO] [stdout] Scenario Outline: Numbers convert to strings as they print [INFO] [stdout] ✔ Given the input '"n = {1 + 1}"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"n = 2"' [INFO] [stdout] Scenario Outline: Numbers convert to strings as they print [INFO] [stdout] ✔ Given the input '"n = {4.0 / 2}"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"n = 2.0"' [INFO] [stdout] Scenario Outline: Other operands are an error [INFO] [stdout] ✔ Given the input '1 + true' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: Other operands are an error [INFO] [stdout] ✔ Given the input '1.0 * "2"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: Other operands are an error [INFO] [stdout] ✔ Given the input '-"1"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario Outline: Other operands are an error [INFO] [stdout] ✔ Given the input '7 / None' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Feature: Map values [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{b: 1, a: 2}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{b: 1, a: 2}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{z: 1, y: 2, x: 3}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{z: 1, y: 2, x: 3}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{"b": 1}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{b: 1}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{b: 1, "c d": 2}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{b: 1, "c d": 2}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{"_x": 1, "1x": 2}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{"_x": 1, "1x": 2}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{n: 1, m: 2, n: 3}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{n: 3, m: 2}' [INFO] [stdout] Scenario Outline: Maps print their keys as written, in insertion order [INFO] [stdout] ✔ Given the input '{b: 1, "b": 2}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{b: 2}' [INFO] [stdout] Scenario Outline: Map equality ignores order [INFO] [stdout] ✔ Given the input '{a: 1, b: 2} == {b: 2, a: 1}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: Map equality ignores order [INFO] [stdout] ✔ Given the input '{a: 1, b: 2} == {a: 1, b: 3}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Map equality ignores order [INFO] [stdout] ✔ Given the input '{a: 1} == {a: 1, b: 2}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Map equality ignores order [INFO] [stdout] ✔ Given the input '{a: 1, b: 2} != {b: 2, a: 1}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Map equality ignores order [INFO] [stdout] ✔ Given the input '{b: 1} == {"b": 1}' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: Field access reads a symbol key [INFO] [stdout] ✔ Given the input '{b: 1}.b' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: Field access reads a symbol key [INFO] [stdout] ✔ Given the input '{"b": 1}.b' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario Outline: Symbols print as they'd be written [INFO] [stdout] ✔ Given the input ':b' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be ':b' [INFO] [stdout] Scenario Outline: Symbols print as they'd be written [INFO] [stdout] ✔ Given the input ':"b"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be ':b' [INFO] [stdout] Scenario Outline: Symbols print as they'd be written [INFO] [stdout] ✔ Given the input ':"hello world"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be ':"hello world"' [INFO] [stdout] Scenario Outline: Symbols print as they'd be written [INFO] [stdout] ✔ Given the input ':"_x"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be ':"_x"' [INFO] [stdout] Feature: Native types and values [INFO] [stdout] Scenario: A native value prints as the host displays it [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026, 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2026-10-25" [INFO] [stdout] Scenario Outline: A native function reads native values [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'days_between(date(2026, 1, 1), date(2026, 10, 25))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "297" [INFO] [stdout] Scenario Outline: A native function reads native values [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'days_between(date(2026, 10, 25), date(2026, 1, 1))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "-297" [INFO] [stdout] Scenario Outline: A native function reads native values [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'days_between(date(2024, 2, 28), date(2024, 3, 1))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2" [INFO] [stdout] Scenario: Native values pass through bindings and pipes [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'let start = date(2026, 1, 1); start |> days_between(date(2026, 10, 25))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "297" [INFO] [stdout] Scenario: The type of a native value is its native type [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'typeof(date(2026, 10, 25))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Date" [INFO] [stdout] Scenario: A native type's name evaluates to that type [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'typeof(date(2026, 10, 25)) == Date' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: A native type is a type [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'typeof(Date)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario Outline: Function types can name native types [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'typeof(date)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Integer, Integer, Integer) -> Date" [INFO] [stdout] Scenario Outline: Function types can name native types [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'typeof(days_between)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "fn(Date, Date) -> Integer" [INFO] [stdout] Scenario Outline: Native values compare with the host's equality [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'let d = date(2026, 10, 25); d == d' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: Native values compare with the host's equality [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'date(2026, 10, 25) == date(2026, 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: Native values compare with the host's equality [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'date(2026, 10, 25) == date(2026, 10, 26)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Native values compare with the host's equality [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'date(2026, 10, 25) != date(2026, 10, 26)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: Native values compare with the host's equality [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'date(2026, 10, 25) == time(12, 0, 0)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Native values compare with the host's equality [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'date(2026, 10, 25) == "2026-10-25"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario: Native values can't be ordered [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026, 10, 25) < date(2026, 10, 26)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario: A native function rejects a value of the wrong type [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'days_between(1, date(2026, 10, 25))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument from of days_between expects Date, found Integer" [INFO] [stdout] Scenario: A native function rejects a value of another native type [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'days_between(time(12, 0, 0), date(2026, 10, 25))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument from of days_between expects Date, found Time" [INFO] [stdout] Scenario: flt source can't create a native value [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'Date(2026, 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Date is not a function" [INFO] [stdout] Scenario: flt source can't look inside a native value [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026, 10, 25).year' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Invalid Operand Type" [INFO] [stdout] Scenario: Concatenating a native value gives the empty string [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input '"date: " <> date(2026, 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"date: "' [INFO] [stdout] Scenario: A native type's name can't be bound [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'let Date = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Date: it's a native type" [INFO] [stdout] Scenario: A value of an unregistered native type still has its type [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'typeof(time(12, 0, 0))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Time" [INFO] [stdout] Scenario: An unregistered native type's name is unbound [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the native function "time(hh: Integer, mm: Integer, ss: Integer) -> Time" [INFO] [stdout] ✔ And the input 'Time' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: Time" [INFO] [stdout] Scenario Outline: A native function's integer arguments convert to Rust integers [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date("2026", 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument yyyy of date expects Integer, found String" [INFO] [stdout] Scenario Outline: A native function's integer arguments convert to Rust integers [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026.5, 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument yyyy of date expects Integer, found Number" [INFO] [stdout] Scenario Outline: A native function's integer arguments convert to Rust integers [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026.0, 10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Argument yyyy of date expects Integer, found Number" [INFO] [stdout] Scenario Outline: A native function's integer arguments convert to Rust integers [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026, -10, 25)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot convert -10 to u32" [INFO] [stdout] Scenario: A host error is shown unchanged [INFO] [stdout] ✔> Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔> And the native function "days_between(from: Date, to: Date) -> Integer" [INFO] [stdout] ✔ Given the input 'date(2026, 2, 30)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with exactly "2026-02-30 is not a valid date" [INFO] [stdout] Feature: None [INFO] [stdout] Scenario: None evaluates to None [INFO] [stdout] ✔ Given the input "None" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: The type of None is None [INFO] [stdout] ✔ Given the input "typeof(None)" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: The None value equals the None type [INFO] [stdout] ✔ Given the input "typeof(None) == None" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario: An if without else evaluates to the then-branch when the condition is true [INFO] [stdout] ✔ Given the input "if true 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "1" [INFO] [stdout] Scenario: An if without else evaluates to None when the condition is false [INFO] [stdout] ✔ Given the input "if false 1" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: The type of an if without else is None when the condition is false [INFO] [stdout] ✔ Given the input "typeof(if false 1)" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "None" [INFO] [stdout] Scenario: A variable bound to an if without else can be compared to None [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Feature: Typed bindings [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let n: Number = 1.5; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.5' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let s: String = "a"; s' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"a"' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let x: Number | None = None; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'None' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let x: Number | None = 1.5; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.5' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let x: (Number | String) | None = "a"; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"a"' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let a: Any = :a; a' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be ':a' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let t: Type = Number; t' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let n: None = None; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'None' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let m: Map = {a: 1}; m' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '{a: 1}' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let a: Array = [1]; a' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '[1]' [INFO] [stdout] Scenario Outline: A value of the declared type is bound [INFO] [stdout] ✔ Given the input 'let f: Any = typeof; f(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario: A declaration evaluates to the bound value [INFO] [stdout] ✔ Given the input 'let n: Number = 2.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2.5" [INFO] [stdout] Scenario Outline: A value of another type isn't bound [INFO] [stdout] ✔ Given the input 'let n: Number = "one"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects Number, found String" [INFO] [stdout] Scenario Outline: A value of another type isn't bound [INFO] [stdout] ✔ Given the input 'let s: String = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable s expects String, found Integer" [INFO] [stdout] Scenario Outline: A value of another type isn't bound [INFO] [stdout] ✔ Given the input 'let x: Number | None = "a"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable x expects Number | None, found String" [INFO] [stdout] Scenario Outline: A value of another type isn't bound [INFO] [stdout] ✔ Given the input 'let n: None = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects None, found Integer" [INFO] [stdout] Scenario Outline: A value of another type isn't bound [INFO] [stdout] ✔ Given the input 'let t: Type = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable t expects Type, found Integer" [INFO] [stdout] Scenario Outline: A value of another type isn't bound [INFO] [stdout] ✔ Given the input 'let b: Boolean = None' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable b expects Boolean, found None" [INFO] [stdout] Scenario Outline: An assignment keeps to the declared type [INFO] [stdout] ✔ Given the input 'let n: Number = 1.5; n = 2.5; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.5' [INFO] [stdout] Scenario Outline: An assignment keeps to the declared type [INFO] [stdout] ✔ Given the input 'let x: Number | None = 1; x = None; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'None' [INFO] [stdout] Scenario Outline: An assignment keeps to the declared type [INFO] [stdout] ✔ Given the input 'let a: Any = 1; a = "a"; a' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"a"' [INFO] [stdout] Scenario: An assignment of another type fails [INFO] [stdout] ✔ Given the input 'let n: Number = 1; n = "two"' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects Number, found String" [INFO] [stdout] Scenario: A let without a type declares the variable again [INFO] [stdout] ✔ Given the input 'let n: Number = 1; let n = "two"; n = :two; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be ":two" [INFO] [stdout] Scenario: A let with a type replaces the declared type [INFO] [stdout] ✔ Given the input 'let n: Number = 1; let n: String = "two"; n = "three"; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"three"' [INFO] [stdout] Scenario: A let with a new type checks later assignments against it [INFO] [stdout] ✔ Given the input 'let n: Number = 1; let n: String = "two"; n = 3' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable n expects String, found Integer" [INFO] [stdout] Scenario: Without types, a binding replaces the value and its type [INFO] [stdout] ✔ Given the input 'let x = 1; x = "a"; typeof(x)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "String" [INFO] [stdout] Scenario: Assigning to an unbound name declares it without a type [INFO] [stdout] ✔ Given the input 'x = 1; x = "a"; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '"a"' [INFO] [stdout] Scenario: typeof reports the value's type, not the declared type [INFO] [stdout] ✔ Given the input 'let x: Integer | String = 1; typeof(x)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: An unknown type name [INFO] [stdout] ✔ Given the input 'let x: Foo = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unknown type: Foo" [INFO] [stdout] Scenario Outline: An unknown type name [INFO] [stdout] ✔ Given the input 'let x: typeof = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unknown type: typeof" [INFO] [stdout] Scenario Outline: An unknown type name [INFO] [stdout] ✔ Given the input 'let x: Number | Foo = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unknown type: Foo" [INFO] [stdout] Scenario Outline: An unknown type name [INFO] [stdout] ✔ Given the input 'let T = Number; let x: T = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unknown type: T" [INFO] [stdout] Scenario: The type is checked before the value is evaluated [INFO] [stdout] ✔ Given the input 'let x: Foo = 1 / 0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unknown type: Foo" [INFO] [stdout] Scenario: The name is checked before the type [INFO] [stdout] ✔ Given the input 'let Number: Foo = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Number: it's a built-in type" [INFO] [stdout] Scenario: A native type in a declaration [INFO] [stdout] ✔ Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔ And the input 'let d: Date = date(2026, 10, 28); d' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "2026-10-28" [INFO] [stdout] Scenario: A value of another type isn't bound to a native type [INFO] [stdout] ✔ Given the native function "date(yyyy: Integer, mm: Integer, dd: Integer) -> Date" [INFO] [stdout] ✔ And the input 'let d: Date = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable d expects Date, found Integer" [INFO] [stdout] Scenario Outline: A variable declared Integer takes only integers [INFO] [stdout] ✔ Given the input 'let i: Integer = 1; i' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1' [INFO] [stdout] Scenario Outline: A variable declared Integer takes only integers [INFO] [stdout] ✔ Given the input 'let i: Integer = 7 / 2; i' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '3' [INFO] [stdout] Scenario Outline: A variable declared Integer takes only integers [INFO] [stdout] ✔ Given the input 'let i: Integer = 1; i = 2; i' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2' [INFO] [stdout] Scenario Outline: A variable declared Integer takes only integers [INFO] [stdout] ✔ Given the input 'let i: Integer | None = None; i' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'None' [INFO] [stdout] Scenario Outline: A variable declared Integer doesn't take a Number, even a whole one [INFO] [stdout] ✔ Given the input 'let i: Integer = 1.0' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable i expects Integer, found Number" [INFO] [stdout] Scenario Outline: A variable declared Integer doesn't take a Number, even a whole one [INFO] [stdout] ✔ Given the input 'let i: Integer = 4.0 / 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable i expects Integer, found Number" [INFO] [stdout] Scenario Outline: A variable declared Integer doesn't take a Number, even a whole one [INFO] [stdout] ✔ Given the input 'let i: Integer = 1; i = 2.5' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Variable i expects Integer, found Number" [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let n: Number = 1; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let n: Number = 1; typeof(n)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let n: Number = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let n: Number = 1.5; n = 2; n' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.0' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let n: Number = 1.5; n = 2' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '2.0' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let x: Number | None = 1; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1.0' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let x: Number | String = 1; typeof(x)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Number' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let x: Integer | Number = 1; typeof(x)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let x: Integer | String = 1; x' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be '1' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let a: Any = 1; typeof(a)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Scenario Outline: A variable declared Number converts an Integer [INFO] [stdout] ✔ Given the input 'let x = 1; typeof(x)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be 'Integer' [INFO] [stdout] Feature: Types as values [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Integer' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Number' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Number" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Boolean' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Boolean" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'String' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "String" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Symbol' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Symbol" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Array' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Array" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Map' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Map" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Type' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(1)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Integer" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(1.5)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Number" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(1) == Integer' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "true" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(1) == Number' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'Integer == Number' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof("a") == Number' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "false" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(Number)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(Integer)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(typeof(1))' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario Outline: Types as values [INFO] [stdout] ✔ Given the input 'typeof(Type)' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "Type" [INFO] [stdout] Scenario Outline: A built-in type name can't be bound [INFO] [stdout] ✔ Given the input 'let None = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind None: it's a built-in type" [INFO] [stdout] Scenario Outline: A built-in type name can't be bound [INFO] [stdout] ✔ Given the input 'let Number = false' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Number: it's a built-in type" [INFO] [stdout] Scenario Outline: A built-in type name can't be bound [INFO] [stdout] ✔ Given the input 'let Integer = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Integer: it's a built-in type" [INFO] [stdout] Scenario Outline: A built-in type name can't be bound [INFO] [stdout] ✔ Given the input 'Number = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Number: it's a built-in type" [INFO] [stdout] Scenario Outline: A built-in type name can't be bound [INFO] [stdout] ✔ Given the input 'let Any = 1' [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Any: it's a built-in type" [INFO] [stdout] Scenario: A refused binding stops evaluation [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Cannot bind Number: it's a built-in type" [INFO] [stdout] Scenario: Re-binding a variable changes its type [INFO] [stdout] ✔ Given the multiline input [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the result should be "String" [INFO] [stdout] Scenario Outline: A name that is neither a variable nor a built-in type is unbound [INFO] [stdout] ✔ Given the input "Foo" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: Foo" [INFO] [stdout] Scenario Outline: A name that is neither a variable nor a built-in type is unbound [INFO] [stdout] ✔ Given the input "Any" [INFO] [stdout] ✔ When I evaluate the input [INFO] [stdout] ✔ Then the evaluation should fail with "Unbound identifier: Any" [INFO] [stdout] [Summary] [INFO] [stdout] 43 features [INFO] [stdout] 999 scenarios (966 passed, 33 skipped) [INFO] [stdout] 4361 steps (4328 passed, 33 skipped) [INFO] [stderr] Running tests/repl.rs (/opt/rustwide/target/release/build/flt/118c0f0a77c08f2b/out/repl-118c0f0a77c08f2b) [INFO] [stdout] Feature: flt repl [INFO] [stdout] Scenario: evaluate a simple expression [INFO] [stderr] Doc-tests flt [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "2" [INFO] [stdout] Scenario: parse an expression without evaluating it [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "BinaryExpr" [INFO] [stdout] Scenario: unknown slash command [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "unknown command" [INFO] [stdout] Scenario: unset a bound variable [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "UnboundIdentifier" [INFO] [stdout] Scenario: unset a typed variable removes its declared type [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain '"a"' [INFO] [stdout] Scenario: unset a constant lets the name be bound again [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "2" [INFO] [stdout] ✔ And the output should not contain "rebind" [INFO] [stdout] Scenario: inspect an unbound variable [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Unbound variable" [INFO] [stdout] Scenario: inspect a bound variable [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "(variable) 1" [INFO] [stdout] Scenario: inspect a bound variable using the short alias [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "(variable) 1" [INFO] [stdout] Scenario: inspect a scalar literal [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Integer" [INFO] [stdout] Scenario: inspect a decimal literal [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Number" [INFO] [stdout] Scenario: inspect an array literal [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Array" [INFO] [stdout] Scenario: inspect a map literal [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Map" [INFO] [stdout] Scenario: quit the REPL [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should not contain "2" [INFO] [stdout] Scenario: quit the REPL using the short alias [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should not contain "2" [INFO] [stdout] Scenario: show help [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "/quit" [INFO] [stdout] Scenario: show help using the short alias [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "/quit" [INFO] [stdout] Scenario: history is disabled with FLT_NO_HISTORY [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should not contain "Loading REPL history" [INFO] [stdout] Scenario: declare and inspect a const function [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "12" [INFO] [stdout] ✔ And the output should contain "(function) const fn(Integer, Integer) -> Integer" [INFO] [stdout] Feature: flt repl warnings [INFO] [stdout] Scenario: a statement after a return [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Warning: Unreachable code in f: statements after return never run" [INFO] [stdout] Scenario: the function still works [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should contain "Warning: Unreachable code in f" [INFO] [stdout] ✔ And the output should contain "1" [INFO] [stdout] Scenario: no warning without dead code [INFO] [stdout] ✔ When the REPL is run and the user types: [INFO] [stdout] ✔ Then the command should succeed [INFO] [stdout] ✔ And the output should not contain "Warning" [INFO] [stdout] [Summary] [INFO] [stdout] 2 features [INFO] [stdout] 22 scenarios (22 passed) [INFO] [stdout] 69 steps (69 passed) [INFO] [stdout] [INFO] [stdout] running 2 tests [INFO] [stdout] test src/lib.rs - (line 28) ... ok [INFO] [stdout] test src/lib.rs - (line 117) ... ok [INFO] [stdout] [INFO] [stdout] test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s [INFO] [stdout] [INFO] running `"docker" "inspect" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] running `"docker" "rm" "-f" "2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99"` [INFO] [stdout] 2e09c1095749a5d88e93923518daad529b2abcb8b90205a202fea96e2ef51e99