diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-08 00:50:54 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-08 00:50:54 +0000 |
| commit | f75e1c59aacf5ce668fd327e4e3d827511661c2a (patch) | |
| tree | 867926c7503e7c587e86c67896a9e7347600447b /tests/common/purgatory_helpers.rs | |
| parent | 3f14f998d64b5fa15bdddd7570b4f72874eb9f29 (diff) | |
chore: cargo fmt
Diffstat (limited to 'tests/common/purgatory_helpers.rs')
| -rw-r--r-- | tests/common/purgatory_helpers.rs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/tests/common/purgatory_helpers.rs b/tests/common/purgatory_helpers.rs index 125f485..b39982e 100644 --- a/tests/common/purgatory_helpers.rs +++ b/tests/common/purgatory_helpers.rs | |||
| @@ -51,7 +51,7 @@ pub fn create_test_repo_with_commit(path: &Path, variant: CommitVariant) -> Resu | |||
| 51 | // Configure git user for commits | 51 | // Configure git user for commits |
| 52 | run_git(path, &["config", "user.email", "test@example.com"])?; | 52 | run_git(path, &["config", "user.email", "test@example.com"])?; |
| 53 | run_git(path, &["config", "user.name", "Test User"])?; | 53 | run_git(path, &["config", "user.name", "Test User"])?; |
| 54 | 54 | ||
| 55 | // Disable GPG signing for tests (prevents yubikey prompts) | 55 | // Disable GPG signing for tests (prevents yubikey prompts) |
| 56 | run_git(path, &["config", "commit.gpgsign", "false"])?; | 56 | run_git(path, &["config", "commit.gpgsign", "false"])?; |
| 57 | run_git(path, &["config", "tag.gpgsign", "false"])?; | 57 | run_git(path, &["config", "tag.gpgsign", "false"])?; |
| @@ -710,7 +710,8 @@ mod tests { | |||
| 710 | // Check d-tag | 710 | // Check d-tag |
| 711 | let has_d_tag = event.tags.iter().any(|tag| { | 711 | let has_d_tag = event.tags.iter().any(|tag| { |
| 712 | let slice = tag.as_slice(); | 712 | let slice = tag.as_slice(); |
| 713 | slice.first().is_some_and(|t| t == "d") && slice.get(1).is_some_and(|v| v == "test-repo") | 713 | slice.first().is_some_and(|t| t == "d") |
| 714 | && slice.get(1).is_some_and(|v| v == "test-repo") | ||
| 714 | }); | 715 | }); |
| 715 | assert!(has_d_tag, "Event should have 'd' tag with identifier"); | 716 | assert!(has_d_tag, "Event should have 'd' tag with identifier"); |
| 716 | 717 | ||
| @@ -751,7 +752,8 @@ mod tests { | |||
| 751 | // Check a-tag | 752 | // Check a-tag |
| 752 | let has_a_tag = event.tags.iter().any(|tag| { | 753 | let has_a_tag = event.tags.iter().any(|tag| { |
| 753 | let slice = tag.as_slice(); | 754 | let slice = tag.as_slice(); |
| 754 | slice.first().is_some_and(|t| t == "a") && slice.get(1).is_some_and(|v| v == &repo_coord) | 755 | slice.first().is_some_and(|t| t == "a") |
| 756 | && slice.get(1).is_some_and(|v| v == &repo_coord) | ||
| 755 | }); | 757 | }); |
| 756 | assert!(has_a_tag, "Event should have 'a' tag"); | 758 | assert!(has_a_tag, "Event should have 'a' tag"); |
| 757 | 759 | ||
| @@ -806,7 +808,10 @@ mod tests { | |||
| 806 | &repo_coord, | 808 | &repo_coord, |
| 807 | "abc123def456", | 809 | "abc123def456", |
| 808 | "Test PR with clone", | 810 | "Test PR with clone", |
| 809 | &["http://fork-server.com/repo.git", "http://another-server.com/repo.git"], | 811 | &[ |
| 812 | "http://fork-server.com/repo.git", | ||
| 813 | "http://another-server.com/repo.git", | ||
| 814 | ], | ||
| 810 | ) | 815 | ) |
| 811 | .expect("Failed to create PR event with clone"); | 816 | .expect("Failed to create PR event with clone"); |
| 812 | 817 | ||
| @@ -815,7 +820,8 @@ mod tests { | |||
| 815 | // Check a-tag | 820 | // Check a-tag |
| 816 | let has_a_tag = event.tags.iter().any(|tag| { | 821 | let has_a_tag = event.tags.iter().any(|tag| { |
| 817 | let slice = tag.as_slice(); | 822 | let slice = tag.as_slice(); |
| 818 | slice.first().is_some_and(|t| t == "a") && slice.get(1).is_some_and(|v| v == &repo_coord) | 823 | slice.first().is_some_and(|t| t == "a") |
| 824 | && slice.get(1).is_some_and(|v| v == &repo_coord) | ||
| 819 | }); | 825 | }); |
| 820 | assert!(has_a_tag, "Event should have 'a' tag"); | 826 | assert!(has_a_tag, "Event should have 'a' tag"); |
| 821 | 827 | ||
| @@ -831,8 +837,12 @@ mod tests { | |||
| 831 | let has_clone_tag = event.tags.iter().any(|tag| { | 837 | let has_clone_tag = event.tags.iter().any(|tag| { |
| 832 | let slice = tag.as_slice(); | 838 | let slice = tag.as_slice(); |
| 833 | slice.first().is_some_and(|t| t == "clone") | 839 | slice.first().is_some_and(|t| t == "clone") |
| 834 | && slice.get(1).is_some_and(|v| v == "http://fork-server.com/repo.git") | 840 | && slice |
| 835 | && slice.get(2).is_some_and(|v| v == "http://another-server.com/repo.git") | 841 | .get(1) |
| 842 | .is_some_and(|v| v == "http://fork-server.com/repo.git") | ||
| 843 | && slice | ||
| 844 | .get(2) | ||
| 845 | .is_some_and(|v| v == "http://another-server.com/repo.git") | ||
| 836 | }); | 846 | }); |
| 837 | assert!(has_clone_tag, "Event should have 'clone' tag with URLs"); | 847 | assert!(has_clone_tag, "Event should have 'clone' tag with URLs"); |
| 838 | } | 848 | } |
| @@ -855,6 +865,9 @@ mod tests { | |||
| 855 | let slice = tag.as_slice(); | 865 | let slice = tag.as_slice(); |
| 856 | slice.first().is_some_and(|t| t == "clone") | 866 | slice.first().is_some_and(|t| t == "clone") |
| 857 | }); | 867 | }); |
| 858 | assert!(!has_clone_tag, "Event should not have 'clone' tag when no URLs provided"); | 868 | assert!( |
| 869 | !has_clone_tag, | ||
| 870 | "Event should not have 'clone' tag when no URLs provided" | ||
| 871 | ); | ||
| 859 | } | 872 | } |
| 860 | } | 873 | } |