Skip to main content

ordinal_map/ordinal/impls/
tuple.rs

1use crate as ordinal_map;
2
3ordinal_map_derive::impl_ordinal_for_tuple! {}
4
5#[cfg(test)]
6mod tests {
7    use crate::tests::util::test_ordinal;
8
9    #[test]
10    fn test_tuple_0() {
11        test_ordinal([()]);
12    }
13
14    #[test]
15    fn test_tuple_1() {
16        test_ordinal((0..=255u8).map(|i| (i,)));
17    }
18
19    #[test]
20    fn test_tuple_2() {
21        test_ordinal((0..=255u8).flat_map(|i| [false, true].map(move |b| (i, b))));
22    }
23
24    #[test]
25    fn test_tuple_3() {
26        test_ordinal((0..=255u8).flat_map(|i| {
27            [false, true]
28                .into_iter()
29                .flat_map(move |b| [None, Some(false), Some(true)].map(move |o| (i, b, o)))
30        }));
31    }
32}