diff --git a/crates/nu-command/src/database/values/sqlite.rs b/crates/nu-command/src/database/values/sqlite.rs index d3b9b2749e..d86deaa3e2 100644 --- a/crates/nu-command/src/database/values/sqlite.rs +++ b/crates/nu-command/src/database/values/sqlite.rs @@ -521,6 +521,27 @@ pub fn convert_sqlite_value_to_nu_value(value: ValueRef, span: Span) -> Value { } } +pub fn open_connection_in_memory_custom() -> Result { + let flags = OpenFlags::default(); + Connection::open_with_flags(MEMORY_DB, flags).map_err(|e| ShellError::GenericError { + error: "Failed to open SQLite custom connection in memory".into(), + msg: e.to_string(), + span: Some(Span::test_data()), + help: None, + inner: vec![], + }) +} + +pub fn open_connection_in_memory() -> Result { + Connection::open_in_memory().map_err(|e| ShellError::GenericError { + error: "Failed to open SQLite standard connection in memory".into(), + msg: e.to_string(), + span: Some(Span::test_data()), + help: None, + inner: vec![], + }) +} + #[cfg(test)] mod test { use super::*; @@ -598,24 +619,3 @@ mod test { assert_eq!(converted_db, expected); } } - -pub fn open_connection_in_memory_custom() -> Result { - let flags = OpenFlags::default(); - Connection::open_with_flags(MEMORY_DB, flags).map_err(|e| ShellError::GenericError { - error: "Failed to open SQLite custom connection in memory".into(), - msg: e.to_string(), - span: Some(Span::test_data()), - help: None, - inner: vec![], - }) -} - -pub fn open_connection_in_memory() -> Result { - Connection::open_in_memory().map_err(|e| ShellError::GenericError { - error: "Failed to open SQLite standard connection in memory".into(), - msg: e.to_string(), - span: Some(Span::test_data()), - help: None, - inner: vec![], - }) -} diff --git a/crates/nu-command/src/filesystem/ucp.rs b/crates/nu-command/src/filesystem/ucp.rs index 202957dbda..77734f3d07 100644 --- a/crates/nu-command/src/filesystem/ucp.rs +++ b/crates/nu-command/src/filesystem/ucp.rs @@ -173,7 +173,7 @@ impl Command for UCp { target.item.to_string(), )); let cwd = current_dir(engine_state, stack)?; - let target_path = nu_path::expand_path_with(&target_path, &cwd); + let target_path = nu_path::expand_path_with(target_path, &cwd); if target.item.as_ref().ends_with(PATH_SEPARATOR) && !target_path.is_dir() { return Err(ShellError::GenericError { error: "is not a directory".into(), diff --git a/crates/nu-command/src/filters/find.rs b/crates/nu-command/src/filters/find.rs index 7148507820..32a68c19e9 100644 --- a/crates/nu-command/src/filters/find.rs +++ b/crates/nu-command/src/filters/find.rs @@ -587,18 +587,6 @@ fn record_matches_term( }) } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_examples() { - use crate::test_examples; - - test_examples(Find) - } -} - fn split_string_if_multiline(input: PipelineData, head_span: Span) -> PipelineData { let span = input.span().unwrap_or(head_span); match input { @@ -618,3 +606,15 @@ fn split_string_if_multiline(input: PipelineData, head_span: Span) -> PipelineDa _ => input, } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_examples() { + use crate::test_examples; + + test_examples(Find) + } +} diff --git a/crates/nu-command/src/generators/seq.rs b/crates/nu-command/src/generators/seq.rs index 99c40d56b9..613c5630e1 100644 --- a/crates/nu-command/src/generators/seq.rs +++ b/crates/nu-command/src/generators/seq.rs @@ -115,18 +115,6 @@ fn seq( run_seq(rest_nums, span, contains_decimals, engine_state) } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_examples() { - use crate::test_examples; - - test_examples(Seq {}) - } -} - pub fn run_seq( free: Vec, span: Span, @@ -210,3 +198,15 @@ impl Iterator for IntSeq { ret } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_examples() { + use crate::test_examples; + + test_examples(Seq {}) + } +}