From 0a5c23757c2a0fc8784ea1b5a3ad5b0cba0709e0 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 3 May 2025 11:53:50 +0200 Subject: tests in some places --- import/asset_token/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'import/asset_token/src') diff --git a/import/asset_token/src/lib.rs b/import/asset_token/src/lib.rs index de7d2be..7334076 100644 --- a/import/asset_token/src/lib.rs +++ b/import/asset_token/src/lib.rs @@ -48,7 +48,7 @@ static ASSET_KEY: LazyLock = LazyLock::new(|| { } }); -#[derive(Debug, Encode, Decode, Serialize)] +#[derive(Debug, Encode, Decode, Serialize, PartialEq, Eq)] pub enum AssetInner { Federated { host: String, asset: Vec }, Cache(CachePath), @@ -101,3 +101,14 @@ impl AssetInner { matches!(self, Self::Federated { .. }) } } + +#[test] +fn test_identities() { + *CONF_PRELOAD.lock().unwrap() = Some(Config { asset_key: None }); + + let a = AssetInner::Assets(PathBuf::new()); + let b = a.ser(); + let c = AssetInner::deser(&b.0).unwrap(); + + assert_eq!(a, c) +} -- cgit v1.2.3-70-g09d2