Skip to content

Commit

Permalink
fire: Add test for early return
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Oct 16, 2023
1 parent 401a5d6 commit 80a57fb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions fire/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,4 +431,23 @@ mod tests {
let result = fir!(ast).interpret();
assert_eq!(result, Some(Instance::from("foo")))
}

#[test]
fn early_return() {
let ast = ast! {
func halloween(b: bool) -> string {
if b {
return "boo"
}


"foo"
}

halloween(true)
};

let result = fir!(ast).interpret();
assert_eq!(result, Some(Instance::from("foo")))
}
}

0 comments on commit 80a57fb

Please sign in to comment.