use super::{FaceContract, NoParts, NoPreset, PresetContract};
#[test]
fn a_faces_type_like_half_is_readable_and_tied() {
struct Card;
impl FaceContract for Card {
type Preset = NoPreset;
type Parts = NoParts;
}
fn preset_of<F: FaceContract>() -> &'static str {
core::any::type_name::<F::Preset>()
}
fn parts_of<F: FaceContract>() -> &'static str {
core::any::type_name::<F::Parts>()
}
assert!(
preset_of::<Card>().ends_with("NoPreset"),
"{}",
preset_of::<Card>()
);
assert!(
parts_of::<Card>().ends_with("NoParts"),
"{}",
parts_of::<Card>()
);
const _: () = super::assert_face_contract::<Card>();
assert_eq!(
<NoPreset as PresetContract>::REQUIRED_PARTS,
<NoPreset as PresetContract>::REQUIRED_PARTS,
"and the preset's own contract is still reachable through the face"
);
}