diff --git a/packages/shacl-validator-py/src/rdfc_shacl/__pycache__/__init__.cpython-312.pyc b/packages/shacl-validator-py/src/rdfc_shacl/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..48e1afc Binary files /dev/null and b/packages/shacl-validator-py/src/rdfc_shacl/__pycache__/__init__.cpython-312.pyc differ diff --git a/packages/shacl-validator-py/src/rdfc_shacl/__pycache__/validator.cpython-312.pyc b/packages/shacl-validator-py/src/rdfc_shacl/__pycache__/validator.cpython-312.pyc new file mode 100644 index 0000000..b76a23f Binary files /dev/null and b/packages/shacl-validator-py/src/rdfc_shacl/__pycache__/validator.cpython-312.pyc differ diff --git a/src/main/kotlin/intermediate/IRRunner.kt b/src/main/kotlin/intermediate/IRRunner.kt index 88f6d4e..2bb3e51 100644 --- a/src/main/kotlin/intermediate/IRRunner.kt +++ b/src/main/kotlin/intermediate/IRRunner.kt @@ -6,7 +6,7 @@ data class IRRunner( val uri: String, val directory: File? = null, val entrypoint: String? = null, - val type: IRRunner.Type, + val type: Type, ) { enum class Type { GRPC, diff --git a/src/main/kotlin/parser/impl/jena/RDFC.kt b/src/main/kotlin/parser/impl/jena/RDFC.kt index 2c9b719..1088633 100644 --- a/src/main/kotlin/parser/impl/jena/RDFC.kt +++ b/src/main/kotlin/parser/impl/jena/RDFC.kt @@ -13,7 +13,6 @@ class RDFC { val target = ResourceFactory.createProperty("${NS}target")!! val metadata = ResourceFactory.createProperty("${NS}metadata")!! val arguments = ResourceFactory.createProperty("${NS}arguments")!! - val kotlinRunner = ResourceFactory.createResource("${NS}Kotlin")!! val dependency = ResourceFactory.createProperty("${NS}dependency")!! val version = ResourceFactory.createProperty("${NS}version")!! val author = ResourceFactory.createProperty("${NS}author")!! diff --git a/src/test/kotlin/extensions/ChannelTest.kt b/src/test/kotlin/extensions/ChannelTest.kt new file mode 100644 index 0000000..9fa38b5 --- /dev/null +++ b/src/test/kotlin/extensions/ChannelTest.kt @@ -0,0 +1,29 @@ +package extensions + +import kotlin.test.Test +import kotlin.test.assertEquals +import kotlinx.coroutines.channels.Channel +import kotlinx.coroutines.channels.ReceiveChannel +import kotlinx.coroutines.channels.SendChannel +import kotlinx.coroutines.runBlocking +import technology.idlab.extensions.map + +class ChannelTest { + @Test + fun mapIntToString() = runBlocking { + val channel: Channel = Channel(Channel.UNLIMITED) + + // Map to the correct types using mapper function. + val sender: SendChannel = channel.map(this) { it.toString() } + val receiver: ReceiveChannel = channel + + sender.send(1) + sender.send(2) + sender.send(3) + sender.close() + + assertEquals("1", receiver.receive()) + assertEquals("2", receiver.receive()) + assertEquals("3", receiver.receive()) + } +} diff --git a/src/test/kotlin/extensions/FileTest.kt b/src/test/kotlin/extensions/FileTest.kt new file mode 100644 index 0000000..34ab326 --- /dev/null +++ b/src/test/kotlin/extensions/FileTest.kt @@ -0,0 +1,32 @@ +package extensions + +import java.io.File +import kotlin.test.Test +import kotlin.test.assertEquals +import technology.idlab.extensions.rawPath + +class FileTest { + @Test + fun empty() { + val file = File("") + assertEquals("", file.rawPath()) + } + + @Test + fun slashes() { + val file = File("/////") + assertEquals("/", file.rawPath()) + } + + @Test + fun filePrefix() { + val file = File("file:/home/admin") + assertEquals("/home/admin", file.rawPath()) + } + + @Test + fun filePrefixDoubleSlash() { + val file = File("file://home/admin") + assertEquals("/home/admin", file.rawPath()) + } +}