Skip to content

Commit 37b26ef

Browse files
committed
Add kotlinx.html test script to script with deps example
1 parent c5a211e commit 37b26ef

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

jvm/basic/jvm-maven-deps/host/src/test/kotlin/org/jetbrains/kotlin/script/examples/jvm/resolve/maven/test/resolveTest.kt

+10
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ class ResolveTest {
2323
)
2424
}
2525

26+
@Test
27+
fun testKotlinxHtml() {
28+
val res = evalFile(File("testData/hello-kotlinx-html.scriptwithdeps.kts"))
29+
30+
Assert.assertTrue(
31+
"test failed:\n ${res.reports.joinToString("\n ") { it.message + if (it.exception == null) "" else ": ${it.exception}" }}",
32+
res is ResultWithDiagnostics.Success
33+
)
34+
}
35+
2636
@Test
2737
fun testUnresolvedJunit() {
2838
val res = evalFile(File("testData/hello-unresolved-junit.scriptwithdeps.kts"))
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@file:Repository("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
2+
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.3")
3+
4+
import kotlinx.html.*; import kotlinx.html.stream.*; import kotlinx.html.attributes.*
5+
6+
val addressee = "World"
7+
8+
print(
9+
createHTML().html {
10+
body {
11+
h1 { +"Hello, $addressee!" }
12+
}
13+
}
14+
)
15+

0 commit comments

Comments
 (0)