nushell/crates/nu-command/tests/commands
WMR 4fda6d7eaa
Add regex separators for split row/list/column (#8707)
# Description

Verified on discord with maintainer

Change adds regex separators in split rows/column/list. The primary
motivating reason was to make it easier to split on separators with
unbounded whitespace without requiring a lot of trim jiggery. But,
secondary motivation is the same as the set of all motivations for
adding split regex features to most languages.

# User-Facing Changes

Adds -r option to split rows/column/list.

# Tests + Formatting

Ran tests, however tests.nu fails with unrelated errors:

```
~/src/nushell> cargo run -- crates/nu-utils/standard_library/tests.nu                                                                                                                                                          04/02/2023 02:07:25 AM
    Finished dev [unoptimized + debuginfo] target(s) in 0.24s
     Running `target/debug/nu crates/nu-utils/standard_library/tests.nu`
INF|2023-04-02T02:07:27.060|Running tests in test_asserts
INF|2023-04-02T02:07:27.141|Running tests in test_dirs
Error:
  × list is just pwd after initialization

INF|2023-04-02T02:07:27.167|Running tests in test_logger
INF|2023-04-02T02:07:27.286|Running tests in test_std
Error:
  × some tests did not pass (see complete errors above):
  │
  │       test_asserts test_assert
  │       test_asserts test_assert_equal
  │       test_asserts test_assert_error
  │       test_asserts test_assert_greater
  │       test_asserts test_assert_greater_or_equal
  │       test_asserts test_assert_length
  │       test_asserts test_assert_less
  │       test_asserts test_assert_less_or_equal
  │       test_asserts test_assert_not_equal
  │     ⨯ test_dirs test_dirs_command
  │       test_logger test_critical
  │       test_logger test_debug
  │       test_logger test_error
  │       test_logger test_info
  │       test_logger test_warning
  │       test_std test_path_add
  │
```

Upon investigating seeing this difference:

```
╭───┬─────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ 0 │ /var/folders/1f/ltbr1m8s5s1811k6n1rhpc0r0000gn/T/test_dirs_c1ed89d6-19f7-47c7-9e1f-74c39f3623b5         │
│ 1 │ /private/var/folders/1f/ltbr1m8s5s1811k6n1rhpc0r0000gn/T/test_dirs_c1ed89d6-19f7-47c7-9e1f-74c39f3623b5 │
╰───┴─────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

This seems unrelated to my changes, but can investigate further if
desired.

# 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.

Co-authored-by: Robert Waugh <robert@waugh.io>
2023-04-07 06:46:11 -05:00
..
assignment allow different types of lists to be appended (#8157) 2023-02-22 12:53:36 +00:00
bytes Restrict closure expression to be something like {|| ...} (#8290) 2023-03-17 07:36:28 -05:00
date Standardise the use of ShellError::UnsupportedInput and ShellError::TypeMismatch and add spans to every instance of the former (#7217) 2022-12-23 01:48:53 -05:00
hash_ Deprecate hash base64, extend decode and add encode commands (#5863) 2022-06-26 00:35:23 +03:00
math support multiplication operation on string and list values (#8061) 2023-02-13 16:35:53 +00:00
move_ Require that values that look like numbers parse as numberlike (#8635) 2023-03-28 19:31:38 +13:00
network Fix record-to-JSON conversion for HTTP commands (#8663) 2023-03-29 11:55:51 -07:00
path Display empty records and lists (#7925) 2023-02-22 16:18:33 +00:00
platform Validate input range of du flags (#7962) 2023-02-06 21:34:32 +01:00
query Feature cleanup (#7182) 2022-11-22 16:58:11 -08:00
random Use imported names in Command::run signatures (#7967) 2023-02-05 22:17:46 +01:00
skip Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
str_ move 'str substring' to only use ranges (#8660) 2023-03-29 20:01:42 +13:00
take Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
url Feat/7725 url join (#7823) 2023-01-22 19:49:40 +01:00
alias.rs Remove parser keywords label from commands that do not need it (#8780) 2023-04-07 01:12:21 +03:00
all.rs Fix(tests/nu-command): remove unnecessary cwd() and pipeline(), etc (#8711) 2023-04-02 08:25:05 -07:00
any.rs Fix(tests/nu-command): remove unnecessary cwd() and pipeline(), etc (#8711) 2023-04-02 08:25:05 -07:00
append.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
break_.rs New commands: break, continue, return, and loop (#7230) 2022-11-25 09:39:16 +13:00
cal.rs Require that values that look like numbers parse as numberlike (#8635) 2023-03-28 19:31:38 +13:00
cd.rs Re-enable some good tests, remove some bad tests (#7875) 2023-01-28 14:56:47 -06:00
compact.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
continue_.rs New commands: break, continue, return, and loop (#7230) 2022-11-25 09:39:16 +13:00
cp.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
def.rs allow lists to have type annotations (#8529) 2023-03-24 12:54:06 +01:00
default.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
do_.rs Bare word improvements (#8066) 2023-02-16 02:30:56 +00:00
drop.rs last, skip, drop, take until, take while, skip until, skip while, where, reverse, shuffle, append, prepend and sort-by raise error when given non-lists (#7623) 2022-12-31 13:35:12 +02:00
each.rs Remove deprecated --numbered flag from four commands (#7777) 2023-02-02 16:59:58 -06:00
echo.rs Require block params (#4505) 2022-02-17 06:40:24 -05:00
empty.rs Restrict closure expression to be something like {|| ...} (#8290) 2023-03-17 07:36:28 -05:00
enter.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
error_make.rs FIX: do not allow *start > end* in error make spans (#8570) 2023-03-23 20:31:06 +01:00
every.rs Another batch of command tests (#4496) 2022-02-16 07:38:02 -05:00
exec.rs Add "fall-through" signatures (#7527) 2022-12-22 00:33:26 +02:00
export_def.rs allow -h flags for export subcommands (#6189) 2022-08-02 10:26:16 -05:00
fill.rs string | fill counts clusters, not graphemes; and doesn't count ANSI escape codes (#8134) 2023-02-20 06:32:20 -06:00
find.rs Display empty records and lists (#7925) 2023-02-22 16:18:33 +00:00
first.rs Make stream info visible to users in describe (#7589) 2023-01-03 21:08:05 -08:00
flatten.rs str collect => str join (#6531) 2022-09-11 11:48:27 +03:00
for_.rs Loops return external stream when external command failed. (#8646) 2023-04-05 20:38:04 +03:00
format.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
g.rs Make g - switch to the last used shell (#6249) 2022-08-06 10:11:03 -05:00
get.rs Fix(tests/nu-command): remove unnecessary cwd() and pipeline(), etc (#8711) 2023-04-02 08:25:05 -07:00
glob.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
group_by.rs Restrict closure expression to be something like {|| ...} (#8290) 2023-03-17 07:36:28 -05:00
headers.rs Type validation for headers command (#6918) (#7047) 2022-11-09 16:43:24 -08:00
help.rs Aliasing math expression shows error earlier (#8779) 2023-04-07 00:40:53 +03:00
histogram.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
insert.rs Remove deprecated --numbered flag from four commands (#7777) 2023-02-02 16:59:58 -06:00
into_filesize.rs fix overflow on negative bytes (#7070) 2022-11-10 22:33:15 +01:00
into_int.rs Fix 8244 -- store timestamps with nanosecond resolution (consistently) (#8337) 2023-03-07 17:02:15 -06:00
join.rs SQL-style join command for Nushell tables (#8424) 2023-03-16 16:57:20 -07:00
last.rs Make stream info visible to users in describe (#7589) 2023-01-03 21:08:05 -08:00
length.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
let_.rs check external failed in let assignment (#8164) 2023-02-22 17:35:09 +00:00
lines.rs Replace row conditions with closures in commands (#7428) 2022-12-10 19:24:06 +02:00
loop_.rs Loops return external stream when external command failed. (#8646) 2023-04-05 20:38:04 +03:00
ls.rs Restrict closure expression to be something like {|| ...} (#8290) 2023-03-17 07:36:28 -05:00
match_.rs Add rest and ignore-rest patterns (#8681) 2023-03-31 11:08:53 +13:00
merge.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
mkdir.rs Correction bug multiple dots mkdir and touch (#8486) 2023-04-05 20:22:56 +03:00
mod.rs Add or-patterns, fix var binding scope (#8633) 2023-03-27 11:31:57 +13:00
mut_.rs Allow $env and mutable records to be mutated by = (closes #7110) (#7318) 2022-12-06 19:51:55 +02:00
n.rs Refactor shell switching related code (#6258) 2022-08-07 13:30:40 -05:00
nu_check.rs A set of fixes for stderr redirect (#7219) 2022-11-24 16:58:15 +13:00
open.rs Add rest and glob support to 'open' (#8506) 2023-03-18 08:51:39 +13:00
p.rs Refactor shell switching related code (#6258) 2022-08-07 13:30:40 -05:00
parse.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
prepend.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
print.rs add -e flag to print, to print the value to stderr (#5935) 2022-07-02 09:54:49 -05:00
range.rs Use 'table' on scripts and -c commands (#4377) 2022-02-09 05:58:54 -05:00
redirection.rs Let redirection keep exit code (#7848) 2023-01-30 16:49:31 +01:00
reduce.rs Test return in reduce closure from #7961 (#7973) 2023-02-06 11:01:08 +01:00
reject.rs prevent redefining fields in a record (#8705) 2023-04-02 06:09:33 +12:00
rename.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
return_.rs ensure that when nu evaluates files, it allows early returns (#7415) 2023-02-02 00:02:27 +01:00
reverse.rs last, skip, drop, take until, take while, skip until, skip while, where, reverse, shuffle, append, prepend and sort-by raise error when given non-lists (#7623) 2022-12-31 13:35:12 +02:00
rm.rs Revert "Hide 7925" (#8500) 2023-03-18 08:58:13 +13:00
roll.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
rotate.rs str collect => str join (#6531) 2022-09-11 11:48:27 +03:00
run_external.rs Require that values that look like numbers parse as numberlike (#8635) 2023-03-28 19:31:38 +13:00
save.rs allow Range to expand to array-like when converting to json (#8047) 2023-02-24 15:31:33 -06:00
select.rs Fix select on empty lists (#8651) 2023-03-28 12:40:29 -07:00
semicolon.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
seq_char.rs Simplify seq char (#7054) 2022-11-09 17:06:47 -08:00
seq.rs Make stream info visible to users in describe (#7589) 2023-01-03 21:08:05 -08:00
shells.rs Refactor shell listing related code (#6262) 2022-08-08 06:31:24 -05:00
sort_by.rs Support passing an empty list to sort, uniq, sort-by, and uniq-by (issue #5957) (#8669) 2023-03-29 19:55:38 -07:00
sort.rs Support passing an empty list to sort, uniq, sort-by, and uniq-by (issue #5957) (#8669) 2023-03-29 19:55:38 -07:00
source_env.rs Aliasing math expression shows error earlier (#8779) 2023-04-07 00:40:53 +03:00
split_by.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
split_column.rs Add regex separators for split row/list/column (#8707) 2023-04-07 06:46:11 -05:00
split_row.rs Add regex separators for split row/list/column (#8707) 2023-04-07 06:46:11 -05:00
table.rs table --collapse dont do truncation return message instead (#8172) 2023-02-22 18:35:45 +00:00
to_text.rs Make to text stream ListStreams (#7577) 2022-12-22 16:38:07 -08:00
touch.rs Correction bug multiple dots mkdir and touch (#8486) 2023-04-05 20:22:56 +03:00
transpose.rs Prevents duplicate fields in transpose -r (#5840) 2022-06-22 19:19:06 -05:00
try_.rs Disable pipeline echo (#8292) 2023-03-17 11:53:46 +13:00
uniq_by.rs Support passing an empty list to sort, uniq, sort-by, and uniq-by (issue #5957) (#8669) 2023-03-29 19:55:38 -07:00
uniq.rs Support passing an empty list to sort, uniq, sort-by, and uniq-by (issue #5957) (#8669) 2023-03-29 19:55:38 -07:00
update.rs Restrict closure expression to be something like {|| ...} (#8290) 2023-03-17 07:36:28 -05:00
upsert.rs Restrict closure expression to be something like {|| ...} (#8290) 2023-03-17 07:36:28 -05:00
use_.rs Switch let/let-env family to init with math expressions (#8545) 2023-03-23 09:14:10 +13:00
where_.rs Change comparison operators to allow nulls (#8617) 2023-03-26 12:10:09 +13:00
which.rs Re-implement aliases (#8123) 2023-02-27 20:44:05 +13:00
while_.rs Loops return external stream when external command failed. (#8646) 2023-04-05 20:38:04 +03:00
with_env.rs Disable pipeline echo (#8292) 2023-03-17 11:53:46 +13:00
wrap.rs Fix warnings and old names (#8457) 2023-03-15 18:54:55 +13:00
zip.rs Use variable names directly in the format strings (#7906) 2023-01-29 19:37:54 -06:00