Skip to content

Commit

Permalink
Update modular tests to be more reasonable
Browse files Browse the repository at this point in the history
  • Loading branch information
Sineaggi committed Jun 4, 2024
1 parent d44d3a4 commit 7913508
Showing 1 changed file with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
package okio.test.integration

import okio.FileSystem
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test

class ModuleTest {
@Test
fun testModule() {
// test okio.test.integration is modular
assertTrue(ModuleTest::class.java.module.isNamed)
assertEquals(ModuleTest::class.java.module.name, "okio.test.integration")
assertFalse(ModuleTest::class.java.module.descriptor.isAutomatic)
// test okio is modular
assertTrue(FileSystem::class.java.module.isNamed)
assertEquals(FileSystem::class.java.module.name, "okio")
assertFalse(FileSystem::class.java.module.descriptor.isAutomatic)
// assert okio is modular
val okioModule = ModuleLayer.boot().modules().single { it.name == "okio" }
assertFalse(okioModule.descriptor.isAutomatic)
assertTrue(okioModule.isExported("okio"))
assertFalse(okioModule.isExported("okio.internal"))
}
}

0 comments on commit 7913508

Please sign in to comment.