mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Test Package-Config parse error in test_load
This commit is contained in:
parent
589140983b
commit
2c0948f69b
1 changed files with 43 additions and 0 deletions
|
@ -605,4 +605,47 @@ mod test_load {
|
|||
Ok(_) => unreachable!("we expect failure here"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn platform_parse_error() {
|
||||
let modules = vec![
|
||||
(
|
||||
"platform/Package-Config.roc",
|
||||
indoc!(
|
||||
r#"
|
||||
platform "examples/hello-world"
|
||||
requires {} { main : Str }
|
||||
exposes []
|
||||
packages {}
|
||||
imports []
|
||||
provides [ mainForHost ]
|
||||
blah 1 2 3 # causing a parse error on purpose
|
||||
|
||||
mainForHost : Str
|
||||
"#
|
||||
),
|
||||
),
|
||||
(
|
||||
"Main",
|
||||
indoc!(
|
||||
r#"
|
||||
app "hello-world"
|
||||
packages { pf: "platform" }
|
||||
imports []
|
||||
provides [ main ] to pf
|
||||
|
||||
main = "Hello, World!\n"
|
||||
"#
|
||||
),
|
||||
),
|
||||
];
|
||||
|
||||
match multiple_modules(modules) {
|
||||
Err(report) => {
|
||||
assert!(report.contains("NOT END OF FILE"));
|
||||
assert!(report.contains("blah 1 2 3 # causing a parse error on purpose"));
|
||||
}
|
||||
Ok(_) => unreachable!("we expect failure here"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue