nushell/src/tests
JT 5d9e2455f7
Let with pipeline (#9589)
# Description

This changes the default behaviour of `let` to be able to take a
pipeline as its initial value.

For example:

```
> let x = "hello world" | str length
```

This is a change from the existing behaviour, where the right hand side
is assumed to be an expression. Pipelines are more general, and can be
more powerful.

My google foo is failing me, but this also fixes this issue:

```
let x = foo
```

Currently, this reads `foo` as a bareword that gets converted to a
string rather than running the `foo` command. In practice, this is
really annoying and is a really hard to spot bug in a script.

# User-Facing Changes

BREAKING CHANGE BREAKING CHANGE

`let` gains the power to be assigned via a pipeline. However, this
changes the behaviour of `let x = foo` from assigning the string "foo"
to `$x` to being "run the command `foo` and give the result to `$x`"

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect -A clippy::result_large_err` to check that
you're using the standard code style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-std/tests/run.nu` to run the tests for the
standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-07-03 17:45:10 +12:00
..
test_bits.rs Re-enable test_bits (#7585) 2022-12-23 11:19:10 -08:00
test_cell_path.rs Cell paths: make optional path members short-circuit (#8554) 2023-03-23 09:54:19 +13:00
test_commandline.rs fix: fix cursor position when cursor is at the end of the commandline (#9030) 2023-04-28 07:02:45 -05:00
test_conditionals.rs Add OneOf shape to fix else (#7385) 2022-12-08 08:58:54 +13:00
test_config_path.rs Use pretty_assertions in the root crate (#8818) 2023-04-08 11:52:37 -07:00
test_config.rs Add config mutation tests (#7437) 2022-12-12 12:46:25 -06:00
test_converters.rs Fix to json escape logic (#4478) 2022-02-15 06:55:57 -05:00
test_custom_commands.rs Use pretty_assertions in the root crate (#8818) 2023-04-08 11:52:37 -07:00
test_engine.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
test_env.rs Remove the 'env' command, as we have the variable (#8185) 2023-03-01 21:20:00 +13:00
test_help.rs Parameter defaults to $nu.scope.commands (#9152) 2023-05-11 13:59:56 -05:00
test_hiding.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
test_ide.rs limit the ide-check error amount (#8875) 2023-04-13 12:53:18 -05:00
test_iteration.rs Remove deprecated --numbered flag from four commands (#7777) 2023-02-02 16:59:58 -06:00
test_known_external.rs Allow arguments for the last flag in short flag batch (#8808) 2023-04-15 10:24:51 +02:00
test_math.rs Change comparison operators to allow nulls (#8617) 2023-03-26 12:10:09 +13:00
test_modules.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
test_parser.rs Let with pipeline (#9589) 2023-07-03 17:45:10 +12:00
test_ranges.rs improve operation mismatch errors (#8800) 2023-04-08 09:32:44 +12:00
test_regex.rs improve operation mismatch errors (#8800) 2023-04-08 09:32:44 +12:00
test_signatures.rs allow records to have type annotations (#8914) 2023-04-26 08:16:55 -05:00
test_stdlib.rs split $nu variable into scope commands and simpler $nu (#9487) 2023-06-21 09:33:01 +12:00
test_strings.rs improve operation mismatch errors (#8800) 2023-04-08 09:32:44 +12:00
test_table_operations.rs Optional members in cell paths: Attempt 2 (#8379) 2023-03-15 20:50:58 -07:00
test_type_check.rs disallow blocks as first-class values (#9587) 2023-07-03 07:40:56 +12:00