nushell/crates/nu-command/tests/commands
Eric Hodel c039e4b3d0
Update description and error types for split-by (#10865)
# Description

`split-by` only works on a `Record`, the error type was updated to
match, and now uses a more-specific type. (Two type fixes for the price
of one!)

The `usage` was updated to say "record" as well

# User-Facing Changes

* Providing the wrong type to `split-by` now gives an error messages
with the correct required input type

Previously:

```
❯ ls | get name | split-by type
Error:   × unsupported input
   ╭─[entry #267:1:1]
 1 │ ls | get name | split-by type
   ·      ─┬─
   ·       ╰── requires a table with one row for splitting
   ╰────
```

With this PR:

```
❯ ls | get name | split-by type
Error: nu:🐚:type_mismatch

  × Type mismatch.
   ╭─[entry #1:1:1]
 1 │ ls | get name | split-by type
   ·      ─┬─
   ·       ╰── requires a record to split
   ╰────
```

# Tests + Formatting

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`

# After Submitting

Only generated commands need to be updated

---------

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2023-11-07 16:27:10 +01:00
..
assignment Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
conversions
date
hash_ Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
math
move_ Allow filesystem commands to access files with glob metachars in name (#10694) 2023-10-18 13:31:15 -05:00
network
path Add long options for path (#10775) 2023-10-19 22:07:01 +02:00
platform Add long options for platform and random (#10776) 2023-10-19 22:04:33 +02:00
query Feature cleanup (#7182) 2022-11-22 16:58:11 -08:00
random Add long options for platform and random (#10776) 2023-10-19 22:04:33 +02:00
skip Fix 9156 endian consistency (#9873) 2023-08-24 07:08:58 -05:00
str_
take Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
url
alias.rs split $nu variable into scope commands and simpler $nu (#9487) 2023-06-21 09:33:01 +12:00
all.rs
any.rs Removes unnecessary cwd and pipeline from various tests (#9202) 2023-05-17 18:55:26 -05:00
append.rs
break_.rs fix(nu-command/tests): further remove unnecessary pipeline() and cwd() (#8793) 2023-04-07 14:09:55 -07:00
cal.rs fix(nu-command/tests): further remove unnecessary pipeline() and cwd() (#8793) 2023-04-07 14:09:55 -07:00
cd.rs
compact.rs
config_env_default.rs
config_nu_default.rs Command: Add config env/nu --default to print defaults (#10480) 2023-09-25 08:00:59 -05:00
continue_.rs fix(nu-command/tests): further remove unnecessary pipeline() and cwd() (#8793) 2023-04-07 14:09:55 -07:00
cp.rs readd update flag to cp command (#10824) 2023-10-25 11:30:13 +02:00
debug_info.rs
def.rs Add --env and --wrapped flags to def (#10566) 2023-10-02 21:13:31 +03:00
default.rs
detect_columns.rs
do_.rs remove the $nothing variable (#10478) 2023-09-26 18:49:28 +02:00
drop.rs Input output checking (#9680) 2023-07-14 15:20:35 +12:00
each.rs REFACTOR: move the 0% commands to nu-cmd-extra (#9404) 2023-07-06 08:31:31 -07:00
echo.rs Change echo to print when not redirected (#10338) 2023-09-13 06:35:01 +12:00
empty.rs fix(nu-command/tests): further remove unnecessary pipeline() and cwd() (#8793) 2023-04-07 14:09:55 -07:00
error_make.rs Refactor error make (#10923) 2023-11-03 10:09:33 -05:00
every.rs
exec.rs Add "fall-through" signatures (#7527) 2022-12-22 00:33:26 +02:00
export_def.rs Removes unnecessary cwd and pipeline from various tests (#9202) 2023-05-17 18:55:26 -05:00
fill.rs Removes unnecessary cwd and pipeline from various tests (#9202) 2023-05-17 18:55:26 -05:00
find.rs
first.rs
flatten.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
for_.rs Change echo to print when not redirected (#10338) 2023-09-13 06:35:01 +12:00
format.rs update format signature to allow record to be passed in (#9898) 2023-08-02 10:57:58 -05:00
generate.rs
get.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
glob.rs
group_by.rs Allow empty list inputs in group-by and return empty record (#10730) 2023-10-19 12:20:52 +02:00
headers.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
help.rs Tests: clean up unnecessary use of pipeline() (#10170) 2023-08-31 23:10:29 +02:00
histogram.rs
insert.rs allow values command to support LazyRecords (#10418) 2023-09-20 12:57:29 -05:00
inspect.rs throw an error instead of a panic if no input is provided to inspect (#9259) 2023-05-22 13:54:04 -05:00
into_datetime.rs
into_filesize.rs Update internal use of decimal to float (#10333) 2023-09-13 23:53:55 +02:00
into_int.rs
join.rs Removes unnecessary cwd and pipeline from various tests (#9202) 2023-05-17 18:55:26 -05:00
last.rs remove --column from length command and remove record processing (#10091) 2023-08-23 16:03:26 -05:00
length.rs Spanned Value step 1: span all value cases (#10042) 2023-08-25 08:48:05 +12:00
let_.rs
lines.rs fix panic with lines on an error (#9967) 2023-08-09 14:12:58 +02:00
loop_.rs Change echo to print when not redirected (#10338) 2023-09-13 06:35:01 +12:00
ls.rs
match_.rs
merge.rs
mkdir.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
mod.rs Add umkdir command (#10785) 2023-10-30 07:59:48 -05:00
mut_.rs
nu_check.rs Use long options for string (#10777) 2023-10-19 22:08:09 +02:00
open.rs
par_each.rs
parse.rs Clippy in tests (#10394) 2023-09-16 21:49:10 +02:00
prepend.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
print.rs
range.rs
redirection.rs redirection: fix internal commands error with o+e> redirection (#10816) 2023-10-25 16:35:51 +02:00
reduce.rs
reject.rs
rename.rs
return_.rs
reverse.rs Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
rm.rs Deref &String arguments to &str where appropriate (#10321) 2023-09-12 14:06:56 +08:00
roll.rs
rotate.rs
run_external.rs Limit run-external --redirect-combine sh test to not(Windows) (#10905) 2023-11-07 16:35:24 +08:00
save.rs Fix wrong path expansion in save (#10046) 2023-08-18 20:45:10 +03:00
select.rs
semicolon.rs Slim down tests (#9021) 2023-04-28 13:25:44 +02:00
seq_char.rs
seq.rs
sort_by.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
sort.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
source_env.rs
split_by.rs Update description and error types for split-by (#10865) 2023-11-07 16:27:10 +01:00
split_column.rs Use long options for string (#10777) 2023-10-19 22:08:09 +02:00
split_row.rs
table.rs nu-table: Fix failing test (relied on termwidth assumptions) (#10492) 2023-09-25 18:17:42 +02:00
to_text.rs
touch.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
transpose.rs
try_.rs
ucp.rs Allow filesystem commands to access files with glob metachars in name (#10694) 2023-10-18 13:31:15 -05:00
umkdir.rs Add umkdir command (#10785) 2023-10-30 07:59:48 -05:00
unfold.rs add unfold back with a deprecation warning (#10771) 2023-10-19 19:23:06 +02:00
uniq_by.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
uniq.rs
update.rs
upsert.rs Remove dead tests depending on inc (#10179) 2023-08-31 23:11:04 +02:00
use_.rs Add --env and --wrapped flags to def (#10566) 2023-10-02 21:13:31 +03:00
where_.rs
which.rs change the output of which to be more explicit (#9646) 2023-07-20 19:10:53 -05:00
while_.rs
with_env.rs Clean up tests containing unnecessary cwd: tokens (#9692) 2023-07-17 18:43:51 +02:00
wrap.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00
zip.rs Fix: remove unnecessary r#"..."# (#8670) (#9764) 2023-07-21 17:32:37 +02:00