Skip to content

Commit

Permalink
[red-knot] test that a definition has is_defined but not is_used
Browse files Browse the repository at this point in the history
  • Loading branch information
plredmond committed Apr 29, 2024
1 parent adadc9b commit e9f72ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/red_knot/src/symbols.rs
Expand Up @@ -712,6 +712,13 @@ mod tests {
.len(),
1
);
assert!(
table.root_symbol_id_by_name("foo").is_some_and(|sid| {
let s = sid.symbol(&table);
s.is_defined() || !s.is_used()
}),
"symbols that are defined get the defined flag"
);
}

#[test]
Expand Down

0 comments on commit e9f72ef

Please sign in to comment.