Skip to content

Commit

Permalink
Add double-negation test
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Nov 9, 2024
1 parent 7efc024 commit 87c67df
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/red_knot_python_semantic/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3582,4 +3582,13 @@ mod property_tests {

!t.is_singleton(&db) || t.is_single_valued(&db)
}

#[quickcheck]
#[ignore]
fn double_negation_is_identity(t: Ty) -> bool {
let db = setup_db();
let t = t.into_type(&db);

t.negate(&db).negate(&db).is_equivalent_to(&db, t)
}
}

0 comments on commit 87c67df

Please sign in to comment.