From 89accc8b26bba63d9431d0de240530c72d8e0149 Mon Sep 17 00:00:00 2001 From: Graham Date: Thu, 3 Sep 2020 10:48:56 +0100 Subject: [PATCH] Rename root to ROOT Path is immutable. Signed-off-by: Graham --- cache/src/test/java/dev/openrs2/cache/DiskStoreTest.kt | 10 +++++----- .../test/java/dev/openrs2/cache/FlatFileStoreTest.kt | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cache/src/test/java/dev/openrs2/cache/DiskStoreTest.kt b/cache/src/test/java/dev/openrs2/cache/DiskStoreTest.kt index b3e97f2e..be0a8fb3 100644 --- a/cache/src/test/java/dev/openrs2/cache/DiskStoreTest.kt +++ b/cache/src/test/java/dev/openrs2/cache/DiskStoreTest.kt @@ -15,7 +15,7 @@ import kotlin.test.assertFalse import kotlin.test.assertTrue object DiskStoreTest { - private val root = Paths.get(DiskStoreTest::class.java.getResource("disk-store").toURI()) + private val ROOT = Paths.get(DiskStoreTest::class.java.getResource("disk-store").toURI()) @Test fun testBounds() { @@ -727,7 +727,7 @@ object DiskStoreTest { } private fun readTest(name: String, f: (Store) -> Unit) { - DiskStore.open(root.resolve(name)).use { store -> + DiskStore.open(ROOT.resolve(name)).use { store -> f(store) } } @@ -739,7 +739,7 @@ object DiskStoreTest { f(store) } - val expected = root.resolve(name) + val expected = ROOT.resolve(name) assertTrue(expected.recursiveEquals(actual)) } } @@ -747,13 +747,13 @@ object DiskStoreTest { private fun overwriteTest(src: String, name: String, f: (Store) -> Unit) { Jimfs.newFileSystem(Configuration.unix()).use { fs -> val actual = fs.getPath("/cache") - root.resolve(src).recursiveCopy(actual) + ROOT.resolve(src).recursiveCopy(actual) DiskStore.open(actual).use { store -> f(store) } - val expected = root.resolve(name) + val expected = ROOT.resolve(name) assertTrue(expected.recursiveEquals(actual)) } } diff --git a/cache/src/test/java/dev/openrs2/cache/FlatFileStoreTest.kt b/cache/src/test/java/dev/openrs2/cache/FlatFileStoreTest.kt index 9c12520a..8cf90c07 100644 --- a/cache/src/test/java/dev/openrs2/cache/FlatFileStoreTest.kt +++ b/cache/src/test/java/dev/openrs2/cache/FlatFileStoreTest.kt @@ -17,7 +17,7 @@ import kotlin.test.assertTrue object FlatFileStoreTest { private val IGNORE_GIT_EMPTY = { path: Path -> path.fileName.toString() != ".gitempty" } - private val root = Paths.get(FlatFileStoreTest::class.java.getResource("flat-file-store").toURI()) + private val ROOT = Paths.get(FlatFileStoreTest::class.java.getResource("flat-file-store").toURI()) @Test fun testBounds() { @@ -243,7 +243,7 @@ object FlatFileStoreTest { } private fun readTest(name: String, f: (Store) -> Unit) { - FlatFileStore.open(root.resolve(name)).use { store -> + FlatFileStore.open(ROOT.resolve(name)).use { store -> f(store) } } @@ -255,7 +255,7 @@ object FlatFileStoreTest { f(store) } - val expected = root.resolve(name) + val expected = ROOT.resolve(name) assertTrue(expected.recursiveEquals(actual, filter = IGNORE_GIT_EMPTY)) } } @@ -263,13 +263,13 @@ object FlatFileStoreTest { private fun overwriteTest(src: String, name: String, f: (Store) -> Unit) { Jimfs.newFileSystem(Configuration.unix()).use { fs -> val actual = fs.getPath("/cache") - root.resolve(src).recursiveCopy(actual) + ROOT.resolve(src).recursiveCopy(actual) FlatFileStore.open(actual).use { store -> f(store) } - val expected = root.resolve(name) + val expected = ROOT.resolve(name) assertTrue(expected.recursiveEquals(actual, filter = IGNORE_GIT_EMPTY)) } }