Skip to content

Commit

Permalink
test: Add test for invalid environment names (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hofer-Julian authored Aug 16, 2024
1 parent 3382439 commit ed95537
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions crates/pixi_manifest/src/parsed_manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ mod tests {
let examples = [
format!("{PROJECT_BOILERPLATE}\n[foobar]"),
format!("{PROJECT_BOILERPLATE}\n[target.win-64.hostdependencies]"),
format!("{PROJECT_BOILERPLATE}\n[environments.INVALID]"),
];
assert_snapshot!(examples
.into_iter()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/pixi_manifest/src/parsed_manifest.rs
assertion_line: 515
expression: "examples.into_iter().map(|example|\n ParsedManifest::from_toml_str(&example).unwrap_err().to_string()).collect::<Vec<_>>().join(\"\\n\")"
---
TOML parse error at line 8, column 2
Expand All @@ -14,3 +13,9 @@ TOML parse error at line 8, column 16
8 | [target.win-64.hostdependencies]
| ^^^^^^^^^^^^^^^^
unknown field `hostdependencies`, expected one of `dependencies`, `host-dependencies`, `build-dependencies`, `pypi-dependencies`, `activation`, `tasks`

TOML parse error at line 8, column 15
|
8 | [environments.INVALID]
| ^^^^^^^
Failed to parse environment name 'INVALID', please use only lowercase letters, numbers and dashes

0 comments on commit ed95537

Please sign in to comment.