(t *testing.T)
| 743 | } |
| 744 | |
| 745 | func TestGetCurrentRepoName(t *testing.T) { |
| 746 | tmpDir := testutil.TempDir(t, "test-*") |
| 747 | |
| 748 | originalDir, err := os.Getwd() |
| 749 | if err != nil { |
| 750 | t.Fatalf("Failed to get current directory: %v", err) |
| 751 | } |
| 752 | defer func() { |
| 753 | _ = os.Chdir(originalDir) |
| 754 | }() |
| 755 | |
| 756 | if err := os.Chdir(tmpDir); err != nil { |
| 757 | t.Fatalf("Failed to change to temp directory: %v", err) |
| 758 | } |
| 759 | |
| 760 | // Initialize git repo |
| 761 | if err := exec.Command("git", "init").Run(); err != nil { |
| 762 | t.Skip("Git not available") |
| 763 | } |
| 764 | |
| 765 | // Get repo name |
| 766 | repoName := getCurrentRepoName() |
| 767 | if repoName == "" { |
| 768 | t.Error("Expected getCurrentRepoName() to return a non-empty string") |
| 769 | } |
| 770 | } |
nothing calls this directly
no test coverage detected