nushell/crates/nu-command
dannou812 7c1eb6b0c8
move-Command Tests, Refactor, Fix (#11904)
fixes #11783 

# Description
Firstly Tests for the `move` Command have been added. Afterwards some
duplicate Code has been removed and finally an error-message has been
added for when a column is tried to be moved based on itself. This
should fix #11783 .

To reiterate, the example of the initial issue now plays out as follows:
```shell
> {a: 1} | move a --after a                             
Error: nu:🐚:incompatible_parameters

  × Incompatible parameters.
   ╭─[entry #1:1:15]
 1 │ {a: 1} | move a --after a
   ·               ┬         ┬
   ·               │         ╰── relative to itself
   ·               ╰── Column cannot be moved
   ╰────
``` 

# User-Facing Changes
The error message shown above.

# Tests + Formatting
I added some Tests for the behavior of the command. If I should add
more, please let me know but I added everything that came to mind when
thinking about the command.

---------

Co-authored-by: dannou812 <dannou281@gmail.com>
2024-02-20 07:23:46 -06:00
..
src move-Command Tests, Refactor, Fix (#11904) 2024-02-20 07:23:46 -06:00
tests Remove Record::from_raw_cols_vals_unchecked (#11810) 2024-02-18 14:20:22 +02:00
Cargo.toml Bump trash from 3.2.1 to 3.3.1 (#11894) 2024-02-19 10:21:46 +08:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00