aboutsummaryrefslogtreecommitdiff
path: root/import/asset_token/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'import/asset_token/src/lib.rs')
-rw-r--r--import/asset_token/src/lib.rs13
1 files changed, 12 insertions, 1 deletions
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<Aes256GcmSiv> = LazyLock::new(|| {
}
});
-#[derive(Debug, Encode, Decode, Serialize)]
+#[derive(Debug, Encode, Decode, Serialize, PartialEq, Eq)]
pub enum AssetInner {
Federated { host: String, asset: Vec<u8> },
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)
+}