arkhe_runtime_testkit/
arbitrary.rs1use proptest::prelude::*;
8
9use arkhe_forge_core::typecode;
10
11pub fn core_component_typecode() -> impl Strategy<Value = u32> {
13 typecode::CORE_COMPONENT.0..=typecode::CORE_COMPONENT.1
14}
15
16pub fn core_event_typecode() -> impl Strategy<Value = u32> {
18 typecode::CORE_EVENT.0..=typecode::CORE_EVENT.1
19}
20
21pub fn canonical_verb_typecode() -> impl Strategy<Value = u32> {
23 typecode::CORE_VERB_CANONICAL.0..=typecode::CORE_VERB_CANONICAL.1
24}
25
26pub fn shell_scoped_typecode() -> impl Strategy<Value = u32> {
28 typecode::SHELL_SCOPED.0..=typecode::SHELL_SCOPED.1
29}
30
31pub fn tick_value() -> impl Strategy<Value = u64> {
33 0u64..=u64::MAX
34}
35
36pub fn entity_id_nz() -> impl Strategy<Value = core::num::NonZeroU64> {
38 (1u64..=u64::MAX).prop_map(|v| {
39 core::num::NonZeroU64::new(v).unwrap_or(core::num::NonZeroU64::MIN)
41 })
42}