mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
added test for non roc file
This commit is contained in:
parent
295e1c9d35
commit
50c8adbbbb
1 changed files with 27 additions and 0 deletions
|
@ -1199,3 +1199,30 @@ fn app_missing_package_import() {
|
|||
err
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn non_roc_file_extension() {
|
||||
let modules = vec![(
|
||||
"main.md",
|
||||
indoc!(
|
||||
r"
|
||||
# Not a roc file
|
||||
"
|
||||
),
|
||||
)];
|
||||
// ESC[36m
|
||||
|
||||
let expected = indoc!(
|
||||
r"
|
||||
── EXPECTED ROC FILE in tmp/non_roc_file_extension/main.md ─────────────────────
|
||||
|
||||
I am expecting a roc application file with either `.roc` or no
|
||||
extension. Instead I found a file with extension `.md`"
|
||||
);
|
||||
let color_start = String::from_utf8(vec![27, 91, 51, 54, 109]).unwrap();
|
||||
let color_end = String::from_utf8(vec![27, 91, 48, 109]).unwrap();
|
||||
let err = multiple_modules("non_roc_file_extension", modules).unwrap_err();
|
||||
let err = err.replace(&color_start, "");
|
||||
let err = err.replace(&color_end, "");
|
||||
assert_eq!(err, expected, "\n{}", err);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue