Skip to content

Commit

Permalink
test: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
siketyan committed Dec 6, 2022
1 parent d3ba648 commit 264965b
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,21 @@ mod tests {
)
}

#[test]
fn parse_from_pattern_repo() {
assert_eq!(
Url {
vcs: Vcs::Git,
scheme: Scheme::Https,
user: None,
host: Host::GitHub,
owner: "siketyan".to_string(),
repo: "siketyan.github.io".to_string()
},
Url::from_pattern("siketyan.github.io", Some("siketyan")).unwrap(),
)
}

#[test]
fn parse_from_pattern_org_repo() {
assert_eq!(
Expand All @@ -296,7 +311,7 @@ mod tests {
owner: "siketyan".to_string(),
repo: "siketyan.github.io".to_string()
},
Url::from_pattern("siketyan/siketyan.github.io").unwrap(),
Url::from_pattern("siketyan/siketyan.github.io", None).unwrap(),
)
}

Expand All @@ -311,7 +326,7 @@ mod tests {
owner: "siketyan".to_string(),
repo: "siketyan.github.io".to_string()
},
Url::from_pattern("gitlab.com:siketyan/siketyan.github.io").unwrap(),
Url::from_pattern("gitlab.com:siketyan/siketyan.github.io", None).unwrap(),
)
}

Expand All @@ -326,7 +341,7 @@ mod tests {
owner: "siketyan".to_string(),
repo: "siketyan.github.io".to_string()
},
Url::from_pattern("[email protected]:siketyan/siketyan.github.io.git").unwrap(),
Url::from_pattern("[email protected]:siketyan/siketyan.github.io.git", None).unwrap(),
)
}

Expand Down

0 comments on commit 264965b

Please sign in to comment.