Skip to content

Commit

Permalink
fix(nargo): Make dependencies section optional in TOML (#2161)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated authored Aug 4, 2023
1 parent bbf7ae2 commit 099f4d4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/nargo_cli/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::{errors::ManifestError, git::clone_git_repo};
#[derive(Debug, Deserialize, Clone)]
struct PackageConfig {
package: PackageMetadata,
#[serde(default)]
dependencies: BTreeMap<String, DependencyConfig>,
}

Expand Down Expand Up @@ -260,6 +261,19 @@ fn parse_standard_toml() {
assert!(Config::try_from(src).is_ok());
}

#[test]
fn parse_package_toml_no_deps() {
let src = r#"
[package]
name = "test"
authors = ["kev", "foo"]
compiler_version = "0.1"
"#;

assert!(Config::try_from(String::from(src)).is_ok());
assert!(Config::try_from(src).is_ok());
}

#[test]
fn parse_workspace_toml() {
let src = r#"
Expand Down

0 comments on commit 099f4d4

Please sign in to comment.