Skip to content

Commit

Permalink
Create a parent folder. Fix android#1242.
Browse files Browse the repository at this point in the history
Change-Id: I5b2c2ec315b8c5fadff0b0b33e5cd51603c1e30a
  • Loading branch information
Jaehwa-Noh committed Aug 12, 2024
1 parent 50b13ec commit 2d030d3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import dagger.hilt.components.SingletonComponent
import dagger.hilt.testing.TestInstallIn
import kotlinx.coroutines.CoroutineScope
import org.junit.rules.TemporaryFolder
import java.io.File
import javax.inject.Singleton

@Module
Expand Down Expand Up @@ -57,5 +58,9 @@ fun TemporaryFolder.testUserPreferencesDataStore(
serializer = userPreferencesSerializer,
scope = coroutineScope,
) {
newFile("user_preferences_test.pb")
// Add a parentFolder for the Windows users.
// If create just on a File on the temporaryFolder, rename error was occurred.
// See https://github.com/android/nowinandroid/issues/1242
val parentFolder = newFolder("datastore")
File(parentFolder, "user_preferences_test.pb")
}

0 comments on commit 2d030d3

Please sign in to comment.