~goorzhel/sota-slack-spotter

da16d349679b3da717163392337f972472f86f32 — Antonio Gurgel 2 months ago b52cec6
Add some rigor to test_spot_deserialization
1 files changed, 3 insertions(+), 2 deletions(-)

M src/test.rs
M src/test.rs => src/test.rs +3 -2
@@ 8,7 8,7 @@ use crate::{
    cache::{Cache, Cachelike},
    callsign::{Callsign, Callsigns},
    slack::extract_callsigns,
    sota::{alert::Alert, spot::Spot},
    sota::{alert::Alert, spot::Spot, Mode},
};

fn spot() -> String {


@@ 40,7 40,8 @@ fn n6tno_spot() -> Result<Spot> {

#[test]
fn test_spot_deserialization() -> Result<()> {
    serde_json::from_str::<Vec<Spot>>(&spot())?;
    let spot = &serde_json::from_str::<Vec<Spot>>(&spot())?[0];
    assert_eq!(spot.mode, Mode::CW);
    Ok(())
}