Skip to content

Commit 176ea32

Browse files
committed
Cleanup hg/mercurial messy test
1 parent 7f63e1d commit 176ea32

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

get_hg_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ func TestHgGetter_HgArgumentsNotAllowed(t *testing.T) {
110110

111111
g := new(HgGetter)
112112

113-
// If arguments are allowed in the destination, this Get call will fail
114-
dst := "--config=alias.clone=!false"
115-
defer func() { _ = os.RemoveAll(dst) }()
113+
// Test that destination paths that look like hg arguments are treated as literal paths
114+
// Create the problematic directory name inside a temp directory for cleanup
115+
tempBase := t.TempDir()
116+
dst := filepath.Join(tempBase, "--config=alias.clone=!false")
116117
err := g.Get(dst, testModuleURL("basic-hg"))
117118
if err != nil {
118119
t.Fatalf("Expected no err, got: %s", err)

0 commit comments

Comments
 (0)