mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Report unrecognized shorthands when loading from the root module
This commit is contained in:
parent
5a1bf2b891
commit
7faff12cbf
7 changed files with 245 additions and 29 deletions
|
@ -2,6 +2,7 @@ platform "test-platform"
|
|||
requires {} { main : * }
|
||||
exposes []
|
||||
packages {}
|
||||
imports []
|
||||
provides [mainForHost]
|
||||
|
||||
mainForHost : {} -> {}
|
||||
|
|
|
@ -11670,6 +11670,54 @@ In roc, functions are always written as a lambda, like{}
|
|||
@r"
|
||||
"
|
||||
);
|
||||
test_report!(
|
||||
unknown_shorthand_no_deps,
|
||||
indoc!(
|
||||
r#"
|
||||
import foo.Foo
|
||||
|
||||
Foo.foo
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
── UNKNOWN PACKAGE in tmp/unknown_shorthand_no_deps/Test.roc ───────────────────
|
||||
|
||||
This module is trying to import from `foo`:
|
||||
|
||||
4│ import foo.Foo
|
||||
^^^^^^^
|
||||
|
||||
A lowercase name indicates a package shorthand, but no packages have
|
||||
been specified.
|
||||
"###
|
||||
);
|
||||
|
||||
test_report!(
|
||||
unknown_shorthand_in_app,
|
||||
indoc!(
|
||||
r#"
|
||||
app [main] { pf: platform "../../tests/platform.roc" }
|
||||
|
||||
import foo.Foo
|
||||
|
||||
main =
|
||||
Foo.foo
|
||||
"#
|
||||
),
|
||||
@r###"
|
||||
── UNKNOWN PACKAGE in tmp/unknown_shorthand_in_app/Test.roc ────────────────────
|
||||
|
||||
This module is trying to import from `foo`:
|
||||
|
||||
3│ import foo.Foo
|
||||
^^^^^^^
|
||||
|
||||
A lowercase name indicates a package shorthand, but I don't recognize
|
||||
this one. Did you mean one of these?
|
||||
|
||||
pf
|
||||
"###
|
||||
);
|
||||
|
||||
test_report!(
|
||||
invalid_toplevel_cycle,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue