@@ -342,16 +342,16 @@ func TestConfigureGo_UnsetEnv(t *testing.T) {
342342
343343// Test that configureGo unsets any existing multi-entry GOPROXY env var before configuring.
344344func TestConfigureGo_UnsetEnv_MultiEntry (t * testing.T ) {
345- testCmd := createTestSetupCommand (project .Go )
346- // Simulate existing multi-entry GOPROXY in environment
347- t .Setenv ("GOPROXY" , "user:pass@dummy,goproxy2" )
348- // Ensure server details have credentials so configureGo proceeds
349- testCmd .serverDetails .SetAccessToken (dummyToken )
350-
351- // Invoke configureGo directly
352- require .NoError (t , testCmd .configureGo ())
353- // After calling, the GOPROXY env var should be cleared
354- assert .Empty (t , os .Getenv ("GOPROXY" ), "GOPROXY should be unset by configureGo to avoid env override for multi-entry lists" )
345+ testCmd := createTestSetupCommand (project .Go )
346+ // Simulate existing multi-entry GOPROXY in environment
347+ t .Setenv ("GOPROXY" , "user:pass@dummy,goproxy2" )
348+ // Ensure server details have credentials so configureGo proceeds
349+ testCmd .serverDetails .SetAccessToken (dummyToken )
350+
351+ // Invoke configureGo directly
352+ require .NoError (t , testCmd .configureGo ())
353+ // After calling, the GOPROXY env var should be cleared
354+ assert .Empty (t , os .Getenv ("GOPROXY" ), "GOPROXY should be unset by configureGo to avoid env override for multi-entry lists" )
355355}
356356
357357func TestSetupCommand_Gradle (t * testing.T ) {
@@ -468,6 +468,24 @@ func TestIsSupportedPackageManager(t *testing.T) {
468468 assert .False (t , IsSupportedPackageManager (project .Cocoapods ), "Package manager Cocoapods should not be supported" )
469469}
470470
471+ func TestGetRepositoryPackageType (t * testing.T ) {
472+ // Test supported package managers
473+ for projectType , packageType := range packageManagerToRepositoryPackageType {
474+ t .Run ("Supported - " + projectType .String (), func (t * testing.T ) {
475+ actualType , err := GetRepositoryPackageType (projectType )
476+ require .NoError (t , err )
477+ assert .Equal (t , packageType , actualType )
478+ })
479+ }
480+
481+ // Test unsupported package manager
482+ t .Run ("Unsupported" , func (t * testing.T ) {
483+ _ , err := GetRepositoryPackageType (project .Cocoapods )
484+ require .Error (t , err )
485+ assert .Contains (t , err .Error (), "unsupported package manager" )
486+ })
487+ }
488+
471489func TestSetupCommand_Maven (t * testing.T ) {
472490 // Retrieve the home directory and construct the settings.xml file path.
473491 homeDir , err := os .UserHomeDir ()
0 commit comments