nushell/crates/nu-test-support/src
Leon 5b616770df
Make config.filesize_format/config.filesize_metric conflict resolution consistent (#7410)
# Description

Currently, `filesize_format`/`filesize_metric` conflicts are resolved as
follows: if the `filesize_format` ends in "ib", then that overrides
`filesize_metric`, otherwise, `filesize_metric` overrides
`filesize_format`. This removes this difficult-to-predict asymmetric
behaviour, and makes it so that `filesize_metric` always overrides
`filesize_format`.

This also adds tests for `$env.config.filesize.format` and
`$env.config.filesize.metric` values.

REMINDER: `filesize_metric` means "increments of 1000", and refers to
KB-MB-GB-TB etc.

# User-Facing Changes

See above.

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass

# 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: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-12-22 08:46:55 -06:00
..
playground Run a round of clippy --fix to fix a ton of lints (#7006) 2022-11-04 15:11:17 -05:00
commands.rs Restore nu_with_plugins test macro (#6065) 2022-07-22 00:14:37 -04:00
fs.rs Add decimals to int when using into string --decimals (#6085) 2022-08-12 21:13:50 -05:00
lib.rs Use nu-path correctly in nu! test macro to make dev-dependency transitive (#7488) 2022-12-15 18:53:26 +01:00
locale_override.rs replace lazy_static with once_cell (#7502) 2022-12-17 10:30:04 -08:00
macros.rs Make config.filesize_format/config.filesize_metric conflict resolution consistent (#7410) 2022-12-22 08:46:55 -06:00
playground.rs Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00