Skip to content

Commit 8c9e243

Browse files
committed
cleanup tests, lint
1 parent 9467987 commit 8c9e243

File tree

1 file changed

+3
-32
lines changed

1 file changed

+3
-32
lines changed

internal/interpreters/r_test.go

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -788,48 +788,19 @@ func (s *CreateLockfileFunctionalSuite) TearDownSuite() {
788788
// TestCreateLockfileWithSpacesInPath tests that CreateLockfile can successfully
789789
// create a lockfile in a path that contains spaces
790790
func (s *CreateLockfileFunctionalSuite) TestCreateLockfileWithSpacesInPath() {
791-
// Skip if R is not available with renv
792-
// if !s.isRenvAvailable() {
793-
// s.T().Skip("renv package is not available in R")
794-
// return
795-
// }
796-
797-
// Create a lockfile path with spaces
791+
// Create a lockfile on a path with spaces, this is problematic on Windows but
798792
lockfilePath := util.NewAbsolutePath(filepath.Join(s.tempSpaceDir, "renv.lock"), s.fs)
799793

800794
// Ensure the directory exists
801795
err := os.MkdirAll(filepath.Dir(lockfilePath.String()), 0755)
802796
s.Require().NoError(err)
803797

804-
// Try to create the lockfile
798+
// Try to successfully create the lockfile
805799
err = s.rInterpreter.CreateLockfile(lockfilePath)
806-
807-
// This should succeed with our fix
808800
s.NoError(err, "CreateLockfile should succeed with spaces in the path")
809801

810-
// Verify the lockfile was created
802+
// And verify
811803
exists, err := lockfilePath.Exists()
812804
s.NoError(err, "Should be able to check if lockfile exists")
813805
s.True(exists, "Lockfile should exist after CreateLockfile")
814806
}
815-
816-
// isRenvAvailable checks if the renv package is available in R
817-
func (s *CreateLockfileFunctionalSuite) isRenvAvailable() bool {
818-
// We'll assume renv might be available if:
819-
// 1. R is available (we already checked this)
820-
// 2. We have a valid R interpreter
821-
822-
// First, let's just create a minimal test file without spaces
823-
tempLockfile := util.NewAbsolutePath(filepath.Join(s.tempDir, "test.lock"), s.fs)
824-
825-
// Try to create it - this will fail if renv isn't available
826-
err := s.rInterpreter.CreateLockfile(tempLockfile)
827-
if err != nil {
828-
fmt.Printf("Error creating test lockfile: %v\n", err)
829-
return false
830-
}
831-
832-
// If we got here, renv is probably available
833-
exists, _ := tempLockfile.Exists()
834-
return exists
835-
}

0 commit comments

Comments
 (0)