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:
Nitin Londhe
2023-02-07 01:45:14 +05:30
committed by GitHub
parent bea7ec33c1
commit 1f01b6438f
3 changed files with 91 additions and 3 deletions

View File

@ -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"

View File

@ -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());
}
}