summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2021-04-24 07:55:02 -0400
committerDan Davison <dandavison7@gmail.com>2021-04-24 07:55:02 -0400
commit9b13f7bd77f74cbe5c54378eac065659b39849da (patch)
tree610a39e1f4c8c6c8708d285596233731c4970fb7
parent9a218b27c761daecbfdaddcefaf0393fee8959ad (diff)
Test HTTPS and SSH Github URLs
-rw-r--r--src/git_config/git_config_entry.rs32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/git_config/git_config_entry.rs b/src/git_config/git_config_entry.rs
index bf324ef6..f8c63c69 100644
--- a/src/git_config/git_config_entry.rs
+++ b/src/git_config/git_config_entry.rs
@@ -44,22 +44,20 @@ mod tests {
use super::*;
#[test]
- fn test_parse_github_url_with_dot_git_suffix() {
- let parsed = GitRemoteRepo::from_str("git@github.com:dandavison/delta.git");
- assert!(parsed.is_ok());
- assert_eq!(
- parsed.unwrap(),
- GitRemoteRepo::GitHubRepo("dandavison/delta".to_string())
- );
- }
-
- #[test]
- fn test_parse_github_url_without_dot_git_suffix() {
- let parsed = GitRemoteRepo::from_str("git@github.com:dandavison/delta");
- assert!(parsed.is_ok());
- assert_eq!(
- parsed.unwrap(),
- GitRemoteRepo::GitHubRepo("dandavison/delta".to_string())
- );
+ fn test_parse_github_urls() {
+ let urls = &[
+ "https://github.com/dandavison/delta.git",
+ "https://github.com/dandavison/delta",
+ "git@github.com:dandavison/delta.git",
+ "git@github.com:dandavison/delta",
+ ];
+ for url in urls {
+ let parsed = GitRemoteRepo::from_str(url);
+ assert!(parsed.is_ok());
+ assert_eq!(
+ parsed.unwrap(),
+ GitRemoteRepo::GitHubRepo("dandavison/delta".to_string())
+ );
+ }
}
}