use serde::{Deserialize, Serialize};

#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum SteVecMode {
    Compat,
    #[default]
    Standard,
}

#[cfg(test)]
mod tests {
    use super::SteVecMode;
    use serde_json::json;

    #[test]
    fn test_default_is_standard() {
        assert_eq!(SteVecMode::default(), SteVecMode::Standard);
    }

    #[test]
    fn test_serializes_kebab_case() {
        assert_eq!(
            serde_json::to_value(SteVecMode::Compat).unwrap(),
            json!("compat")
        );
        assert_eq!(
            serde_json::to_value(SteVecMode::Standard).unwrap(),
            json!("standard")
        );
    }

    #[test]
    fn test_deserializes_kebab_case() {
        let compat: SteVecMode = serde_json::from_value(json!("compat")).unwrap();
        let standard: SteVecMode = serde_json::from_value(json!("standard")).unwrap();
        assert_eq!(compat, SteVecMode::Compat);
        assert_eq!(standard, SteVecMode::Standard);
    }
}
