Skip to content

Commit

Permalink
Add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
IRus committed Feb 1, 2024
1 parent e555a5f commit 890f169
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "1.0"
linter: jetbrains/qodana-jvm-community:2023.3
include:
- name: UnusedSymbol
exclude:
- name: 'All'
paths:
- "database"
24 changes: 24 additions & 0 deletions src/test/kotlin/io/heapy/komok/jdun/GenericKeyAnnotationTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.heapy.komok.jdun

import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import org.opentest4j.AssertionFailedError
import kotlin.reflect.typeOf

/**
* Nice to have for qualifier support without extra methods calls.
*
* https://youtrack.jetbrains.com/issue/KT-29919
*/
internal class GenericKeyAnnotationTest {
@Target(AnnotationTarget.TYPE)
annotation class Foo

@Test
fun `annotation not preserved`() {
assertThrows<AssertionFailedError> {
assertEquals(1, typeOf<@Foo String>().annotations.size)
}
}
}
24 changes: 24 additions & 0 deletions src/test/kotlin/io/heapy/komok/jdun/LambdaReflectionTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package io.heapy.komok.jdun

import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import kotlin.reflect.jvm.ExperimentalReflectionOnLambdas
import kotlin.reflect.jvm.internal.KotlinReflectionInternalError
import kotlin.reflect.jvm.reflect

/**
* @author Ruslan Ibrahimau
*/
internal class LambdaReflectionTest {
@OptIn(ExperimentalReflectionOnLambdas::class)
@Test
fun `lambda cannot be called`() {
val lambda = { a: String, b: Int -> a + b }

// Since feature not yet implemented in Kotlin
assertThrows<KotlinReflectionInternalError> {
val reflection = lambda.reflect()
reflection?.call("Hello ", 42)
}
}
}

0 comments on commit 890f169

Please sign in to comment.