1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-12-22 17:44:22 +00:00

Fix all tests

This commit is contained in:
Steffo 2022-08-03 15:41:50 +00:00 committed by GitHub
parent 5836d653a7
commit d8bead0598
10 changed files with 124 additions and 139 deletions

2
src/data/mod.rs Normal file
View file

@ -0,0 +1,2 @@
//! This module contains ways to download the latest and official data from Riot Games' [Data Dragon](https://developer.riotgames.com/docs/lor#data-dragon).

View file

@ -5,5 +5,5 @@ mod schema;
#[tokio::main]
async fn main() {
pretty_env_logger::init();
debug!("There's nothing here yet.")
log::debug!("There's nothing here yet.")
}

View file

@ -61,7 +61,7 @@ mod tests {
#[test]
fn deserialize() {
assert_eq!(
serde_json::de::from_str::<'static, CardArt>(r#"{"gameAbsolutePath": https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png, "fullAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png"}"#).unwrap(),
serde_json::de::from_str::<'static, CardArt>(r#"{"gameAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png", "fullAbsolutePath": "https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png"}"#).unwrap(),
CardArt {
card_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001.png"),
full_png: String::from("https://dd.b.pvp.net/latest/set1/en_us/img/cards/01DE001-full.png"),

View file

@ -16,7 +16,7 @@ use super::speed::SpellSpeed;
#[serde(rename_all="camelCase")]
pub struct Card {
/// Unique seven-character identifier of the card.
#[serde(rename = "card_code")]
#[serde(rename = "cardCode")]
pub code: String,
/// Localized name of the card.
@ -63,14 +63,15 @@ pub struct Card {
pub health: u64,
/// [SpellSpeed] of the card.
#[serde(rename = "spell_speed_ref")]
#[serde(rename = "spellSpeedRef")]
pub spell_speed: SpellSpeed,
/// Localized name of the [SpellSpeed] of the card.
#[deprecated = "Only for re-serialization purposes, use spell_speed instead!"]
#[serde(rename = "spellSpeed")]
pub spell_speed_localized: String,
/// List of keywords of this card.
#[serde(rename="keyword_refs")]
#[serde(rename="keywordRefs")]
pub keywords: Vec<CardKeyword>,
/// Localized names of keywords of this card.
#[deprecated = "Only for re-serialization purposes, use keywords instead!"]
@ -133,10 +134,10 @@ impl Card {
#[cfg(test)]
#[allow(deprecated)]
mod tests {
use super::Card;
use super::super::art::CardArt;
use super::super::keyword::CardKeyword;
use super::super::rarity::CardRarity;
use super::super::region::CardRegion;
use super::super::set::CardSet;
@ -146,7 +147,7 @@ mod tests {
#[test]
fn deserialize_card() {
assert_eq!(
serde_json::de::from_str(r#"
serde_json::de::from_str::<'static, Card>(r#"
{
"associatedCards": [],
"associatedCardRefs": [
@ -200,7 +201,6 @@ mod tests {
regions: vec![
CardRegion::Runeterra
],
#[allow(deprecated)]
regions_localized: vec![
String::from("Runeterra")
],
@ -214,10 +214,8 @@ mod tests {
cost: 4u64,
health: 5u64,
spell_speed: SpellSpeed::None,
#[allow(deprecated)]
spell_speed_localized: String::from(""),
keywords: vec![],
#[allow(deprecated)]
keywords_localized: vec![],
description: String::from("<link=vocab.Origin><style=Vocab>Origin</style></link>: <link=card.origin><style=AssociatedCard>Agony's Embrace</style></link>.\r\nWhen I'm summoned, summon a random Husk."),
description_raw: String::from("Origin: Agony's Embrace.\r\nWhen I'm summoned, summon a random Husk."),

View file

@ -346,74 +346,74 @@ mod tests {
}
}
test_deserialization!(deserialize_spelloverwhelm, "SpellOverwhelm", CardKeyword::SpellOverwhelm);
test_deserialization!(deserialize_burst, "Burst", CardKeyword::Burst);
test_deserialization!(deserialize_countdown, "Countdown", CardKeyword::Countdown);
test_deserialization!(deserialize_onplay, "PlaySkillMark", CardKeyword::OnPlay);
test_deserialization!(deserialize_landmark, "LandmarkVisualOnly", CardKeyword::Landmark);
test_deserialization!(deserialize_shurima, "Shurima", CardKeyword::Shurima);
test_deserialization!(deserialize_attach, "Attach", CardKeyword::Attach);
test_deserialization!(deserialize_noxus, "Noxus", CardKeyword::Noxus);
test_deserialization!(deserialize_fleeting, "Fleeting", CardKeyword::Fleeting);
test_deserialization!(deserialize_clobbernoemptyslotrequirement, "ClobberNoEmptySlotRequirement", CardKeyword::ClobberNoEmptySlotRequirement);
test_deserialization!(deserialize_nab, "Nab", CardKeyword::Nab);
test_deserialization!(deserialize_focus, "Focus", CardKeyword::Focus);
test_deserialization!(deserialize_enlightened, "Enlightened", CardKeyword::Enlightened);
test_deserialization!(deserialize_invoke, "Invoke", CardKeyword::Invoke);
test_deserialization!(deserialize_boon, "Boon", CardKeyword::Boon);
test_deserialization!(deserialize_trap, "Autoplay", CardKeyword::Trap);
test_deserialization!(deserialize_drain, "Drain", CardKeyword::Drain);
test_deserialization!(deserialize_lastbreath, "LastBreath", CardKeyword::LastBreath);
test_deserialization!(deserialize_demacia, "Demacia", CardKeyword::Demacia);
test_deserialization!(deserialize_bandlecity, "BandleCity", CardKeyword::BandleCity);
test_deserialization!(deserialize_fast, "Fast", CardKeyword::Fast);
test_deserialization!(deserialize_bilgewater, "Bilgewater", CardKeyword::Bilgewater);
test_deserialization!(deserialize_runeterra, "Runeterra", CardKeyword::Runeterra);
test_deserialization!(deserialize_recall, "Recall", CardKeyword::Recall);
test_deserialization!(deserialize_weakest, "Weakest", CardKeyword::Weakest);
test_deserialization!(deserialize_support, "Support", CardKeyword::Support);
test_deserialization!(deserialize_slow, "Slow", CardKeyword::Slow);
test_deserialization!(deserialize_obliterate, "Obliterate", CardKeyword::Obliterate);
test_deserialization!(deserialize_imbue, "Imbue", CardKeyword::Imbue);
test_deserialization!(deserialize_targon, "MtTargon", CardKeyword::Targon);
test_deserialization!(deserialize_shadowisles, "ShadowIsles", CardKeyword::ShadowIsles);
test_deserialization!(deserialize_auravisualfakekeyword, "AuraVisualFakeKeyword", CardKeyword::AuraVisualFakeKeyword);
test_deserialization!(deserialize_ionia, "Ionia", CardKeyword::Ionia);
test_deserialization!(deserialize_nightfall, "Nightfall", CardKeyword::Nightfall);
test_deserialization!(deserialize_piltoverzaun, "PiltoverZaun", CardKeyword::PiltoverZaun);
test_deserialization!(deserialize_attune, "Attune", CardKeyword::Attune);
test_deserialization!(deserialize_daybreak, "Daybreak", CardKeyword::Daybreak);
test_deserialization!(deserialize_silenceindividualkeyword, "SilenceIndividualKeyword", CardKeyword::SilenceIndividualKeyword);
test_deserialization!(deserialize_skill, "Skill", CardKeyword::Skill);
test_deserialization!(deserialize_plunder, "Plunder", CardKeyword::Plunder);
test_deserialization!(deserialize_doubleattack, "DoubleAttack", CardKeyword::DoubleAttack);
test_deserialization!(deserialize_vulnerable, "Vulnerable", CardKeyword::Vulnerable);
test_deserialization!(deserialize_elusive, "Elusive", CardKeyword::Elusive);
test_deserialization!(deserialize_stun, "Stun", CardKeyword::Stun);
test_deserialization!(deserialize_fated, "Fated", CardKeyword::Fated);
test_deserialization!(deserialize_blockelusive, "BlockElusive", CardKeyword::BlockElusive);
test_deserialization!(deserialize_fury, "Fury", CardKeyword::Fury);
test_deserialization!(deserialize_barrier, "Barrier", CardKeyword::Barrier);
test_deserialization!(deserialize_immobile, "Immobile", CardKeyword::Immobile);
test_deserialization!(deserialize_hallowed, "Hallowed", CardKeyword::Hallowed);
test_deserialization!(deserialize_evolve, "Evolve", CardKeyword::Evolve);
test_deserialization!(deserialize_frostbite, "Frostbite", CardKeyword::Frostbite);
test_deserialization!(deserialize_overwhelm, "Overwhelm", CardKeyword::Overwhelm);
test_deserialization!(deserialize_quickattack, "QuickStrike", CardKeyword::QuickAttack);
test_deserialization!(deserialize_tough, "Tough", CardKeyword::Tough);
test_deserialization!(deserialize_regeneration, "Regeneration", CardKeyword::Regeneration);
test_deserialization!(deserialize_silenced, "Silenced", CardKeyword::Silenced);
test_deserialization!(deserialize_spellshield, "SpellShield", CardKeyword::SpellShield);
test_deserialization!(deserialize_lifesteal, "Lifesteal", CardKeyword::Lifesteal);
test_deserialization!(deserialize_augment, "Augment", CardKeyword::Augment);
test_deserialization!(deserialize_impact, "Impact", CardKeyword::Impact);
test_deserialization!(deserialize_scout, "Scout", CardKeyword::Scout);
test_deserialization!(deserialize_ephemeral, Ephemeral, CardKeyword::Ephemeral);
test_deserialization!(deserialize_lurk, Lurker, CardKeyword::Lurk);
test_deserialization!(deserialize_formidable, Formidable, CardKeyword::Formidable);
test_deserialization!(deserialize_challenger, Challenger, CardKeyword::Challenger);
test_deserialization!(deserialize_fearsome, Fearsome, CardKeyword::Fearsome);
test_deserialization!(deserialize_cantblock, CantBlock, CardKeyword::CantBlock);
test_deserialization!(deserialize_deep, Deep, CardKeyword::Deep);
test_deserialization!(deserialize_unsupported, Unsupported, CardKeyword::Unsupported);
test_deserialization!(deserialize_spelloverwhelm, r#""SpellOverwhelm""#, CardKeyword::SpellOverwhelm);
test_deserialization!(deserialize_burst, r#""Burst""#, CardKeyword::Burst);
test_deserialization!(deserialize_countdown, r#""Countdown""#, CardKeyword::Countdown);
test_deserialization!(deserialize_onplay, r#""PlaySkillMark""#, CardKeyword::OnPlay);
test_deserialization!(deserialize_landmark, r#""LandmarkVisualOnly""#, CardKeyword::Landmark);
test_deserialization!(deserialize_shurima, r#""Shurima""#, CardKeyword::Shurima);
test_deserialization!(deserialize_attach, r#""Attach""#, CardKeyword::Attach);
test_deserialization!(deserialize_noxus, r#""Noxus""#, CardKeyword::Noxus);
test_deserialization!(deserialize_fleeting, r#""Fleeting""#, CardKeyword::Fleeting);
test_deserialization!(deserialize_clobbernoemptyslotrequirement, r#""ClobberNoEmptySlotRequirement""#, CardKeyword::ClobberNoEmptySlotRequirement);
test_deserialization!(deserialize_nab, r#""Nab""#, CardKeyword::Nab);
test_deserialization!(deserialize_focus, r#""Focus""#, CardKeyword::Focus);
test_deserialization!(deserialize_enlightened, r#""Enlightened""#, CardKeyword::Enlightened);
test_deserialization!(deserialize_invoke, r#""Invoke""#, CardKeyword::Invoke);
test_deserialization!(deserialize_boon, r#""Boon""#, CardKeyword::Boon);
test_deserialization!(deserialize_trap, r#""Autoplay""#, CardKeyword::Trap);
test_deserialization!(deserialize_drain, r#""Drain""#, CardKeyword::Drain);
test_deserialization!(deserialize_lastbreath, r#""LastBreath""#, CardKeyword::LastBreath);
test_deserialization!(deserialize_demacia, r#""Demacia""#, CardKeyword::Demacia);
test_deserialization!(deserialize_bandlecity, r#""BandleCity""#, CardKeyword::BandleCity);
test_deserialization!(deserialize_fast, r#""Fast""#, CardKeyword::Fast);
test_deserialization!(deserialize_bilgewater, r#""Bilgewater""#, CardKeyword::Bilgewater);
test_deserialization!(deserialize_runeterra, r#""Runeterra""#, CardKeyword::Runeterra);
test_deserialization!(deserialize_recall, r#""Recall""#, CardKeyword::Recall);
test_deserialization!(deserialize_weakest, r#""Weakest""#, CardKeyword::Weakest);
test_deserialization!(deserialize_support, r#""Support""#, CardKeyword::Support);
test_deserialization!(deserialize_slow, r#""Slow""#, CardKeyword::Slow);
test_deserialization!(deserialize_obliterate, r#""Obliterate""#, CardKeyword::Obliterate);
test_deserialization!(deserialize_imbue, r#""Imbue""#, CardKeyword::Imbue);
test_deserialization!(deserialize_targon, r#""MtTargon""#, CardKeyword::Targon);
test_deserialization!(deserialize_shadowisles, r#""ShadowIsles""#, CardKeyword::ShadowIsles);
test_deserialization!(deserialize_auravisualfakekeyword, r#""AuraVisualFakeKeyword""#, CardKeyword::AuraVisualFakeKeyword);
test_deserialization!(deserialize_ionia, r#""Ionia""#, CardKeyword::Ionia);
test_deserialization!(deserialize_nightfall, r#""Nightfall""#, CardKeyword::Nightfall);
test_deserialization!(deserialize_piltoverzaun, r#""PiltoverZaun""#, CardKeyword::PiltoverZaun);
test_deserialization!(deserialize_attune, r#""Attune""#, CardKeyword::Attune);
test_deserialization!(deserialize_daybreak, r#""Daybreak""#, CardKeyword::Daybreak);
test_deserialization!(deserialize_silenceindividualkeyword, r#""SilenceIndividualKeyword""#, CardKeyword::SilenceIndividualKeyword);
test_deserialization!(deserialize_skill, r#""Skill""#, CardKeyword::Skill);
test_deserialization!(deserialize_plunder, r#""Plunder""#, CardKeyword::Plunder);
test_deserialization!(deserialize_doubleattack, r#""DoubleAttack""#, CardKeyword::DoubleAttack);
test_deserialization!(deserialize_vulnerable, r#""Vulnerable""#, CardKeyword::Vulnerable);
test_deserialization!(deserialize_elusive, r#""Elusive""#, CardKeyword::Elusive);
test_deserialization!(deserialize_stun, r#""Stun""#, CardKeyword::Stun);
test_deserialization!(deserialize_fated, r#""Fated""#, CardKeyword::Fated);
test_deserialization!(deserialize_blockelusive, r#""BlockElusive""#, CardKeyword::BlockElusive);
test_deserialization!(deserialize_fury, r#""Fury""#, CardKeyword::Fury);
test_deserialization!(deserialize_barrier, r#""Barrier""#, CardKeyword::Barrier);
test_deserialization!(deserialize_immobile, r#""Immobile""#, CardKeyword::Immobile);
test_deserialization!(deserialize_hallowed, r#""Hallowed""#, CardKeyword::Hallowed);
test_deserialization!(deserialize_evolve, r#""Evolve""#, CardKeyword::Evolve);
test_deserialization!(deserialize_frostbite, r#""Frostbite""#, CardKeyword::Frostbite);
test_deserialization!(deserialize_overwhelm, r#""Overwhelm""#, CardKeyword::Overwhelm);
test_deserialization!(deserialize_quickattack, r#""QuickStrike""#, CardKeyword::QuickAttack);
test_deserialization!(deserialize_tough, r#""Tough""#, CardKeyword::Tough);
test_deserialization!(deserialize_regeneration, r#""Regeneration""#, CardKeyword::Regeneration);
test_deserialization!(deserialize_silenced, r#""Silenced""#, CardKeyword::Silenced);
test_deserialization!(deserialize_spellshield, r#""SpellShield""#, CardKeyword::SpellShield);
test_deserialization!(deserialize_lifesteal, r#""Lifesteal""#, CardKeyword::Lifesteal);
test_deserialization!(deserialize_augment, r#""Augment""#, CardKeyword::Augment);
test_deserialization!(deserialize_impact, r#""Impact""#, CardKeyword::Impact);
test_deserialization!(deserialize_scout, r#""Scout""#, CardKeyword::Scout);
test_deserialization!(deserialize_ephemeral, r#""Ephemeral""#, CardKeyword::Ephemeral);
test_deserialization!(deserialize_lurk, r#""Lurker""#, CardKeyword::Lurk);
test_deserialization!(deserialize_formidable, r#""Formidable""#, CardKeyword::Formidable);
test_deserialization!(deserialize_challenger, r#""Challenger""#, CardKeyword::Challenger);
test_deserialization!(deserialize_fearsome, r#""Fearsome""#, CardKeyword::Fearsome);
test_deserialization!(deserialize_cantblock, r#""CantBlock""#, CardKeyword::CantBlock);
test_deserialization!(deserialize_deep, r#""Deep""#, CardKeyword::Deep);
test_deserialization!(deserialize_unsupported, r#""Xyzzy""#, CardKeyword::Unsupported);
}

View file

@ -35,11 +35,11 @@ mod tests {
}
}
test_deserialization!(deserialize_none, "None", CardRarity::None);
test_deserialization!(deserialize_common, "COMMON", CardRarity::Common);
test_deserialization!(deserialize_rare, "RARE", CardRarity::Rare);
test_deserialization!(deserialize_epic, "EPIC", CardRarity::Epic);
test_deserialization!(deserialize_champion, "Champion", CardRarity::Champion);
test_deserialization!(deserialize_none, r#""None""#, CardRarity::None);
test_deserialization!(deserialize_common, r#""COMMON""#, CardRarity::Common);
test_deserialization!(deserialize_rare, r#""RARE""#, CardRarity::Rare);
test_deserialization!(deserialize_epic, r#""EPIC""#, CardRarity::Epic);
test_deserialization!(deserialize_champion, r#""Champion""#, CardRarity::Champion);
#[test]
fn deserialize_fallback() {

View file

@ -54,18 +54,18 @@ mod tests {
}
}
test_deserialization!(deserialize_noxus, "Noxus", CardRegion::Noxus);
test_deserialization!(deserialize_demacia, "Demacia", CardRegion::Demacia);
test_deserialization!(deserialize_freljord, "Freljord", CardRegion::Freljord);
test_deserialization!(deserialize_shadowisles, "ShadowIsles", CardRegion::ShadowIsles);
test_deserialization!(deserialize_targon, "Targon", CardRegion::Targon);
test_deserialization!(deserialize_ionia, "Ionia", CardRegion::Ionia);
test_deserialization!(deserialize_shurima, "Shurima", CardRegion::Shurima);
test_deserialization!(deserialize_piltoverzaun, "PiltoverZaun", CardRegion::PiltoverZaun);
test_deserialization!(deserialize_bandlecity, "BandleCity", CardRegion::BandleCity);
test_deserialization!(deserialize_runeterra, "Runeterra", CardRegion::Runeterra);
test_deserialization!(deserialize_jhin, "Jhin", CardRegion::Jhin);
test_deserialization!(deserialize_evelynn, "Evelynn", CardRegion::Evelynn);
test_deserialization!(deserialize_bard, "Bard", CardRegion::Bard);
test_deserialization!(deserialize_fallback, "Xyzzy", CardRegion::Unsupported);
test_deserialization!(deserialize_noxus, r#""Noxus""#, CardRegion::Noxus);
test_deserialization!(deserialize_demacia, r#""Demacia""#, CardRegion::Demacia);
test_deserialization!(deserialize_freljord, r#""Freljord""#, CardRegion::Freljord);
test_deserialization!(deserialize_shadowisles, r#""ShadowIsles""#, CardRegion::ShadowIsles);
test_deserialization!(deserialize_targon, r#""Targon""#, CardRegion::Targon);
test_deserialization!(deserialize_ionia, r#""Ionia""#, CardRegion::Ionia);
test_deserialization!(deserialize_shurima, r#""Shurima""#, CardRegion::Shurima);
test_deserialization!(deserialize_piltoverzaun, r#""PiltoverZaun""#, CardRegion::PiltoverZaun);
test_deserialization!(deserialize_bandlecity, r#""BandleCity""#, CardRegion::BandleCity);
test_deserialization!(deserialize_runeterra, r#""Runeterra""#, CardRegion::Runeterra);
test_deserialization!(deserialize_jhin, r#""Jhin""#, CardRegion::Jhin);
test_deserialization!(deserialize_evelynn, r#""Evelynn""#, CardRegion::Evelynn);
test_deserialization!(deserialize_bard, r#""Bard""#, CardRegion::Bard);
test_deserialization!(deserialize_fallback, r#""Xyzzy""#, CardRegion::Unsupported);
}

View file

@ -53,12 +53,12 @@ mod tests {
}
}
test_deserialization!(deserialize_set1, "Set1", CardSet::Foundations);
test_deserialization!(deserialize_set2, "Set2", CardSet::RisingTides);
test_deserialization!(deserialize_set3, "Set3", CardSet::CallOfTheMountain);
test_deserialization!(deserialize_set4, "Set4", CardSet::EmpiresOfTheAscended);
test_deserialization!(deserialize_set5, "Set5", CardSet::BeyondTheBandlewood);
test_deserialization!(deserialize_set6, "Set6", CardSet::Worldwalker);
test_deserialization!(deserialize_setevent, "SetEvent", CardSet::Events);
test_deserialization!(deserialize_fallback, "Xyzzy", CardSet::Unsupported);
test_deserialization!(deserialize_set1, r#""Set1""#, CardSet::Foundations);
test_deserialization!(deserialize_set2, r#""Set2""#, CardSet::RisingTides);
test_deserialization!(deserialize_set3, r#""Set3""#, CardSet::CallOfTheMountain);
test_deserialization!(deserialize_set4, r#""Set4""#, CardSet::EmpiresOfTheAscended);
test_deserialization!(deserialize_set5, r#""Set5""#, CardSet::BeyondTheBandlewood);
test_deserialization!(deserialize_set6, r#""Set6""#, CardSet::Worldwalker);
test_deserialization!(deserialize_setevent, r#""SetEvent""#, CardSet::Events);
test_deserialization!(deserialize_fallback, r#""Xyzzy""#, CardSet::Unsupported);
}

View file

@ -29,10 +29,10 @@ mod tests {
}
}
test_deserialization!(deserialize_none, "", SpellSpeed::None);
test_deserialization!(deserialize_slow, "Slow", SpellSpeed::Slow);
test_deserialization!(deserialize_fast, "Fast", SpellSpeed::Fast);
test_deserialization!(deserialize_burst, "Burst", SpellSpeed::Burst);
test_deserialization!(deserialize_none, r#""""#, SpellSpeed::None);
test_deserialization!(deserialize_slow, r#""Slow""#, SpellSpeed::Slow);
test_deserialization!(deserialize_fast, r#""Fast""#, SpellSpeed::Fast);
test_deserialization!(deserialize_burst, r#""Burst""#, SpellSpeed::Burst);
#[test]
fn deserialize_fallback() {

View file

@ -28,34 +28,19 @@ pub enum CardType {
#[cfg(test)]
mod tests {
use super::CardType;
#[test]
fn deserialize_spell() {
assert_eq!(serde_json::de::from_str::<'static, CardType>("Spell").unwrap(), CardType::Spell);
macro_rules! test_deserialization {
( $id:ident, $src:literal, $res:expr ) => {
#[test]
fn $id() {
assert_eq!(serde_json::de::from_str::<'static, CardType>($src).unwrap(), $res);
}
}
}
#[test]
fn deserialize_unit() {
assert_eq!(serde_json::de::from_str::<'static, CardType>("Unit").unwrap(), CardType::Unit);
}
#[test]
fn deserialize_ability() {
assert_eq!(serde_json::de::from_str::<'static, CardType>("Ability").unwrap(), CardType::Ability);
}
#[test]
fn deserialize_landmark() {
assert_eq!(serde_json::de::from_str::<'static, CardType>("Landmark").unwrap(), CardType::Landmark);
}
#[test]
fn deserialize_trap() {
assert_eq!(serde_json::de::from_str::<'static, CardType>("Trap").unwrap(), CardType::Trap);
}
#[test]
fn deserialize_fallback() {
assert_eq!(serde_json::de::from_str::<'static, CardType>("Xyzzy").unwrap(), CardType::Unsupported);
}
test_deserialization!(deserialize_spell, r#""Spell""#, CardType::Spell);
test_deserialization!(deserialize_unit, r#""Unit""#, CardType::Unit);
test_deserialization!(deserialize_ability, r#""Ability""#, CardType::Ability);
test_deserialization!(deserialize_landmark, r#""Landmark""#, CardType::Landmark);
test_deserialization!(deserialize_fallback, r#""Xyzzy""#, CardType::Unsupported);
}