mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 04:45:04 +02:00
Added fix for #7970 - Upgraded toml crate version from version from 0.5.8 to 0.7.1 for package nu-command (#7990)
# Description Added fix for #7970 - Upgraded toml crate version from version from 0.5.8 to 0.7.1 for package nu-command # Tests + Formatting Added two tests to support the toml upgrade. - `cargo test --package nu-command --lib -- formats::from::toml::tests --nocapture` Executed all tests. - `cargo test --workspace` --------- Co-authored-by: Nitin Londhe <nitin.londhe@genmills.com>
This commit is contained in:
@ -86,7 +86,7 @@ sysinfo = "0.27.7"
|
||||
terminal_size = "0.2.1"
|
||||
thiserror = "1.0.31"
|
||||
titlecase = "2.0.0"
|
||||
toml = "0.5.8"
|
||||
toml = "0.7.1"
|
||||
unicode-segmentation = "1.8.0"
|
||||
url = "2.2.1"
|
||||
percent-encoding = "2.2.0"
|
||||
|
@ -125,4 +125,40 @@ mod tests {
|
||||
|
||||
test_examples(FromToml {})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn string_to_toml_value_passes() {
|
||||
let input_string = String::from(
|
||||
r#"
|
||||
command.build = "go build"
|
||||
|
||||
[command.deploy]
|
||||
script = "./deploy.sh"
|
||||
"#,
|
||||
);
|
||||
|
||||
let span = Span::test_data();
|
||||
|
||||
let result = convert_string_to_value(input_string, span);
|
||||
|
||||
assert!(result.is_ok());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn string_to_toml_value_fails() {
|
||||
let input_string = String::from(
|
||||
r#"
|
||||
command.build =
|
||||
|
||||
[command.deploy]
|
||||
script = "./deploy.sh"
|
||||
"#,
|
||||
);
|
||||
|
||||
let span = Span::test_data();
|
||||
|
||||
let result = convert_string_to_value(input_string, span);
|
||||
|
||||
assert!(result.is_err());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user