Skip to content

Commit

Permalink
Add test for unexpected type in assign
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGCalderon committed May 8, 2024
1 parent 86decc9 commit da05e4e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/concrete_driver/tests/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ fn module_not_found() {
);
}

#[test]
fn assign_unexpected_type() {
let (source, name) = (
include_str!("invalid_programs/assign_unexpected_type.con"),
"assign_unexpected_type",
);
let error = check_invalid_program(source, name);

assert!(
matches!(&error, LoweringError::UnexpectedType { .. }),
"{:#?}",
error
);
}

#[test]
fn import_not_found() {
let (source, name) = (include_str!("invalid_programs/import2.con"), "import2");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mod Simple {
fn main() -> i32 {
let var: i32 = 5;
var = foo();
}

fn foo() {}
}

0 comments on commit da05e4e

Please sign in to comment.