Skip to content

Commit d0ec7e2

Browse files
committed
Add unit test
1 parent 8a726d2 commit d0ec7e2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

crates/compiler/load_internal/tests/test_load.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2131,3 +2131,51 @@ fn roc_file_no_extension() {
21312131

21322132
assert_eq!(err, expected, "\n{}", err);
21332133
}
2134+
2135+
#[test]
2136+
fn roc_package_depends_on_other_package() {
2137+
let modules = vec![
2138+
(
2139+
"main",
2140+
indoc!(
2141+
r#"
2142+
package [Module] { other: "other/main.roc" }
2143+
"#
2144+
),
2145+
),
2146+
(
2147+
"Module.roc",
2148+
indoc!(
2149+
r#"
2150+
module [foo]
2151+
2152+
import other.OtherMod
2153+
2154+
foo = OtherMod.say "hello"
2155+
"#
2156+
),
2157+
),
2158+
(
2159+
"other/main.roc",
2160+
indoc!(
2161+
r#"
2162+
package [OtherMod] {}
2163+
"#
2164+
),
2165+
),
2166+
(
2167+
"other/OtherMod.roc",
2168+
indoc!(
2169+
r#"
2170+
module [say]
2171+
2172+
say = \msg -> "$(msg), world!"
2173+
"#
2174+
),
2175+
),
2176+
];
2177+
2178+
let result = multiple_modules("roc_package_depends_on_other_package", modules);
2179+
2180+
assert!(result.is_ok());
2181+
}

0 commit comments

Comments
 (0)