1
0
mirror of https://github.com/nushell/nushell.git synced 2025-04-06 10:08:27 +02:00
nushell/crates/nu-command/tests/commands
Sang-Heon Jeon dc76183cd5
fix wrong casting with into filesize ()
# Description
Fix wrong casting which is related to
https://github.com/nushell/nushell/pull/12974#discussion_r1618598336

# User-Facing Changes
AS-IS (before fixing)
```
$ "-10000PiB" | into filesize
6.2 EiB                                                         <--- Wrong casted value
$ "10000PiB" | into filesize 
-6.2 EiB                                                        <--- Wrong casted value
```

TO-BE (after fixing)
```
$ "-10000PiB" | into filesize
Error: nu:🐚:cant_convert

  × Can't convert to filesize.
   ╭─[entry #6:1:1]
 1 │ "-10000PiB" | into filesize
   · ─────┬─────
   ·      ╰── can't convert string to filesize
   ╰────

$ "10000PiB" | into filesize
Error: nu:🐚:cant_convert

  × Can't convert to filesize.
   ╭─[entry #7:1:1]
 1 │ "10000PiB" | into filesize
   · ─────┬────
   ·      ╰── can't convert string to filesize
   ╰────
```
2024-06-10 10:43:17 +08:00
..
assignment Match ++= capabilities with ++ () 2023-12-07 05:46:37 +08:00
bytes Add string/binary type color to ByteStream () 2024-05-20 00:35:32 +00:00
conversions add --signed flag for binary into int conversions () 2024-02-27 15:05:26 +00:00
database Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
date fix format date based on users locale () 2024-02-20 11:08:49 -06:00
debug Force timeit to not capture stdout () 2024-04-10 13:31:29 +00:00
hash_ Bump base64 to 0.22.1 () 2024-05-04 15:56:16 +03:00
math to json -r not removing whitespaces fix () 2024-03-20 22:14:31 +01:00
move_ Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
network Disable flaky network tests () 2024-02-28 16:28:33 +00:00
path Fix path type using PWD from the environment () 2024-05-26 20:23:52 +03:00
platform refactor: move du from platform to filesystem () 2024-02-15 06:55:21 +08:00
query
random remove size command in favor of str stats () 2023-11-17 06:49:19 +08:00
skip Add string/binary type color to ByteStream () 2024-05-20 00:35:32 +00:00
str_ fix range semantic in detect_columns, str substring, str index-of () 2024-05-22 20:00:58 +03:00
take Add string/binary type color to ByteStream () 2024-05-20 00:35:32 +00:00
url Allow 'url join' to print username without password () 2024-01-31 16:52:23 -06:00
alias.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
all.rs Rewrite run_external.rs () 2024-05-23 02:05:27 +00:00
any.rs Rewrite run_external.rs () 2024-05-23 02:05:27 +00:00
append.rs
break_.rs
cal.rs to json -r not removing whitespaces fix () 2024-03-20 22:14:31 +01:00
cd.rs Implement PWD recovery () 2024-05-10 11:06:33 -05:00
compact.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
complete.rs Rewrite run_external.rs () 2024-05-23 02:05:27 +00:00
config_env_default.rs
config_nu_default.rs
continue_.rs
debug_info.rs
def.rs Remove --flag: bool support () 2024-01-25 14:16:49 +08:00
default.rs Refactor first and last () 2024-04-13 14:58:54 +00:00
detect_columns.rs fix range semantic in detect_columns, str substring, str index-of () 2024-05-22 20:00:58 +03:00
do_.rs allow define it as a variable inside closure () 2024-05-17 00:03:13 +00:00
drop.rs
du.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
each.rs Prevent each from swallowing errors when eval_block returns a ListStream () 2024-05-01 17:24:54 -05:00
echo.rs
empty.rs
error_make.rs
every.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
exec.rs Isolate tests from user config () 2024-04-10 06:27:46 +08:00
export_def.rs
fill.rs
filter.rs Fix return in filter closure eval () 2024-03-26 17:50:36 +01:00
find.rs to json -r not removing whitespaces fix () 2024-03-20 22:14:31 +01:00
first.rs Add string/binary type color to ByteStream () 2024-05-20 00:35:32 +00:00
flatten.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
for_.rs
format.rs Span ID Refactor (Step 2): Use SpanId of expressions in some places () 2024-06-09 12:15:53 +03:00
generate.rs
get.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
glob.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
griddle.rs make grid throw an error when not enough columns () 2024-04-26 06:33:00 -05:00
group_by.rs Make group-by return errors in closure () 2024-04-16 21:52:21 +02:00
headers.rs
help.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
histogram.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
ignore.rs Change the ignore command to use drain() instead of collecting a value () 2024-03-08 02:18:26 -05:00
insert.rs Remove lazy records () 2024-05-03 08:36:10 +08:00
inspect.rs
interleave.rs Isolate tests from user config () 2024-04-10 06:27:46 +08:00
into_datetime.rs
into_filesize.rs fix wrong casting with into filesize () 2024-06-10 10:43:17 +08:00
into_int.rs add --signed flag for binary into int conversions () 2024-02-27 15:05:26 +00:00
join.rs
last.rs Add string/binary type color to ByteStream () 2024-05-20 00:35:32 +00:00
length.rs
let_.rs add raw-string literal support () 2024-05-02 09:36:37 -04:00
lines.rs
loop_.rs
ls.rs Allow ls works inside dir with [] brackets () 2024-05-06 14:01:32 +08:00
match_.rs Allow comments in match blocks () 2024-02-08 07:22:42 +08:00
merge.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
mktemp.rs Add mktemp command () 2023-11-17 19:30:53 -06:00
mod.rs Add string/binary type color to ByteStream () 2024-05-20 00:35:32 +00:00
mut_.rs add raw-string literal support () 2024-05-02 09:36:37 -04:00
nu_check.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
open.rs Remove dataframes crate and feature () 2024-05-20 17:22:08 +00:00
par_each.rs
parse.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
prepend.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
print.rs
range.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
redirection.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
reduce.rs Improve with-env robustness () 2024-04-16 19:08:58 +08:00
reject.rs Remove list of cell path support for select and reject () 2024-02-15 07:49:48 -06:00
rename.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
return_.rs Isolate tests from user config () 2024-04-10 06:27:46 +08:00
reverse.rs
rm.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
roll.rs
rotate.rs Fix panic in rotate; Add safe record creation function () 2024-02-03 13:23:16 +02:00
run_external.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
save.rs collect: don't require a closure () 2024-05-17 18:46:03 +02:00
select.rs Add sys subcommands () 2024-05-06 23:20:27 +00:00
semicolon.rs
seq_char.rs
seq_date.rs Fix panic in seq date () 2024-02-17 10:51:20 +02:00
seq.rs
sort_by.rs to json -r not removing whitespaces fix () 2024-03-20 22:14:31 +01:00
sort.rs
source_env.rs Rewrite run_external.rs () 2024-05-23 02:05:27 +00:00
split_by.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
split_column.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
split_row.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
table.rs Try to preserve the ordering of elements in from toml () 2024-06-05 08:00:39 +08:00
tee.rs Add tee command for operating on copies of streams () 2024-02-28 17:08:31 -06:00
terminal.rs Add is-terminal to determine if stdin/out/err are a terminal () 2023-11-21 20:48:39 -06:00
to_text.rs
touch.rs Fix touch --reference using PWD from the environment () 2024-05-26 20:24:00 +03:00
transpose.rs
try_.rs Make exit code available in catch block () 2024-04-26 16:35:08 +00:00
ucp.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00
ulimit.rs FreeBSD compatibility patches () 2024-02-17 20:04:59 +01:00
umkdir.rs Fix : mkdir uses process startup directory instead of current script directory () 2024-04-04 14:23:10 +02:00
uname.rs Initial implementation for uutils uname () 2024-03-25 16:51:50 -05:00
uniq_by.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
uniq.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
update.rs Remove lazy records () 2024-05-03 08:36:10 +08:00
upsert.rs Remove lazy records () 2024-05-03 08:36:10 +08:00
use_.rs Rewrite run_external.rs () 2024-05-23 02:05:27 +00:00
where_.rs Fix ignored clippy lints () 2024-03-11 19:46:04 +01:00
which.rs
while_.rs
with_env.rs Improve with-env robustness () 2024-04-16 19:08:58 +08:00
wrap.rs Remove file I/O from tests that don't need it () 2023-11-29 23:21:34 +01:00
zip.rs Avoid taking unnecessary ownership of intermediates () 2024-05-04 00:53:15 +00:00