Skip to content

Commit

Permalink
test: test for did-web parsing for id with encoded port
Browse files Browse the repository at this point in the history
  • Loading branch information
enmand committed Jun 10, 2024
1 parent 83296f4 commit 4bc9f42
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/web5/src/dids/methods/web/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,19 @@ mod tests {
let did_uri = "did:web:tbd.website:with:path";
let result = Resolver::new(Identifier::parse(did_uri).unwrap());
assert_eq!(result.did_url, "https://tbd.website/with/path/did.json");

let did_uri = "did:web:tbd.website%3A8080";
let result = Resolver::new(Identifier::parse(did_uri).unwrap());
assert_eq!(
result.did_url,
"https://tbd.website:8080/.well-known/did.json"
);

let did_uri = "did:web:tbd.website%3A8080:with:path";
let result = Resolver::new(Identifier::parse(did_uri).unwrap());
assert_eq!(
result.did_url,
"https://tbd.website:8080/with/path/did.json"
);
}
}

0 comments on commit 4bc9f42

Please sign in to comment.