From 885ff29533943ec7ba68bfc143693f40a247049b Mon Sep 17 00:00:00 2001 From: JimFuller-RedHat Date: Tue, 10 Sep 2024 17:00:07 +0200 Subject: [PATCH] Added test confirming purl comparison works #777 --- common/src/purl.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/common/src/purl.rs b/common/src/purl.rs index deafc9112..535bbeaca 100644 --- a/common/src/purl.rs +++ b/common/src/purl.rs @@ -329,4 +329,21 @@ mod tests { r#""pkg://rpm/redhat/subscription-manager-rhsm-certificates@1.28.29.1-1.el8_6?arch=s390x""# )) } + + #[test(tokio::test)] + async fn purl_cmp() -> Result<(), anyhow::Error> { + let purl1: Purl = serde_json::from_str( + r#" + "pkg:rpm/redhat/filesystem@3.8-6.el8?arch=aarch64&tags=test1" + "#, + ) + .unwrap(); + let purl2: Purl = serde_json::from_str( + r#" + "pkg:rpm/redhat/filesystem@3.8-6.el8?tags=test1&arch=aarch64" + "#, + ) + .unwrap(); + Ok(assert_eq!(purl1, purl2)) + } }