dead_code_tests: add more alive tests

This commit is contained in:
Astro 2021-12-07 00:52:35 +01:00
parent 7d4d52be15
commit 773345bbbe

View File

@ -52,6 +52,12 @@ fn let_in_inherit_dead() {
assert_eq!(results[0].name.as_str(), "dead");
}
#[test]
fn lambda_arg_alive() {
let results = run("alive: alive");
assert_eq!(0, results.len());
}
#[test]
fn lambda_arg_dead() {
let results = run("dead: false");
@ -60,6 +66,12 @@ fn lambda_arg_dead() {
assert_eq!(results[0].name.as_str(), "dead");
}
#[test]
fn lambda_at_alive() {
let results = run("alive@{ ... }: alive");
assert_eq!(0, results.len());
}
#[test]
fn lambda_at_dead() {
let results = run("dead@{ ... }: false");
@ -68,6 +80,12 @@ fn lambda_at_dead() {
assert_eq!(results[0].name.as_str(), "dead");
}
#[test]
fn lambda_pattern_alive() {
let results = run("{ alive, ... }: alive");
assert_eq!(0, results.len());
}
#[test]
fn lambda_pattern_dead() {
let results = run("alive@{ dead, ... }: alive");