nushell/crates/nu-command/tests/commands
anomius ea6493c041
Seq char update will work on all char (#14261)
# Description - fixes #14174

This PR addresses a bug in the `seq char` command where the command's
behavior did not align with its help description, which stated that it
prints a sequence of ASCII characters. The initial implementation only
allowed alphabetic characters, leading to user confusion when
non-alphabetic characters (e.g., digits, punctuation) were rejected or
when unexpected behavior occurred for certain input ranges.

### Changes Made:
- **Updated the input validation**: Modified the `is_single_character`
function to accept any ASCII character instead of restricting to
alphabetic characters.
- **Enhanced error messages**: Clarified error messages to specify that
any single ASCII character is acceptable.
- **Expanded functionality**: Ensured that the command can now generate
sequences that include non-alphabetic ASCII characters.
- **Updated tests**: Added tests to cover new use cases involving
non-alphabetic characters and improved validation.

### Examples After Fix:
- `seq char '0' '9'` now outputs `['0', '1', '2', '3', '4', '5', '6',
'7', '8', '9']`
- `seq char ' ' '/'` outputs a list of characters from space to `/`
- `seq char 'A' 'z'` correctly includes alphabetic and non-alphabetic
characters between `A` and `z`

# User-Facing Changes
- Users can now input any single ASCII character for the `start` and
`end` parameters of `seq char`.
- The output will accurately include all characters within the specified
ASCII range, including digits and punctuation.

# Tests + Formatting
- Added new tests to ensure the `seq char` command supports sequences
including non-alphabetic ASCII characters.
2024-11-15 21:05:29 +01:00
..
assignment
base Replace the old encode base64 and decode base64 with new-base64 commands (#14018) 2024-10-08 11:01:43 +08:00
bytes Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
conversions Change behavior of into record on lists to be more useful (#13637) 2024-08-22 11:38:43 +02:00
database Path migration part 4: various tests (#13373) 2024-08-03 10:09:13 +02:00
date
debug Force timeit to not capture stdout (#12465) 2024-04-10 13:31:29 +00:00
hash_ Replace the old encode base64 and decode base64 with new-base64 commands (#14018) 2024-10-08 11:01:43 +08:00
math Div, mod, and floor div overhaul (#14157) 2024-11-04 18:03:48 +01:00
move_ Path migration part 4: various tests (#13373) 2024-08-03 10:09:13 +02:00
network Add tests to test the --max-age arg in http commands (#14245) 2024-11-04 05:41:44 -06:00
path fix path exists on a non-directory file (#13763) 2024-09-11 12:45:39 -05:00
platform ansi name for clear-scrollback code (#14184) 2024-10-29 07:01:32 -05:00
query
random support filesize arguments in random binary/chars (#14068) 2024-10-12 14:49:05 +08:00
skip Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
str_ Improves commands that support range input (#13113) 2024-06-18 07:19:13 -05:00
take Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
url add table params support to url join and url build-query (#14239) 2024-11-06 08:09:40 -06:00
alias.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
all.rs Rewrite run_external.rs (#12921) 2024-05-23 02:05:27 +00:00
any.rs Rewrite run_external.rs (#12921) 2024-05-23 02:05:27 +00:00
append.rs
break_.rs don't allow break/continue in each and items command (#13398) 2024-07-19 00:21:02 -07:00
cal.rs Suppress column index for default cal output (#13188) 2024-06-22 07:41:29 -05:00
cd.rs Path migration part 4: various tests (#13373) 2024-08-03 10:09:13 +02:00
chunks.rs Deprecate group in favor of chunks (#13377) 2024-07-16 03:49:00 +00:00
compact.rs
complete.rs Make assignment and const consistent with let/mut (#13385) 2024-07-30 18:55:22 -05:00
config_env_default.rs
config_nu_default.rs
continue_.rs
debug_info.rs
def.rs IR: Don't generate instructions for def and export def. (#14114) 2024-11-06 21:35:00 -08:00
default.rs Remove default list-diving behaviour (#13386) 2024-07-16 03:54:24 +00:00
detect_columns.rs Improves commands that support range input (#13113) 2024-06-18 07:19:13 -05:00
do_.rs change display_error.exit_code to false (#13873) 2024-10-14 09:57:30 -05:00
drop.rs
du.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
each.rs Remove group command (#14056) 2024-10-11 06:43:12 -05:00
echo.rs
empty.rs
error_make.rs Change the error style during tests to plain (#13061) 2024-06-18 21:37:24 -07:00
every.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
exec.rs
export_def.rs
fill.rs
filter.rs
find.rs fixed issue with find not working with symbols that should be escaped (#13792) 2024-09-06 07:22:03 +08:00
first.rs Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
flatten.rs
for_.rs
format.rs Span ID Refactor (Step 2): Use SpanId of expressions in some places (#13102) 2024-06-09 12:15:53 +03:00
generate.rs generate: switch the position of <initial> and <closure>, so the closure can have default parameters (#13393) 2024-07-19 00:22:28 -07:00
get.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
glob.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
griddle.rs make grid throw an error when not enough columns (#12672) 2024-04-26 06:33:00 -05:00
group_by.rs allow group-by and split-by to work with other values (#14086) 2024-10-20 23:14:11 +02:00
headers.rs
help.rs Change the usage misnomer to "description" (#13598) 2024-08-22 12:02:08 +02:00
histogram.rs
ignore.rs
insert.rs Remove lazy records (#12682) 2024-05-03 08:36:10 +08:00
inspect.rs fix inspect and explore panics on empty records (#13893) 2024-09-25 07:48:16 -05:00
interleave.rs
into_datetime.rs
into_filesize.rs fix wrong casting with into filesize (#13110) 2024-06-10 10:43:17 +08:00
into_int.rs
join.rs support table literal syntax in join right-table argument (#14190) 2024-10-29 06:37:44 -05:00
last.rs Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
length.rs support binary input in length (#14224) 2024-11-04 03:39:24 +00:00
let_.rs fix error when exporting consts with type signatures in modules (#14118) 2024-10-22 11:54:31 +02:00
lines.rs
loop_.rs
ls.rs make ls return "Permission denied" for CWD instead of empty results (#14310) 2024-11-15 12:09:02 +08:00
match_.rs Empty rest args match should be an empty list (#14246) 2024-11-04 18:03:26 +01:00
merge.rs
mktemp.rs Path migration part 4: various tests (#13373) 2024-08-03 10:09:13 +02:00
mod.rs encode/decode for multiple alphabets (#13428) 2024-08-23 11:18:51 -05:00
mut_.rs Tests: add a test to make sure that function can't use mutable variable (#14314) 2024-11-14 10:05:33 +01:00
nu_check.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
open.rs Add metadata on open --raw with bytestreams (#14141) 2024-10-23 16:50:15 -05:00
par_each.rs
parse.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
prepend.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
print.rs Add --raw switch to print for binary data (#13597) 2024-08-12 17:29:25 +08:00
range.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
redirection.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
reduce.rs Improve with-env robustness (#12523) 2024-04-16 19:08:58 +08:00
reject.rs Improve CellPath display output (#14197) 2024-11-02 10:28:10 -05:00
rename.rs
return_.rs Fix return setting last exit code (#14120) 2024-10-18 03:05:58 +00:00
reverse.rs
rm.rs Path migration part 4: various tests (#13373) 2024-08-03 10:09:13 +02:00
roll.rs
rotate.rs
run_external.rs Switch from dirs_next 2.0 to dirs 5.0 (#13384) 2024-07-16 07:16:26 -05:00
save.rs make adding newlines with to text more consistent and opt-out-able (#14158) 2024-10-23 16:49:51 -05:00
select.rs Improve CellPath display output (#14197) 2024-11-02 10:28:10 -05:00
semicolon.rs
seq_char.rs Seq char update will work on all char (#14261) 2024-11-15 21:05:29 +01:00
seq_date.rs
seq.rs
sort_by.rs
sort.rs Rework sorting and add cell path and closure comparators to sort-by (#13154) 2024-10-09 19:18:16 -07:00
source_env.rs Path migration part 2: nu-test-support (#13329) 2024-07-12 02:43:10 +00:00
split_by.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
split_column.rs Add --number flag to split column (#13831) 2024-09-12 07:16:33 -05:00
split_row.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00
table.rs Introduce footer_inheritance option (#14070) 2024-10-23 19:45:47 +02:00
tee.rs Make tee work more nicely with non-collections (#13652) 2024-09-01 19:03:46 +02:00
terminal.rs
to_text.rs Make to text line endings consistent for list (streams) (#14166) 2024-11-05 09:33:54 +01:00
touch.rs no deref in touch (#14214) 2024-11-03 00:56:05 -04:00
transpose.rs Defensive handling of errors when transposing (#14096) 2024-10-22 11:30:48 -05:00
try_.rs add rendered and json error messages in try/catch (#14082) 2024-10-20 23:14:11 +02:00
ucp.rs Path migration part 4: various tests (#13373) 2024-08-03 10:09:13 +02:00
ulimit.rs
umkdir.rs [umkdir][tests] get umask instead of assuming it (#14046) 2024-10-11 14:13:42 +02:00
uname.rs
uniq_by.rs
uniq.rs
update.rs Remove lazy records (#12682) 2024-05-03 08:36:10 +08:00
upsert.rs Remove lazy records (#12682) 2024-05-03 08:36:10 +08:00
use_.rs fix $env.FILE_PWD and $env.CURRENT_FILE inside use (#14101) 2024-11-05 14:12:01 +08:00
where_.rs
which.rs
while_.rs
window.rs Refactor window (#13401) 2024-07-19 04:16:09 +00:00
with_env.rs Improve with-env robustness (#12523) 2024-04-16 19:08:58 +08:00
wrap.rs
zip.rs Avoid taking unnecessary ownership of intermediates (#12740) 2024-05-04 00:53:15 +00:00