mod auto_translate;
mod dalamud_link;
mod emphasis;
mod icon;
mod item;
mod map_link;
mod new_line;
mod player;
mod quest;
mod raw;
mod se_hyphen;
mod status;
mod text;
mod ui_foreground;
mod ui_glow;

macro_rules! basic_tests {
    ($prefix:ident { payload = $payload:expr; expected = $expected:expr; }) => {
        const PAYLOAD: &[u8] = $payload;
        lazy_static::lazy_static! {
            static ref EXPECTED: crate::SeString = $expected;
        }

        paste::paste! {
            #[test]
            fn [<$prefix _parse>]() {
                assert_eq!(
                    crate::SeString::parse(PAYLOAD).unwrap(),
                    *EXPECTED,
                );
            }

            #[test]
            fn [<$prefix _encode>]() {
                assert_eq!(
                    EXPECTED.encode(),
                    PAYLOAD,
                );
            }

            #[test]
            fn [<$prefix _round_trip>]() {
                assert_eq!(
                    crate::SeString::parse(PAYLOAD).unwrap().encode(),
                    PAYLOAD,
                );
            }
        }
    };
}

pub(crate) use basic_tests;
