vyre-conform 0.1.0

Conformance suite for vyre backends — proves byte-identical output to CPU reference
Documentation
use crate::verify::harnesses::mutation::*;

/// Returns a canary `AppliedMutation` that replaces every `+` with
/// `-` in the source. Used by the gate's own acceptance test — not a
/// catalog entry.
#[inline]
pub fn canary_plus_to_minus() -> impl AppliedMutation {
    struct Canary;
    impl AppliedMutation for Canary {
        fn id(&self) -> &str {
            "canary_plus_to_minus"
        }
        fn description(&self) -> &str {
            "replace every '+' with '-' in the source"
        }
        fn class(&self) -> MutationClass {
            MutationClass::ArithmeticMutations
        }
        fn apply(&self, source: &str) -> Result<String, MutationApplyError> {
            if !source.contains('+') {
                return Err(MutationApplyError::NotApplicable {
                    reason: "no '+' in source".to_string(),
                });
            }
            Ok(source.replace('+', "-"))
        }
    }
    Canary
}