]> git.lizzy.rs Git - enumset.git/blobdiff - enumset/tests/ops.rs
Add `no_super_impls` option to `EnumSetType` derive.
[enumset.git] / enumset / tests / ops.rs
index 72c05e0db14460745ca75c3f4c82a0c2eb43de0f..b76881e3df25b8d5f2edec352c7475f4ceeadd13 100644 (file)
@@ -15,6 +15,11 @@ pub enum Enum1 {
 pub enum SmallEnum {
     A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
 }
+#[derive(Clone, Copy, Debug, EnumSetType, Eq, PartialEq)]
+#[enumset(no_super_impls)]
+pub enum SmallEnumExplicitDerive {
+    A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
+}
 #[derive(EnumSetType, Debug)]
 pub enum LargeEnum {
     _00,  _01,  _02,  _03,  _04,  _05,  _06,  _07,
@@ -86,6 +91,9 @@ macro_rules! test_variants {
 test_variants! { SmallEnum small_enum_all_empty
     A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
 }
+test_variants! { SmallEnumExplicitDerive small_enum_explicit_derive_all_empty
+    A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z,
+}
 test_variants! { LargeEnum large_enum_all_empty
     _00,  _01,  _02,  _03,  _04,  _05,  _06,  _07,
     _10,  _11,  _12,  _13,  _14,  _15,  _16,  _17,
@@ -317,10 +325,10 @@ macro_rules! test_enum {
                     assert!(!$set.contains(&SET_TEST_E));
                 }}
             }
-            
+
             let mut hash_set = HashSet::new();
             test_set!(hash_set);
-            
+
             let mut tree_set = BTreeSet::new();
             test_set!(tree_set);
         }
@@ -353,6 +361,7 @@ macro_rules! tests {
 }
 
 tests!(small_enum, test_enum!(SmallEnum, 4));
+tests!(small_enum_explicit_derive, test_enum!(SmallEnumExplicitDerive, 4));
 tests!(large_enum, test_enum!(LargeEnum, 16));
 tests!(enum8, test_enum!(Enum8, 1));
 tests!(enum128, test_enum!(Enum128, 16));