File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ package io.github.typesafegithub.workflows
2+
3+ import io.github.typesafegithub.workflows.domain.Workflow
4+ import io.kotest.core.spec.style.FunSpec
5+ import io.kotest.matchers.shouldBe
6+ import java.io.DataInputStream
7+
8+ class JavaBytecodeVersionTest :
9+ FunSpec (
10+ {
11+ test(" library is built with desired Java bytecode version" ) {
12+ Workflow ::class .java.classLoader
13+ .getResourceAsStream(
14+ " io/github/typesafegithub/workflows/domain/Workflow.class" ,
15+ )!!
16+ .use { inputStream ->
17+ val dataInputStream = DataInputStream (inputStream)
18+ require(dataInputStream.readInt() == 0xCAFEBABE .toInt()) { " Invalid class header" }
19+ val minor = dataInputStream.readUnsignedShort()
20+ val major = dataInputStream.readUnsignedShort()
21+
22+ // Corresponds to JDK 11
23+ // See https://javaalmanac.io/bytecode/versions/
24+ major shouldBe 55
25+ minor shouldBe 0
26+ }
27+ }
28+ },
29+ )
You can’t perform that action at this time.
0 commit comments