mirror of
https://github.com/nushell/nushell.git
synced 2024-11-24 17:34:00 +01:00
fix some typos (#7773)
# Description Nothing changed, just fix some typos # 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: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
parent
26e6516626
commit
f823c7cb5d
@ -76,7 +76,7 @@ fn filesystem_switch_back_to_previous_working_directory() {
|
||||
// FIXME: jt: needs more work
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn filesytem_change_from_current_directory_using_relative_path_and_dash() {
|
||||
fn filesystem_change_from_current_directory_using_relative_path_and_dash() {
|
||||
Playground::setup("cd_test_4", |dirs, sandbox| {
|
||||
sandbox.within("odin").mkdir("-");
|
||||
|
||||
@ -292,7 +292,7 @@ fn test_change_windows_drive() {
|
||||
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn cd_permission_deined_folder() {
|
||||
fn cd_permission_denied_folder() {
|
||||
Playground::setup("cd_test_21", |dirs, sandbox| {
|
||||
sandbox.mkdir("banned");
|
||||
let actual = nu!(
|
||||
@ -312,11 +312,11 @@ fn cd_permission_deined_folder() {
|
||||
);
|
||||
});
|
||||
}
|
||||
// FIXME: cd_permission_deined_folder on windows
|
||||
// FIXME: cd_permission_denied_folder on windows
|
||||
#[ignore]
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn cd_permission_deined_folder() {
|
||||
fn cd_permission_denied_folder() {
|
||||
Playground::setup("cd_test_21", |dirs, sandbox| {
|
||||
sandbox.mkdir("banned");
|
||||
let actual = nu!(
|
||||
|
@ -41,7 +41,7 @@ fn catch_can_access_error_as_dollar_in() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn external_failed_should_be_catched() {
|
||||
fn external_failed_should_be_caught() {
|
||||
let output = nu!(
|
||||
cwd: ".",
|
||||
"try { nu --testbin fail; echo 'success' } catch { echo 'fail' }"
|
||||
|
@ -115,11 +115,11 @@ pub fn create_commands(registry: &mut CommandRegistry) {
|
||||
registry.register_command_reactive(TweakCmd::default());
|
||||
}
|
||||
|
||||
pub fn create_aliases(regestry: &mut CommandRegistry) {
|
||||
regestry.create_aliase("h", HelpCmd::NAME);
|
||||
regestry.create_aliase("e", ExpandCmd::NAME);
|
||||
regestry.create_aliase("q", QuitCmd::NAME);
|
||||
regestry.create_aliase("q!", QuitCmd::NAME);
|
||||
pub fn create_aliases(registry: &mut CommandRegistry) {
|
||||
registry.create_aliases("h", HelpCmd::NAME);
|
||||
registry.create_aliases("e", ExpandCmd::NAME);
|
||||
registry.create_aliases("q", QuitCmd::NAME);
|
||||
registry.create_aliases("q!", QuitCmd::NAME);
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
@ -46,7 +46,7 @@ impl CommandRegistry {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn create_aliase(&mut self, aliases: &str, command: &str) {
|
||||
pub fn create_aliases(&mut self, aliases: &str, command: &str) {
|
||||
self.aliases.insert(
|
||||
Cow::Owned(aliases.to_owned()),
|
||||
Cow::Owned(command.to_owned()),
|
||||
|
@ -18,7 +18,7 @@ use super::{coloredtextw::ColoredTextW, cursor::XYCursor, Layout, View, ViewConf
|
||||
// todo: Add wrap option
|
||||
#[derive(Debug)]
|
||||
pub struct Preview {
|
||||
underlaying_value: Option<Value>,
|
||||
underlying_value: Option<Value>,
|
||||
lines: Vec<String>,
|
||||
cursor: XYCursor,
|
||||
}
|
||||
@ -34,12 +34,12 @@ impl Preview {
|
||||
Self {
|
||||
lines,
|
||||
cursor,
|
||||
underlaying_value: None,
|
||||
underlying_value: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_value(&mut self, value: Value) {
|
||||
self.underlaying_value = Some(value);
|
||||
self.underlying_value = Some(value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ impl View for Preview {
|
||||
}
|
||||
|
||||
fn exit(&mut self) -> Option<Value> {
|
||||
match &self.underlaying_value {
|
||||
match &self.underlying_value {
|
||||
Some(value) => Some(value.clone()),
|
||||
None => {
|
||||
let text = self.lines.join("\n");
|
||||
|
@ -1268,7 +1268,7 @@ mod input_types {
|
||||
}
|
||||
}
|
||||
|
||||
fn add_declations(engine_state: &mut EngineState) {
|
||||
fn add_declarations(engine_state: &mut EngineState) {
|
||||
let delta = {
|
||||
let mut working_set = StateWorkingSet::new(engine_state);
|
||||
working_set.add_decl(Box::new(Let));
|
||||
@ -1293,7 +1293,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn call_types_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let input = r#"ls | to-custom | group-by name other"#;
|
||||
@ -1356,7 +1356,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn storing_variable_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let input =
|
||||
@ -1388,7 +1388,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn stored_variable_operation_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let input = r#"let a = (ls | to-custom | group-by name other); ($a + $a) | agg sum"#;
|
||||
@ -1419,7 +1419,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn multiple_stored_variable_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let input = r#"
|
||||
@ -1464,7 +1464,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn call_non_custom_types_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let input = r#"ls | group-by name"#;
|
||||
@ -1509,7 +1509,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn nested_operations_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let (block, delta) = {
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
@ -1570,7 +1570,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn call_with_list_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let input = r#"[[a b]; [1 2] [3 4]] | to-custom | with-column [ ("a" | min) ("b" | min) ] | collect"#;
|
||||
@ -1617,7 +1617,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn operations_within_blocks_test() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let inputs = vec![
|
||||
@ -1639,7 +1639,7 @@ mod input_types {
|
||||
#[test]
|
||||
fn else_errors_correctly() {
|
||||
let mut engine_state = EngineState::new();
|
||||
add_declations(&mut engine_state);
|
||||
add_declarations(&mut engine_state);
|
||||
|
||||
let mut working_set = StateWorkingSet::new(&engine_state);
|
||||
let (_, err) = parse(
|
||||
|
@ -282,7 +282,7 @@ impl PipelineData {
|
||||
}
|
||||
}
|
||||
|
||||
/// Retrieves string from pipline data.
|
||||
/// Retrieves string from pipeline data.
|
||||
///
|
||||
/// As opposed to `collect_string` this raises error rather than converting non-string values.
|
||||
/// The `span` will be used if `ListStream` is encountered since it doesn't carry a span.
|
||||
|
@ -183,7 +183,7 @@ fn truncate_with_suffix_test() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn width_controll_test_0() {
|
||||
fn width_control_test_0() {
|
||||
let data = vec![
|
||||
vec![_str("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"); 16],
|
||||
vec![_str("yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"); 16],
|
||||
|
@ -61,7 +61,7 @@ fn query_contains_modifiers(query: &str) -> bool {
|
||||
// @pretty: Make the json document more human readable.
|
||||
query.contains("@ugly") || query.contains("@pretty")
|
||||
|
||||
// Output as Tablular
|
||||
// Output as Tabular
|
||||
// Since it's output as tabular, which is our default, we can just ignore these
|
||||
// @reverse: Reverse an array or the members of an object.
|
||||
// @this: Returns the current element. It can be used to retrieve the root element.
|
||||
|
@ -305,7 +305,7 @@ fn given_a_trusted_directory_with_exit_scripts_when_entering_a_subdirectory_exit
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn given_a_hierachy_of_trusted_directories_when_entering_in_any_nested_ones_should_carry_over_variables_set_from_the_root(
|
||||
fn given_a_hierarchy_of_trusted_directories_when_entering_in_any_nested_ones_should_carry_over_variables_set_from_the_root(
|
||||
) {
|
||||
Playground::setup("autoenv_test_9", |dirs, sandbox| {
|
||||
sandbox.mkdir("nu_plugin_rb");
|
||||
@ -336,7 +336,7 @@ fn given_a_hierachy_of_trusted_directories_when_entering_in_any_nested_ones_shou
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn given_a_hierachy_of_trusted_directories_nested_ones_should_overwrite_variables_from_parent_directories(
|
||||
fn given_a_hierarchy_of_trusted_directories_nested_ones_should_overwrite_variables_from_parent_directories(
|
||||
) {
|
||||
Playground::setup("autoenv_test_10", |dirs, sandbox| {
|
||||
sandbox.mkdir("nu_plugin_rb");
|
||||
@ -401,7 +401,7 @@ fn local_config_should_not_be_added_when_running_scripts() {
|
||||
}
|
||||
#[test]
|
||||
#[serial]
|
||||
fn given_a_hierachy_of_trusted_directories_going_back_restores_overwritten_variables() {
|
||||
fn given_a_hierarchy_of_trusted_directories_going_back_restores_overwritten_variables() {
|
||||
Playground::setup("autoenv_test_11", |dirs, sandbox| {
|
||||
sandbox.mkdir("nu_plugin_rb");
|
||||
sandbox.with_files(vec![
|
||||
|
@ -413,7 +413,7 @@
|
||||
|
||||
|
||||
<!--
|
||||
Uncomment the next `WixVaraible` tag to customize the installer's
|
||||
Uncomment the next `WixVariable` tag to customize the installer's
|
||||
Graphical User Interface (GUI) and add a custom banner image across
|
||||
the top of each screen. See the WiX Toolset documentation for details
|
||||
about customization.
|
||||
|
Loading…
Reference in New Issue
Block a user