use arbiter_crypto::integrity::Integrable; #[derive(arbiter_macros::Hashable, arbiter_macros::Integrable)] #[integrable(kind = "test_entity")] struct TestEntity { value: i32, } #[derive(arbiter_macros::Hashable, arbiter_macros::Integrable)] #[integrable(kind = "other_entity")] struct OtherEntity { label: String, count: u64, } #[test] fn kind_is_set_correctly() { assert_eq!(::KIND, "test_entity"); assert_eq!(::KIND, "other_entity"); } #[test] fn version_is_positive() { const { assert!(::VERSION > 0); assert!(::VERSION > 0); } } #[test] fn different_field_layouts_produce_different_versions() { assert_ne!( ::VERSION, ::VERSION, ); } #[derive(arbiter_macros::Hashable, arbiter_macros::Integrable)] #[integrable(kind = "generic_entity")] struct GenericEntity { inner: T, } #[test] fn generic_struct_derives_integrable() { assert_eq!( as Integrable>::KIND, "generic_entity" ); const { assert!( as Integrable>::VERSION > 0); } }