1
Fork 0

Add some tests

This commit is contained in:
Nadrieril 2024-07-21 14:37:10 +02:00
parent bab8ede761
commit c4d6a4a7e4
3 changed files with 74 additions and 4 deletions

View file

@ -67,4 +67,24 @@ fn test_nested() {
),
&[&[], &[]],
);
let ty = Ty::Tuple(&[Ty::Bool; 3]);
assert_intersects(
pats!(ty;
(true, true, _),
(true, _, true),
(false, _, _),
),
&[&[], &[], &[]],
);
let ty = Ty::Tuple(&[Ty::Bool, Ty::Bool, Ty::U8]);
assert_intersects(
pats!(ty;
(true, _, _),
(_, true, 0..10),
(_, true, 10..),
(_, true, 3),
_,
),
&[&[], &[], &[], &[1], &[0, 1, 2, 3]],
);
}