mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
added test for package
This commit is contained in:
parent
e43ef067b9
commit
d2c3d346ad
1 changed files with 28 additions and 0 deletions
|
@ -1170,3 +1170,31 @@ fn module_interface_with_qualified_import() {
|
|||
err
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn app_missing_package_import() {
|
||||
let modules = vec![(
|
||||
"Main",
|
||||
indoc!(
|
||||
r#"
|
||||
app "example"
|
||||
packages { pack: "./package/main.roc" }
|
||||
imports [notpack.Mod]
|
||||
provides [] to pack
|
||||
|
||||
main = ""
|
||||
"#
|
||||
),
|
||||
)];
|
||||
|
||||
let err = multiple_modules("app_missing_package_import", modules).unwrap_err();
|
||||
assert_eq!(
|
||||
err,
|
||||
indoc!(
|
||||
r#"
|
||||
The package shorthand 'notpack' that you are importing the module 'Mod' from in 'notpack.Mod', doesn't exist in this module.
|
||||
Import it in the "packages" section of the header."#
|
||||
),
|
||||
"\n{}",
|
||||
err
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue